diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000000..0450aa42fdd --- /dev/null +++ b/.gitignore @@ -0,0 +1,257 @@ +#### General system gitignore contents: +#### Source: https://raw.githubusercontent.com/github/gitignore/master/Global/Linux.gitignore +*~ + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +#### General system gitignore contents: +#### Source: https://raw.githubusercontent.com/github/gitignore/master/Global/Windows.gitignore +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +#### General system gitignore contents: +#### Source: https://raw.githubusercontent.com/github/gitignore/master/Global/OSX.gitignore +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +#### Visual Studio gitignore contents: +#### Source: https://raw.githubusercontent.com/github/gitignore/master/VisualStudio.gitignore +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studo 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding addin-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +*.[Cc]ache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..77b06da31f8 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,7 @@ +Our project's code repository can be found on the [multitheftauto/mtasa-blue](https://github.com/multitheftauto/mtasa-blue/) Git repository at [GitHub](https://github.com/). We are always looking for new developers, so if you're interested, here are some useful links: + +* [Nightly Builds](https://nightly.mtasa.com/) +* [Bugtracker Roadmap](https://bugs.mtasa.com/roadmap_page.php) +* [Wiki Roadmap](https://wiki.mtasa.com/wiki/Roadmap) + +Before committing, please review the [coding guidelines](https://wiki.mtasa.com/index.php?title=Coding_guidelines). diff --git a/MTA10/ceflauncher/CCefApp.h b/MTA10/ceflauncher/CCefApp.h new file mode 100644 index 00000000000..ce99b3e8f75 --- /dev/null +++ b/MTA10/ceflauncher/CCefApp.h @@ -0,0 +1,104 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: ceflauncher/CCefApp.h +* PURPOSE: CefApp implementation +* +*****************************************************************************/ +#include +#include +#include +#include "V8Helpers.h" +using V8Helpers::CV8Handler; + +class CCefApp : public CefApp, public CefRenderProcessHandler +{ +public: + CCefApp() {} + virtual CefRefPtr GetRenderProcessHandler () override { return this; }; + + // http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnFocusedNodeChanged(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefDOMNode%3E) + virtual void OnFocusedNodeChanged ( CefRefPtr browser, CefRefPtr frame, CefRefPtr node ) override + { + if ( m_bHasInputFocus ) + { + if ( node ) + return; + + // Tell MTA that we lost input focus + auto message = CefProcessMessage::Create ( "InputFocus" ); + message->GetArgumentList ()->SetBool ( 0, false ); + browser->SendProcessMessage ( PID_BROWSER, message ); + + // Set variable to ensure that the event does not trigger twice + m_bHasInputFocus = false; + return; + } + else + { + if ( !node ) + return; + + if ( node->GetType () == CefDOMNode::Type::DOM_NODE_TYPE_ELEMENT && !node->GetFormControlElementType ().empty () ) + { + auto message = CefProcessMessage::Create ( "InputFocus" ); + message->GetArgumentList ()->SetBool ( 0, true ); + browser->SendProcessMessage ( PID_BROWSER, message ); + + // Set variable to ensure that the event does not trigger twice + m_bHasInputFocus = true; + } + } + } + + virtual void OnRegisterCustomSchemes ( CefRefPtr < CefSchemeRegistrar > registrar ) override + { + // Register custom MTA scheme (has to be called in all proceseses) + registrar->AddCustomScheme ( "mtalocal", false, false, false ); + } + + + // http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderProcessHandler.html#OnContextCreated(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefV8Context%3E) // + virtual void OnContextCreated ( CefRefPtr browser, CefRefPtr frame, CefRefPtr context ) override + { + // Get global object and create a v8 handler instance + CefRefPtr globalObject = context->GetGlobal (); + CefRefPtr handler = new CV8Handler ( frame ); + + // Create MTA object + CefRefPtr mtaObject = CefV8Value::CreateObject ( NULL ); + + // Bind V8 --> C++ functions + V8Helpers::BindV8Function ( handler, mtaObject, "triggerEvent", Javascript_triggerEvent ); + // V8Helpers::BindV8Function ( handler, mtaObject, "triggerServerEvent", Javascript_triggerServerEvent ); // Disabled due to security issues + + // Assign mtaObject to global object + globalObject->SetValue ( "mta", mtaObject, V8_PROPERTY_ATTRIBUTE_NONE ); + } + + static void Javascript_triggerEvent ( CefRefPtr frame, const CefV8ValueList& arguments ) + { + if ( arguments.size () == 0 ) + return; + + CefRefPtr message = V8Helpers::SerialiseV8Arguments ( "TriggerLuaEvent", arguments ); + frame->GetBrowser ()->SendProcessMessage ( PID_BROWSER, message ); + } + + static void Javascript_triggerServerEvent ( CefRefPtr frame, const CefV8ValueList& arguments ) + { + if ( arguments.size () == 0 ) + return; + + CefRefPtr message = V8Helpers::SerialiseV8Arguments ( "TriggerServerLuaEvent", arguments ); + frame->GetBrowser ()->SendProcessMessage ( PID_BROWSER, message ); + } + +public: + IMPLEMENT_REFCOUNTING(CCefApp); + +private: + bool m_bHasInputFocus = false; +}; diff --git a/MTA10/ceflauncher/CEFLauncher.vcxproj b/MTA10/ceflauncher/CEFLauncher.vcxproj new file mode 100644 index 00000000000..e8b258047c1 --- /dev/null +++ b/MTA10/ceflauncher/CEFLauncher.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Nightly + Win32 + + + Release + Win32 + + + + {C5076389-A166-4FB8-A083-AC5443482C31} + Win32Proj + ClientCEFLauncher + + + + Application + true + v120_xp + Unicode + + + Application + false + v120_xp + true + Unicode + + + Application + false + v120_xp + true + Unicode + + + + + + + + + + + + + + + + + + + true + $(IncludePath) + $(MyTargetDir)\mta\cef\ + $(ProjectName)_d + $(PlatformTarget)\$(Configuration)\ + + + false + ..\vendor\cef3\include;$(IncludePath) + $(MyTargetDir)\mta\cef\ + $(PlatformTarget)\$(Configuration)\ + + + false + ..\vendor\cef3\include;$(IncludePath) + $(SolutionDir)..\output\MTA San Andreas\mta\cef\ + $(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\$(SafeRootNamespace)\ + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + ..\..\vendor;..\..\vendor\cef3;%(AdditionalIncludeDirectories) + MultiThreadedDebugDLL + + + Windows + true + ..\..\vendor\cef3\Debug\libcef.lib;..\..\vendor\cef3\out\Debug\lib\libcef_dll_wrapper.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + ..\..\vendor;..\..\vendor\cef3;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + ..\..\vendor\cef3\Release\libcef.lib;..\..\vendor\cef3\out\Release\lib\libcef_dll_wrapper.lib;%(AdditionalDependencies) + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;_LIB;%(PreprocessorDefinitions) + true + ..\..\vendor;..\..\vendor\cef3;%(AdditionalIncludeDirectories) + + + Windows + true + true + true + libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb + $(SolutionDir)..\vendor\cef3\Release\;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\libcef_dll_wrapper\lib;%(AdditionalLibraryDirectories) + + + + + + + + + + + + + \ No newline at end of file diff --git a/MTA10/ceflauncher/CEFLauncher.vcxproj.filters b/MTA10/ceflauncher/CEFLauncher.vcxproj.filters new file mode 100644 index 00000000000..96fbe82626c --- /dev/null +++ b/MTA10/ceflauncher/CEFLauncher.vcxproj.filters @@ -0,0 +1,30 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Quelldateien + + + + + Headerdateien + + + Headerdateien + + + \ No newline at end of file diff --git a/MTA10/ceflauncher/Main.cpp b/MTA10/ceflauncher/Main.cpp new file mode 100644 index 00000000000..3621023708c --- /dev/null +++ b/MTA10/ceflauncher/Main.cpp @@ -0,0 +1,20 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: ceflauncher/Main.cpp +* PURPOSE: CEF launcher entry point +* +*****************************************************************************/ +#define WIN32_LEAN_AND_MEAN +#include +#include "CCefApp.h" + +int WINAPI WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdShow, int nCmdShow ) +{ + CefMainArgs mainArgs ( hInstance ); + CefRefPtr app ( new CCefApp ); + + return CefExecuteProcess ( mainArgs, app, NULL ); +} diff --git a/MTA10/ceflauncher/V8Helpers.h b/MTA10/ceflauncher/V8Helpers.h new file mode 100644 index 00000000000..2d8c956b39e --- /dev/null +++ b/MTA10/ceflauncher/V8Helpers.h @@ -0,0 +1,102 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: ceflauncher/V8Helpers.h +* PURPOSE: V8 helper classes and functions +* +*****************************************************************************/ +#include +#include +typedef void ( *JavascriptCallback )( CefRefPtr frame, const CefV8ValueList& arguments ); + +namespace V8Helpers +{ + class CV8Handler : public CefV8Handler + { + public: + CV8Handler ( CefRefPtr frame ) : m_pFrame ( frame ) + { + } + void Bind ( const std::string& name, JavascriptCallback callback ) + { + m_FunctionMap[name] = callback; + } + virtual bool Execute ( const CefString& name, CefRefPtr object, const CefV8ValueList& arguments, CefRefPtr& retval, CefString& exception ) + { + std::map::iterator iter = m_FunctionMap.find ( std::string ( name ) ); + if ( iter != m_FunctionMap.end () ) + { + iter->second ( m_pFrame, arguments ); + return true; + } + return false; + } + void Clear () + { + m_FunctionMap.clear (); + } + + IMPLEMENT_REFCOUNTING ( CV8Handler ); + + private: + CefRefPtr m_pFrame; + std::map m_FunctionMap; + }; + + std::stringstream conversionStream; + void ConvertV8ArgToString ( std::string& outResult, CefRefPtr cefValue ) + { + // Prepare stringstream for next argument (clear and reset states) + conversionStream.str ( "" ); + conversionStream.clear (); + + if ( cefValue->IsBool () ) + conversionStream << cefValue->GetBoolValue (); + else if ( cefValue->IsDouble () ) + conversionStream << cefValue->GetDoubleValue (); + else if ( cefValue->IsInt () ) + conversionStream << cefValue->GetIntValue (); + else if ( cefValue->IsNull () ) + conversionStream << "nil"; + else if ( cefValue->IsString () ) + conversionStream << std::string ( cefValue->GetStringValue () ); + else if ( cefValue->IsUInt () ) + conversionStream << cefValue->GetUIntValue (); + else + conversionStream << "unsupported type"; + + outResult = conversionStream.str (); + } + + CefRefPtr SerialiseV8Arguments ( const std::string& messageName, const CefV8ValueList& arguments ) + { + // Create the process message + CefRefPtr message = CefProcessMessage::Create ( messageName ); + CefRefPtr argList = message->GetArgumentList (); + + // Write the event name + argList->SetString ( 0, arguments[0]->GetStringValue () ); + + // Write number of arguments + argList->SetInt ( 1, arguments.size () - 1 ); + + // Write arguments + for ( size_t i = 1; i < arguments.size (); ++i ) + { + std::string strArgument; + V8Helpers::ConvertV8ArgToString ( strArgument, arguments[i] ); + argList->SetString ( i + 1, strArgument ); + } + + return message; + } + + void BindV8Function ( CefRefPtr handler, CefRefPtr object, const std::string& name, JavascriptCallback cb ) + { + handler->Bind ( name, cb ); + CefRefPtr func = CefV8Value::CreateFunction ( name, handler ); + object->SetValue ( name, func, V8_PROPERTY_ATTRIBUTE_NONE ); + } +} \ No newline at end of file diff --git a/MTA10/core/CClientVariables.cpp b/MTA10/core/CClientVariables.cpp index 3740d4d8133..4af2daa4963 100644 --- a/MTA10/core/CClientVariables.cpp +++ b/MTA10/core/CClientVariables.cpp @@ -295,6 +295,8 @@ void CClientVariables::LoadDefaults ( void ) DEFAULT ( "mapalpha", 155 ); // map alpha DEFAULT ( "browser_speed", 1 ); // Browser speed DEFAULT ( "single_download", 0 ); // Single connection for downloads + DEFAULT ( "packet_tag", 0 ); // Tag network packets + DEFAULT ( "progress_animation", 1 ); // Progress spinner at the bottom of the screen DEFAULT ( "update_build_type", 0 ); // 0-stable 1-test 2-nightly DEFAULT ( "update_auto_install", 1 ); // 0-off 1-on DEFAULT ( "volumetric_shadows", 0 ); // Enable volumetric shadows @@ -318,6 +320,9 @@ void CClientVariables::LoadDefaults ( void ) DEFAULT ( "mute_voice_when_minimized", 0 ); // 0-off 1-on DEFAULT ( "share_file_cache", 1 ); // 0-no 1-share client resource file cache with other MTA installs DEFAULT ( "show_unsafe_resolutions", 0 ); // 0-off 1-show resolutions that are higher that the desktop + DEFAULT ( "browser_remote_websites", true ); // Load remote websites? + DEFAULT ( "browser_remote_javascript", true ); // Execute javascript on remote websites? + DEFAULT ( "browser_plugins", true ); // Enable browser plugins? if(!Exists("locale")) { diff --git a/MTA10/core/CConnectManager.cpp b/MTA10/core/CConnectManager.cpp index e14e53a46aa..dcb6d8d1b6b 100644 --- a/MTA10/core/CConnectManager.cpp +++ b/MTA10/core/CConnectManager.cpp @@ -121,7 +121,7 @@ bool CConnectManager::Connect ( const char* szHost, unsigned short usPort, const // Try to start a network to connect SString strAddress = inet_ntoa ( m_Address ); - if ( m_usPort && !pNet->StartNetwork ( strAddress, m_usPort ) ) + if ( m_usPort && !pNet->StartNetwork ( strAddress, m_usPort, CVARS_GET_VALUE < bool > ( "packet_tag" ) ) ) { SString strBuffer ( _("Connecting to %s at port %u failed!"), m_strHost.c_str (), m_usPort ); CCore::GetSingleton ().ShowMessageBox ( _("Error")+_E("CC22"), strBuffer, MB_BUTTON_OK | MB_ICON_ERROR ); // Failed to connect @@ -251,7 +251,7 @@ void CConnectManager::DoPulse ( void ) if ( time ( NULL ) >= m_tConnectStarted + 8 ) { // Show a message that the connection timed out and abort - g_pCore->ShowNetErrorMessageBox ( _("Error")+_E("CC23"), _("Connection timed out"), "connect-timed-out", true ); + g_pCore->ShowNetErrorMessageBox ( _("Error")+_E("CC23"), _("Connection timed out"), "connect-timed-out", true ); Abort (); } else @@ -267,6 +267,9 @@ void CConnectManager::DoPulse ( void ) case RID_RSA_PUBLIC_KEY_MISMATCH: strError = _("Disconnected: unknown protocol error"); strErrorCode = _E("CC24"); // encryption key mismatch break; + case RID_INCOMPATIBLE_PROTOCOL_VERSION: + strError = _("Disconnected: unknown protocol error"); strErrorCode = _E("CC34"); // old raknet version + break; case RID_REMOTE_DISCONNECTION_NOTIFICATION: strError = _("Disconnected: disconnected remotely"); strErrorCode = _E("CC25"); break; diff --git a/MTA10/core/CCore.cpp b/MTA10/core/CCore.cpp index 4728be0576c..b0de7e6d47c 100644 --- a/MTA10/core/CCore.cpp +++ b/MTA10/core/CCore.cpp @@ -127,10 +127,13 @@ CCore::CCore ( void ) m_pGraphics = new CGraphics ( m_pLocalGUI ); g_pGraphics = m_pGraphics; m_pGUI = NULL; + m_pWebCore = NULL; // Create the mod manager m_pModManager = new CModManager; + CCrashDumpWriter::SetHandlers(); + m_pfnMessageProcessor = NULL; m_pMessageBox = NULL; @@ -226,6 +229,9 @@ CCore::~CCore ( void ) delete m_pLocalGUI; delete m_pGraphics; + // Delete the web + delete m_pWebCore; + // Delete lazy subsystems DestroyGUI (); DestroyXML (); @@ -1133,6 +1139,17 @@ void CCore::DestroyNetwork ( ) } +void CCore::InitialiseWeb () +{ + // Don't initialise webcore twice + if ( m_pWebCore ) + return; + + m_pWebCore = new CWebCore; + m_pWebCore->Initialise (); +} + + void CCore::UpdateIsWindowMinimized ( void ) { m_bIsWindowMinimized = IsIconic ( GetHookedWindow () ) ? true : false; @@ -1169,6 +1186,9 @@ void CCore::DoPreFramePulse ( ) m_pModManager->DoPulsePreFrame (); m_pLocalGUI->DoPulse (); + + CCrashDumpWriter::UpdateCounters(); + TIMING_CHECKPOINT( "-CorePreFrame" ); } @@ -1295,6 +1315,9 @@ void CCore::DoPostFramePulse ( ) GetJoystickManager ()->DoPulse (); // Note: This may indirectly call CMessageLoopHook::ProcessMessage m_pKeyBinds->DoPostFramePulse (); + if ( m_pWebCore ) + m_pWebCore->DoPulse (); + // Notify the mod manager and the connect manager TIMING_CHECKPOINT( "-CorePostFrame1" ); m_pModManager->DoPulsePostFrame (); @@ -1353,6 +1376,9 @@ void CCore::OnModUnload ( ) // Reset client script frame rate limit m_uiClientScriptFrameRateLimit = 0; + + // Clear web whitelist + m_pWebCore->ResetFilter (); } diff --git a/MTA10/core/CCore.h b/MTA10/core/CCore.h index b378edfeab2..b43ef04a82a 100644 --- a/MTA10/core/CCore.h +++ b/MTA10/core/CCore.h @@ -49,6 +49,7 @@ class CCore; #include #include #include "CXfireQuery.h" +#include "CWebCore.h" #define DIRECTINPUT_VERSION 0x0800 #include @@ -107,6 +108,7 @@ class CCore : public CCoreInterface, public CSingleton < CCore > CLocalGUI* GetLocalGUI ( void ); CCommunityInterface* GetCommunity ( void ) { return &m_Community; }; CLocalizationInterface* GetLocalization ( void ) { return g_pLocalization; }; + CWebCoreInterface* GetWebCore ( void ) { return m_pWebCore; }; void SaveConfig ( void ); @@ -183,6 +185,9 @@ class CCore : public CCoreInterface, public CSingleton < CCore > void DeinitGUI ( void ); void DestroyGUI ( void ); + // Web + void InitialiseWeb ( void ); + // Hooks void ApplyHooks ( void ); void ApplyHooks2 ( void ); @@ -287,6 +292,7 @@ class CCore : public CCoreInterface, public CSingleton < CCore > CXMLFile* m_pConfigFile; CClientVariables m_ClientVariables; CCommunity m_Community; + CWebCore* m_pWebCore; // Hook interfaces. CMessageLoopHook * m_pMessageLoopHook; diff --git a/MTA10/core/CCrashDumpWriter.cpp b/MTA10/core/CCrashDumpWriter.cpp index 6309e37525f..2b33621772b 100644 --- a/MTA10/core/CCrashDumpWriter.cpp +++ b/MTA10/core/CCrashDumpWriter.cpp @@ -34,6 +34,8 @@ static std::map < int, SCrashAvertedInfo > ms_CrashAvertedMap; static uint ms_uiTickCountBase = 0; static void* ms_pReservedMemory = NULL; static uint ms_uiInCrashZone = 0; +static uint ms_uiInvalidParameterCount = 0; +static uint ms_uiInvalidParameterCountLogged = 0; typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType, CONST PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam, @@ -97,6 +99,54 @@ void CCrashDumpWriter::LogEvent ( const char* szType, const char* szContext, con } +/////////////////////////////////////////////////////////////// +// +// CCrashDumpWriter::SetHandlers +// +// Static function. Initialize handlers for crash situations +// +/////////////////////////////////////////////////////////////// +void CCrashDumpWriter::SetHandlers( void ) +{ +#ifndef MTA_DEBUG + _set_invalid_parameter_handler( CCrashDumpWriter::HandleInvalidParameter ); + SetCrashHandlerFilter ( CCrashDumpWriter::HandleExceptionGlobal ); + CCrashDumpWriter::ReserveMemoryKBForCrashDumpProcessing( 500 ); +#endif +} + + +/////////////////////////////////////////////////////////////// +// +// CCrashDumpWriter::UpdateCounters +// +// Static function. Called every so often, you know +// +/////////////////////////////////////////////////////////////// +void CCrashDumpWriter::UpdateCounters( void ) +{ + if ( ms_uiInvalidParameterCount > ms_uiInvalidParameterCountLogged && ms_uiInvalidParameterCountLogged < 10 ) + { + AddReportLog( 9206, SString( "InvalidParameterCount changed from %d to %d", ms_uiInvalidParameterCountLogged, ms_uiInvalidParameterCount ) ); + ms_uiInvalidParameterCountLogged = ms_uiInvalidParameterCount; + } +} + + +/////////////////////////////////////////////////////////////// +// +// CCrashDumpWriter::HandleInvalidParameter +// +// Static function. Called when an invalid parameter is detected by functions such as printf. +// Can be caused by problems with localized strings. +// +/////////////////////////////////////////////////////////////// +void CCrashDumpWriter::HandleInvalidParameter( const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t pReserved ) +{ + ms_uiInvalidParameterCount++; +} + + /////////////////////////////////////////////////////////////// // // CCrashDumpWriter::ReserveMemoryKBForCrashDumpProcessing diff --git a/MTA10/core/CCrashDumpWriter.h b/MTA10/core/CCrashDumpWriter.h index 197c842d18d..58d19545722 100644 --- a/MTA10/core/CCrashDumpWriter.h +++ b/MTA10/core/CCrashDumpWriter.h @@ -53,4 +53,7 @@ class CCrashDumpWriter static SString GetCrashAvertedStatsSoFar ( void ); static void ReserveMemoryKBForCrashDumpProcessing ( uint uiMemoryKB ); static void FreeMemoryForCrashDumpProcessing ( void ); + static void SetHandlers ( void ); + static void UpdateCounters ( void ); + static void HandleInvalidParameter ( const wchar_t* expression, const wchar_t* function, const wchar_t* file, unsigned int line, uintptr_t pReserved ); }; diff --git a/MTA10/core/CCredits.cpp b/MTA10/core/CCredits.cpp index c9881c1026c..01b92eaa0a8 100644 --- a/MTA10/core/CCredits.cpp +++ b/MTA10/core/CCredits.cpp @@ -177,6 +177,7 @@ CCredits::CCredits ( void ) "tinygettext (http://code.google.com/p/tinygettext/)\n" "PortAudio (http://www.portaudio.com/)\n" "speex (http://www.speex.org/)\n" + "CEF (https://code.google.com/p/chromiumembedded/)\n" ; // Create our window diff --git a/MTA10/core/CDirect3DEvents9.cpp b/MTA10/core/CDirect3DEvents9.cpp index f15dcd70347..fcedab8292c 100644 --- a/MTA10/core/CDirect3DEvents9.cpp +++ b/MTA10/core/CDirect3DEvents9.cpp @@ -48,7 +48,10 @@ void CDirect3DEvents9::OnDirect3DDeviceCreate ( IDirect3DDevice9 *pDevice ) CGraphics::GetSingleton ().OnDeviceCreate ( pDevice ); // Create the GUI elements - CLocalGUI::GetSingleton().CreateObjects ( pDevice ); + CLocalGUI::GetSingleton().CreateObjects ( pDevice ); + + // Init webbrowser + CCore::GetSingleton ().InitialiseWeb (); } void CDirect3DEvents9::OnDirect3DDeviceDestroy ( IDirect3DDevice9 *pDevice ) @@ -140,12 +143,22 @@ void CDirect3DEvents9::OnPresent ( IDirect3DDevice9 *pDevice ) // Restore in case script forgets CGraphics::GetSingleton ().GetRenderItemManager ()->RestoreDefaultRenderTarget (); + bool bTookScreenShot = false; + if ( !CGraphics::GetSingleton ().GetScreenGrabber ()->IsQueueEmpty () ) + { + g_pCore->GetWebCore ()->OnPreScreenshot (); + bTookScreenShot = true; + } + // Draw pre-GUI primitives CGraphics::GetSingleton ().DrawPreGUIQueue (); // Maybe grab screen for upload CGraphics::GetSingleton ().GetScreenGrabber ()->DoPulse (); + if ( bTookScreenShot ) + g_pCore->GetWebCore ()->OnPostScreenshot (); + // Draw the GUI CLocalGUI::GetSingleton().Draw (); diff --git a/MTA10/core/CGraphics.cpp b/MTA10/core/CGraphics.cpp index 26b2724cc0a..6292c60dea7 100644 --- a/MTA10/core/CGraphics.cpp +++ b/MTA10/core/CGraphics.cpp @@ -1779,8 +1779,8 @@ void CGraphics::DrawProgressMessage( bool bPreserveBackbuffer ) return; // Check if disabled - static bool bDisabled = !GetApplicationSetting( "diagnostics", "user-confirmed-bsod-time" ).empty(); - if ( bDisabled ) + bool bEnabled = CVARS_GET_VALUE < bool > ( "progress_animation" ); + if ( !bEnabled ) return; // diff --git a/MTA10/core/CKeyBinds.cpp b/MTA10/core/CKeyBinds.cpp index 45e4447250a..06503c79ed5 100644 --- a/MTA10/core/CKeyBinds.cpp +++ b/MTA10/core/CKeyBinds.cpp @@ -266,6 +266,16 @@ SDefaultCommandBind g_dcbDefaultCommands[] = // HACK: our current shift key states bool bPreLeftShift = false, bPreRightShift = false; +// Ensure zero length strings are NULL +static void NullEmptyStrings( const char*& a, const char*& b = *(const char**)NULL, const char*& c = *(const char**)NULL, const char*& d = *(const char**)NULL, const char*& e = *(const char**)NULL ) +{ + if ( &a && a && a[0] == 0 ) a = NULL; + if ( &b && b && b[0] == 0 ) b = NULL; + if ( &c && c && c[0] == 0 ) c = NULL; + if ( &d && d && d[0] == 0 ) d = NULL; + if ( &e && e && e[0] == 0 ) e = NULL; +} + CKeyBinds::CKeyBinds ( CCore* pCore ) { @@ -291,6 +301,9 @@ CKeyBinds::~CKeyBinds ( void ) bool CKeyBinds::ProcessMessage ( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) { + if ( g_pCore->GetWebCore () && !m_pCore->IsMenuVisible() && !m_pCore->GetConsole()->IsVisible() && !m_pCore->IsChatInputEnabled() ) + g_pCore->GetWebCore ()->ProcessInputMessage ( uMsg, wParam, lParam ); + // Don't process Shift keys here, we have a hack for that if ( wParam == 0x10 && ( uMsg == WM_KEYDOWN || uMsg == WM_KEYUP || uMsg == WM_SYSKEYDOWN || uMsg == WM_SYSKEYUP ) ) @@ -361,7 +374,7 @@ bool CKeyBinds::ProcessKeyStroke ( const SBindableKey * pKey, bool bState ) // Search through binds bool bFound = false; CKeyBind* pBind = NULL; - list < CCommandBind* > *processedList = new list < CCommandBind* >; + list < CCommandBind* > processedList; list < CKeyBind* > cloneList = *m_pList; list < CKeyBind* > ::const_iterator iter = cloneList.begin (); for ( ; iter != cloneList.end (); ++iter ) @@ -419,8 +432,8 @@ bool CKeyBinds::ProcessKeyStroke ( const SBindableKey * pKey, bool bState ) else { bool bAlreadyProcessed = false; - list < CCommandBind* > ::iterator iter = processedList->begin (); - for ( ; iter != processedList->end (); iter++ ) + list < CCommandBind* > ::iterator iter = processedList.begin (); + for ( ; iter != processedList.end (); iter++ ) { if ( strcmp ( ( *iter )->szCommand, pCommandBind->szCommand ) == 0 ) { @@ -439,7 +452,7 @@ bool CKeyBinds::ProcessKeyStroke ( const SBindableKey * pKey, bool bState ) if ( !bAlreadyProcessed ) { Call ( pCommandBind ); - processedList->push_back ( pCommandBind ); + processedList.push_back ( pCommandBind ); } } } @@ -577,14 +590,31 @@ bool CKeyBinds::Call ( CKeyBind* pKeyBind ) } -bool CKeyBinds::AddCommand ( const char* szKey, const char* szCommand, const char* szArguments, bool bState, const char* szResource, bool bAltKey ) +bool CKeyBinds::AddCommand ( const char* szKey, const char* szCommand, const char* szArguments, bool bState, const char* szResource, bool bScriptCreated, const char* szOriginalScriptKey ) { - if ( szKey == NULL || szCommand == NULL ) return false; + NullEmptyStrings( szCommand, szArguments, szResource ); + + if ( szKey == NULL || szCommand == NULL ) + return false; const SBindableKey* boundKey = GetBindableFromKey ( szKey ); if ( boundKey ) { + if ( szResource && bScriptCreated ) + { + // Check if there is a waiting replacement + CCommandBind* pUserAddedBind = FindCommandMatch( NULL, szCommand, szArguments, szResource, szKey, true, bState, true, false ); + if ( pUserAddedBind ) + { + // Upgrade + pUserAddedBind->bScriptCreated = true; + pUserAddedBind->bIsReplacingScriptKey = true; + assert( pUserAddedBind->strOriginalScriptKey == szKey ); + return true; + } + } + CCommandBind* bind = new CCommandBind; bind->boundKey = boundKey; bind->szCommand = new char [ strlen ( szCommand ) + 1 ]; @@ -599,10 +629,11 @@ bool CKeyBinds::AddCommand ( const char* szKey, const char* szCommand, const cha bind->szResource = new char [ strlen ( szResource ) + 1 ]; strcpy ( bind->szResource, szResource ); - if ( bAltKey ) - bind->strDefaultKey = ""; + bind->bScriptCreated = bScriptCreated; + if ( bind->bScriptCreated ) + bind->strOriginalScriptKey = szKey; else - bind->strDefaultKey = szKey; + bind->strOriginalScriptKey = szOriginalScriptKey; // Will wait for script to addcommand before doing replace } bind->bHitState = bState; bind->bState = false; @@ -617,6 +648,8 @@ bool CKeyBinds::AddCommand ( const char* szKey, const char* szCommand, const cha bool CKeyBinds::AddCommand ( const SBindableKey* pKey, const char* szCommand, const char* szArguments, bool bState ) { + NullEmptyStrings( szCommand, szArguments ); + if ( pKey == NULL || szCommand == NULL ) return false; CCommandBind* bind = new CCommandBind; @@ -729,38 +762,26 @@ bool CKeyBinds::RemoveAllCommands ( void ) } -bool CKeyBinds::CommandExists ( const char* szKey, const char* szCommand, bool bCheckState, bool bState, const char* szArguments, const char* szResource ) +bool CKeyBinds::CommandExists ( const char* szKey, const char* szCommand, bool bCheckState, bool bState, const char* szArguments, const char* szResource, bool bCheckScriptCreated, bool bScriptCreated ) { - list < CKeyBind* > ::const_iterator iter = m_pList->begin (); - for ( ; iter != m_pList->end (); iter++ ) + const char* szOriginalScriptKey = NULL; + if ( bCheckScriptCreated && bScriptCreated ) { - if ( (*iter)->GetType () == KEY_BIND_COMMAND ) - { - CCommandBind* pBind = static_cast < CCommandBind* > ( *iter ); - if ( !szKey || ( stricmp ( pBind->boundKey->szKey, szKey ) == 0 ) ) - { - if ( strcmp ( pBind->szCommand, szCommand ) == 0 ) - { - if ( !bCheckState || pBind->bHitState == bState ) - { - if ( !szArguments || ( pBind->szArguments && strcmp ( pBind->szArguments, szArguments ) == 0 ) ) - { - if ( !szResource || ( pBind->szResource && strcmp ( pBind->szResource, szResource ) == 0 ) ) - { - return true; - } - } - } - } - } - } + // If looking for script created command, check original key instead of current key + szOriginalScriptKey = szKey; + szKey = NULL; } - + + if ( FindCommandMatch( szKey, szCommand, szArguments, szResource, szOriginalScriptKey, bCheckState, bState, bCheckScriptCreated, bScriptCreated ) ) + return true; + return false; } bool CKeyBinds::SetCommandActive ( const char* szKey, const char* szCommand, bool bState, const char* szArguments, const char* szResource, bool bActive, bool checkHitState ) { + NullEmptyStrings( szKey, szCommand, szArguments ); + list < CKeyBind* > ::const_iterator iter = m_pList->begin (); for ( ; iter != m_pList->end (); iter++ ) { @@ -791,6 +812,8 @@ bool CKeyBinds::SetCommandActive ( const char* szKey, const char* szCommand, boo void CKeyBinds::SetAllCommandsActive ( const char* szResource, bool bActive, const char* szCommand, bool bState, const char* szArguments, bool checkHitState ) { + NullEmptyStrings( szCommand, szArguments ); + list < CKeyBind* > ::const_iterator iter = m_pList->begin (); for ( ; iter != m_pList->end (); iter++ ) { @@ -817,6 +840,8 @@ void CKeyBinds::SetAllCommandsActive ( const char* szResource, bool bActive, con CCommandBind* CKeyBinds::GetBindFromCommand ( const char* szCommand, const char* szArguments, bool bMatchCase, const char* szKey, bool bCheckHitState, bool bState ) { + NullEmptyStrings( szKey, szArguments ); + list < CKeyBind* > ::const_iterator iter = m_pList->begin (); for ( ; iter != m_pList->end (); iter++ ) { @@ -851,6 +876,140 @@ CCommandBind* CKeyBinds::GetBindFromCommand ( const char* szCommand, const char* } +CCommandBind* CKeyBinds::FindCommandMatch( const char* szKey, const char* szCommand, const char* szArguments, const char* szResource, const char* szOriginalScriptKey, bool bCheckState, bool bState, bool bCheckScriptCreated, bool bScriptCreated ) +{ + NullEmptyStrings( szKey, szArguments, szResource, szOriginalScriptKey ); + + list < CKeyBind* > ::const_iterator iter = m_pList->begin(); + for ( ; iter != m_pList->end(); iter++ ) + { + if ( (*iter)->GetType() == KEY_BIND_COMMAND ) + { + CCommandBind* pBind = static_cast < CCommandBind* > ( *iter ); + if ( !szKey || ( stricmp( pBind->boundKey->szKey, szKey ) == 0 ) ) + { + if ( strcmp( pBind->szCommand, szCommand ) == 0 ) + { + if ( !bCheckState || ( pBind->bHitState == bState ) ) + { + if ( !szArguments || ( pBind->szArguments && strcmp( pBind->szArguments, szArguments ) == 0 ) ) + { + if ( !szResource || ( pBind->szResource && strcmp( pBind->szResource, szResource ) == 0 ) ) + { + if ( !bCheckScriptCreated || ( pBind->bScriptCreated == bScriptCreated ) ) + { + if ( !szOriginalScriptKey || ( pBind->strOriginalScriptKey == szOriginalScriptKey ) ) + { + return pBind; + } + } + } + } + } + } + } + } + } + return NULL; +} + + +// +// Get up-bind version of down-bind +// +CCommandBind* CKeyBinds::FindMatchingUpBind( CCommandBind* pBind ) +{ + return FindCommandMatch( pBind->boundKey->szKey, pBind->szCommand, NULL, pBind->szResource, pBind->strOriginalScriptKey, true, false, true, pBind->bScriptCreated ); +} + + +// +// Called when the user removes an existing command bind +// +void CKeyBinds::UserRemoveCommandBoundKey( CCommandBind* pBind ) +{ + if ( pBind->bScriptCreated ) + { + if ( pBind->bIsReplacingScriptKey ) + { + // Remove user added key change + pBind->bIsReplacingScriptKey = false; + const SBindableKey* boundKey = GetBindableFromKey( pBind->strOriginalScriptKey ); + if ( boundKey ) + pBind->boundKey = boundKey; + } + // Can't manually remove script added command binds, as they will reappear when the resource re-starts + return; + } + Remove( pBind ); +} + + +// +// Called when the user changes the key of an existing command bind +// +void CKeyBinds::UserChangeCommandBoundKey( CCommandBind* pBind, const SBindableKey* pNewBoundKey ) +{ + if ( pBind->bScriptCreated ) + { + // Set replacing flag if was script bind (and key is different) + if ( pBind->strOriginalScriptKey != pNewBoundKey->szKey ) + pBind->bIsReplacingScriptKey = true; + else + pBind->bIsReplacingScriptKey = false; + } + // Do change + pBind->boundKey = pNewBoundKey; +} + + +// +// Sort command binds for consistency in settings gui +// +void CKeyBinds::SortCommandBinds( void ) +{ + struct Sorter + { + bool operator()( CKeyBind* t1, CKeyBind* t2) + { + // Group command binds last + if ( t1->GetType() != KEY_BIND_COMMAND && t2->GetType() == KEY_BIND_COMMAND ) + return true; + if ( t1->GetType() == KEY_BIND_COMMAND && t2->GetType() == KEY_BIND_COMMAND ) + { + CCommandBind* pBind1 = static_cast < CCommandBind* > ( t1 ); + CCommandBind* pBind2 = static_cast < CCommandBind* > ( t2 ); + + // Command binds with resource name last + if ( !pBind1->szResource && pBind2->szResource ) + return true; + if ( pBind1->szResource && pBind2->szResource ) + { + // Alpha sort by resource name + int cmpResult = stricmp( pBind1->szResource, pBind2->szResource ); + if ( cmpResult < 0 ) + return true; + if ( cmpResult == 0 ) + { + // Script added before user added + if ( pBind1->bScriptCreated && !pBind2->bScriptCreated ) + return true; + if ( !pBind1->bScriptCreated && !pBind2->bScriptCreated ) + { + // Replacers before norms + if ( !pBind1->strOriginalScriptKey.empty() && pBind2->strOriginalScriptKey.empty() ) + return true; + } + } + } + } + return false; + } + }; + m_pList->sort( Sorter() ); +} + + bool CKeyBinds::GetBoundCommands ( const char * szCommand, list < CCommandBind * > & commandsList ) { list < CKeyBind* > ::iterator iter = m_pList->begin (); @@ -2180,7 +2339,11 @@ bool CKeyBinds::LoadFromXML ( CXMLNode* pMainNode ) if ( pAttribute ) { strResource = pAttribute->GetValue (); - AddCommand ( strKey.c_str (), strCommand.c_str (), strArguments.c_str (), bState, strResource.c_str() ); + + pAttribute = pNode->GetAttributes ().Find ( "default" ); + SString strOriginalScriptKey = pAttribute ? pAttribute->GetValue () : ""; + + AddCommand ( strKey.c_str (), strCommand.c_str (), strArguments.c_str (), bState, strResource.c_str(), false, strOriginalScriptKey ); SetCommandActive ( strKey.c_str (), strCommand.c_str(), bState, strArguments.c_str(), strResource.c_str(), false, true ); } else if ( !CommandExists ( strKey.c_str (), strCommand.c_str (), true, bState ) ) @@ -2288,8 +2451,14 @@ bool CKeyBinds::SaveToXML ( CXMLNode* pMainNode ) pA = pAttributes->Create ( "resource" ); pA->SetValue ( szResource ); - //If its still the default key dont bother saving it - if ( !strcmp ( pBind->strDefaultKey, szKey ) ) + if ( !pBind->strOriginalScriptKey.empty() ) + { + pA = pAttributes->Create ( "default" ); + pA->SetValue ( pBind->strOriginalScriptKey ); + } + + // Don't save script added binds + if ( pBind->bScriptCreated && !pBind->bIsReplacingScriptKey ) pNode->GetParent()->DeleteSubNode(pNode); } } @@ -2311,6 +2480,11 @@ bool CKeyBinds::SaveToXML ( CXMLNode* pMainNode ) pA->SetValue ( szControl ); } } + else + { + // Type doesn't require saving + pNode->GetParent()->DeleteSubNode( pNode ); + } } } return true; diff --git a/MTA10/core/CKeyBinds.h b/MTA10/core/CKeyBinds.h index 16dfd4b6eef..e48ab83c2a2 100644 --- a/MTA10/core/CKeyBinds.h +++ b/MTA10/core/CKeyBinds.h @@ -54,19 +54,23 @@ class CKeyBinds: public CKeyBindsInterface std::list < CKeyBind* > ::const_iterator IterBegin ( void ) { return m_pList->begin (); } std::list < CKeyBind* > ::const_iterator IterEnd ( void ) { return m_pList->end (); } - // Command-bind funcs - bool AddCommand ( const char* szKey, const char* szCommand, const char* szArguments = NULL, bool bState = true, const char* szResource = NULL, bool bAltKey = false ); + bool AddCommand ( const char* szKey, const char* szCommand, const char* szArguments, bool bState, const char* szResource = NULL , bool bScriptCreated = false, const char* szOriginalScriptKey = NULL ); bool AddCommand ( const SBindableKey* pKey, const char* szCommand, const char* szArguments = NULL, bool bState = true ); bool RemoveCommand ( const char* szKey, const char* szCommand, bool bCheckState = false, bool bState = true ); bool RemoveAllCommands ( const char* szKey, bool bCheckState = false, bool bState = true ); bool RemoveAllCommands ( void ); - bool CommandExists ( const char* szKey, const char* szCommand, bool bCheckState = false, bool bState = true, const char* szArguments = NULL, const char* szResource = NULL ); + bool CommandExists ( const char* szKey, const char* szCommand, bool bCheckState = false, bool bState = true, const char* szArguments = NULL, const char* szResource = NULL, bool bCheckScriptCreated = false, bool bScriptCreated = false ); bool SetCommandActive ( const char* szKey, const char* szCommand, bool bState, const char* szArguments, const char* szResource, bool bActive, bool checkHitState ); void SetAllCommandsActive ( const char* szResource, bool bActive, const char* szCommand = NULL, bool bState = true, const char* szArguments = NULL, bool checkHitState = false ); CCommandBind* GetBindFromCommand ( const char* szCommand, const char* szArguments = NULL, bool bMatchCase = true, const char* szKey = NULL, bool bCheckHitState = false, bool bState = NULL ); bool GetBoundCommands ( const char* szCommand, std::list < CCommandBind * > & commandsList ); - + void UserChangeCommandBoundKey ( CCommandBind* pBind, const SBindableKey* pNewBoundKey ); + void UserRemoveCommandBoundKey ( CCommandBind* pBind ); + CCommandBind* FindMatchingUpBind ( CCommandBind* pBind ); + CCommandBind* FindCommandMatch ( const char* szKey, const char* szCommand, const char* szArguments, const char* szResource, const char* szOriginalScriptKey, bool bCheckState, bool bState, bool bCheckScriptCreated, bool bScriptCreated ); + void SortCommandBinds ( void ); + // Control-bind funcs bool AddGTAControl ( const char* szKey, const char* szControl ); bool AddGTAControl ( const SBindableKey* pKey, SBindableGTAControl* pControl ); diff --git a/MTA10/core/CLocalization.cpp b/MTA10/core/CLocalization.cpp index 419035161f0..1dd73dd646f 100644 --- a/MTA10/core/CLocalization.cpp +++ b/MTA10/core/CLocalization.cpp @@ -11,6 +11,7 @@ *****************************************************************************/ #include "StdInc.h" +#include "../../vendor/tinygettext/log.hpp" #define MTA_LOCALE_DIR "MTA/locale/" #define MTA_LOCALE_TEXTDOMAIN "client" @@ -24,6 +25,15 @@ CLocalization::CLocalization ( SString strLocale, SString strLocalePath ) WriteDebugEvent( SString("CLocalization::CLocalization Localization set to '%s'",strLocale.c_str()) ); + // Set log callbacks so we can record problems +#ifdef MTA_DEBUG + Log::set_log_info_callback( LogCallback ); +#else + Log::set_log_info_callback( NULL ); +#endif + Log::set_log_warning_callback( LogCallback ); + Log::set_log_error_callback( LogCallback ); + // Grab the nearest language based upon our setting, or revert to en_US Language Lang = Language::from_name(strLocale); Lang = Lang ? Lang : Language::from_name("en_US"); @@ -42,9 +52,9 @@ CLocalization::CLocalization ( SString strLocale, SString strLocalePath ) m_pCurrentLang = new CLanguage ( m_CurrentDict, strLocale, Lang.get_name() ); } -CLocalization::~CLocalization ( void ) -{ - delete m_pCurrentLang; +CLocalization::~CLocalization ( void ) +{ + delete m_pCurrentLang; } SString CLocalization::Translate ( const SString & strMessage ) @@ -121,6 +131,10 @@ SString CLocalization::GetLanguageDirectory ( void ) return strFullPath.substr( 0, strFullPath.find_last_of( '/' ) +1 ); } +void CLocalization::LogCallback( const std::string& str ) +{ + WriteDebugEvent( ( SStringX( "Localization: " ) + str ).TrimEnd( "\n" ) ); +} /////////////////////////////////////////////////////// // diff --git a/MTA10/core/CLocalization.h b/MTA10/core/CLocalization.h index a2b1502a2b5..11fb3c99e4f 100644 --- a/MTA10/core/CLocalization.h +++ b/MTA10/core/CLocalization.h @@ -36,6 +36,8 @@ class CLocalization : public CLocalizationInterface SString GetLanguageCode ( void ); SString GetLanguageName ( void ); + static void LogCallback ( const std::string& str ); + private: Dictionary m_CurrentDict; DictionaryManager m_DictManager; diff --git a/MTA10/core/CModManager.cpp b/MTA10/core/CModManager.cpp index 100007ffedf..ae1a1000cf8 100644 --- a/MTA10/core/CModManager.cpp +++ b/MTA10/core/CModManager.cpp @@ -31,12 +31,6 @@ CModManager::CModManager ( void ) // Load the modlist from the folders in "mta/mods" InitializeModList ( CalcMTASAPath( "mods\\" ) ); - - // Set up our exception handler - #ifndef MTA_DEBUG - SetCrashHandlerFilter ( CCrashDumpWriter::HandleExceptionGlobal ); - CCrashDumpWriter::ReserveMemoryKBForCrashDumpProcessing( 500 ); - #endif } CModManager::~CModManager ( void ) diff --git a/MTA10/core/CRenderItem.WebBrowser.cpp b/MTA10/core/CRenderItem.WebBrowser.cpp new file mode 100644 index 00000000000..06e8dbb7d1b --- /dev/null +++ b/MTA10/core/CRenderItem.WebBrowser.cpp @@ -0,0 +1,127 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* LICENSE: See LICENSE in the top level directory +* FILE: core/CRenderItem.WebBrowser.cpp +* PURPOSE: Web browser texture item class +* +*****************************************************************************/ + +#include "StdInc.h" + +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem::PostConstruct +// +// +// +//////////////////////////////////////////////////////////////// +void CWebBrowserItem::PostConstruct ( CRenderItemManager* pRenderItemManager, uint uiSizeX, uint uiSizeY ) +{ + Super::PostConstruct ( pRenderItemManager ); + m_uiSizeX = uiSizeX; + m_uiSizeY = uiSizeY; + m_uiSurfaceSizeX = uiSizeX; + m_uiSurfaceSizeY = uiSizeY; + + // Initial creation of d3d data + CreateUnderlyingData (); +} + + +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem::PreDestruct +// +// +// +//////////////////////////////////////////////////////////////// +void CWebBrowserItem::PreDestruct ( void ) +{ + ReleaseUnderlyingData (); + Super::PreDestruct (); +} + + +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem::IsValid +// +// Check underlying data is present +// +//////////////////////////////////////////////////////////////// +bool CWebBrowserItem::IsValid ( void ) +{ + return m_pD3DTexture && m_pD3DRenderTargetSurface; +} + + +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem::OnLostDevice +// +// Release device stuff +// +//////////////////////////////////////////////////////////////// +void CWebBrowserItem::OnLostDevice ( void ) +{ + +} + + +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem::OnResetDevice +// +// Recreate device stuff +// +//////////////////////////////////////////////////////////////// +void CWebBrowserItem::OnResetDevice ( void ) +{ + +} + + +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem::CreateUnderlyingData +// +// +// +//////////////////////////////////////////////////////////////// +void CWebBrowserItem::CreateUnderlyingData () +{ + assert ( !m_pD3DRenderTargetSurface ); + assert ( !m_pD3DTexture ); + + D3DXCreateTexture ( m_pDevice, m_uiSizeX, m_uiSizeY, 1, 0, D3DFMT_A8B8G8R8, D3DPOOL_MANAGED, (IDirect3DTexture9**)&m_pD3DTexture ); + + // Check texture created + if ( !m_pD3DTexture ) + return; + + // Get the render target surface here for convenience + ((IDirect3DTexture9*)m_pD3DTexture)->GetSurfaceLevel ( 0, &m_pD3DRenderTargetSurface ); + + // Update surface size, although it probably will be unchanged | Todo: Remove this + D3DSURFACE_DESC desc; + m_pD3DRenderTargetSurface->GetDesc ( &desc ); + m_uiSurfaceSizeX = desc.Width; + m_uiSurfaceSizeY = desc.Height; + + m_iMemoryKBUsed = CRenderItemManager::CalcD3DResourceMemoryKBUsage ( m_pD3DRenderTargetSurface ); +} + + +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem::ReleaseUnderlyingData +// +// +// +//////////////////////////////////////////////////////////////// +void CWebBrowserItem::ReleaseUnderlyingData ( void ) +{ + SAFE_RELEASE( m_pD3DRenderTargetSurface ) + SAFE_RELEASE( m_pD3DTexture ) +} diff --git a/MTA10/core/CRenderItemManager.cpp b/MTA10/core/CRenderItemManager.cpp index dfea480d9b5..0df941e9eb1 100644 --- a/MTA10/core/CRenderItemManager.cpp +++ b/MTA10/core/CRenderItemManager.cpp @@ -202,6 +202,33 @@ CScreenSourceItem* CRenderItemManager::CreateScreenSource ( uint uiSizeX, uint u } +//////////////////////////////////////////////////////////////// +// +// CRenderItemManager::CreateWebBrowser +// +// +// +//////////////////////////////////////////////////////////////// +CWebBrowserItem* CRenderItemManager::CreateWebBrowser ( uint uiSizeX, uint uiSizeY ) +{ + if ( !CanCreateRenderItem ( CWebBrowserItem::GetClassId () ) ) + return NULL; + + CWebBrowserItem* pWebBrowserItem = new CWebBrowserItem; + pWebBrowserItem->PostConstruct ( this, uiSizeX, uiSizeY ); + + if ( !pWebBrowserItem->IsValid () ) + { + SAFE_RELEASE ( pWebBrowserItem ); + return NULL; + } + + UpdateMemoryUsage (); + + return pWebBrowserItem; +} + + //////////////////////////////////////////////////////////////// // // CRenderItemManager::CreateShader diff --git a/MTA10/core/CRenderItemManager.h b/MTA10/core/CRenderItemManager.h index 08c69053462..9a065a32a8f 100644 --- a/MTA10/core/CRenderItemManager.h +++ b/MTA10/core/CRenderItemManager.h @@ -31,6 +31,7 @@ class CRenderItemManager : public CRenderItemManagerInterface virtual CShaderItem* CreateShader ( const SString& strFullFilePath, const SString& strRootPath, SString& strOutStatus, float fPriority, float fMaxDistance, bool bLayered, bool bDebug, int iTypeMask ); virtual CRenderTargetItem* CreateRenderTarget ( uint uiSizeX, uint uiSizeY, bool bWithAlphaChannel, bool bForce = false ); virtual CScreenSourceItem* CreateScreenSource ( uint uiSizeX, uint uiSizeY ); + virtual CWebBrowserItem* CreateWebBrowser ( uint uiSizeX, uint uiSizeY ); virtual bool SetRenderTarget ( CRenderTargetItem* pItem, bool bClear ); virtual void EnableSetRenderTargetOldVer ( bool bEnable ); virtual bool IsSetRenderTargetEnabledOldVer ( void ); diff --git a/MTA10/core/CScreenGrabber.cpp b/MTA10/core/CScreenGrabber.cpp index 553ff8dfab5..25faae3a124 100644 --- a/MTA10/core/CScreenGrabber.cpp +++ b/MTA10/core/CScreenGrabber.cpp @@ -40,6 +40,7 @@ class CScreenGrabber : public CScreenGrabberInterface virtual void QueueScreenShot ( uint uiSizeX, uint uiSizeY, uint uiQuality, PFN_SCREENSHOT_CALLBACK pfnScreenShotCallback ); virtual void ClearScreenShotQueue ( void ); virtual bool GetBackBufferPixels ( uint uiSizeX, uint uiSizeY, CBuffer& buffer, SString& strOutError ); + virtual bool IsQueueEmpty ( void ); // CScreenGrabber void ProcessScreenShotQueue ( void ); @@ -293,3 +294,16 @@ void CScreenGrabber::ClearScreenShotQueue ( void ) m_pCompressorJobQueue->PollCommand ( m_pCompressJobData, -1 ); m_pCompressJobData = NULL; } + + +//////////////////////////////////////////////////////////////// +// +// CScreenGrabber::IsQueueEmpty +// +// Checks whether the queue is empty +// +//////////////////////////////////////////////////////////////// +bool CScreenGrabber::IsQueueEmpty ( void ) +{ + return m_ScreenShotQueue.empty (); +} diff --git a/MTA10/core/CSettings.cpp b/MTA10/core/CSettings.cpp index e6376b9ac90..ab3dd082078 100644 --- a/MTA10/core/CSettings.cpp +++ b/MTA10/core/CSettings.cpp @@ -42,7 +42,15 @@ CSettings::CSettings ( void ) { m_iMaxAnisotropic = g_pDeviceState->AdapterState.MaxAnisotropicSetting; m_pWindow = NULL; + m_bBrowserListsChanged = false; CreateGUI (); + + // Disable progress animation if required + if ( GetApplicationSettingInt( GENERAL_PROGRESS_ANIMATION_DISABLE ) ) + { + SetApplicationSettingInt( GENERAL_PROGRESS_ANIMATION_DISABLE, 0 ); + CVARS_SET ( "progress_animation", 0 ); + } } @@ -57,7 +65,7 @@ void CSettings::CreateGUI ( void ) if ( m_pWindow ) DestroyGUI (); - CGUITab *pTabMultiplayer, *pTabVideo, *pTabAudio, *pTabBinds, *pTabControls, *pTabCommunity, *pTabInterface, *pTabAdvanced; + CGUITab *pTabMultiplayer, *pTabVideo, *pTabAudio, *pTabBinds, *pTabControls, *pTabCommunity, *pTabInterface, *pTabBrowser, *pTabAdvanced; CGUI *pManager = g_pCore->GetGUI (); // Init @@ -94,6 +102,7 @@ void CSettings::CreateGUI ( void ) pTabBinds = m_pTabs->CreateTab ( _("Binds") ); pTabControls = m_pTabs->CreateTab ( _("Controls") ); pTabInterface = m_pTabs->CreateTab ( _("Interface") ); + pTabBrowser = m_pTabs->CreateTab ( _("Browser") ); pTabAdvanced = m_pTabs->CreateTab ( _("Advanced") ); pTabCommunity = m_pTabs->CreateTab ( _("Community") ); @@ -1095,23 +1104,105 @@ void CSettings::CreateGUI ( void ) m_pChatCssBackground->AutoSize ( NULL, 20.0f ); } + /** + * Webbrowser tab + **/ + m_pLabelBrowserGeneral = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabBrowser, _("General") ) ); + m_pLabelBrowserGeneral->SetPosition ( CVector2D ( 10.0f, 12.0f ) ); + m_pLabelBrowserGeneral->GetPosition ( vecTemp ); + m_pLabelBrowserGeneral->AutoSize ( NULL, 5.0f ); + m_pLabelBrowserGeneral->SetFont ( "default-bold-small" ); + + m_pCheckBoxRemoteBrowser = reinterpret_cast < CGUICheckBox* > ( pManager->CreateCheckBox ( pTabBrowser, _("Enable remote websites"), true ) ); + m_pCheckBoxRemoteBrowser->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 29.0f ) ); + m_pCheckBoxRemoteBrowser->GetPosition ( vecTemp ); + m_pCheckBoxRemoteBrowser->AutoSize ( NULL, 20.0f ); + + m_pCheckBoxRemoteJavascript = reinterpret_cast < CGUICheckBox* > ( pManager->CreateCheckBox ( pTabBrowser, _("Enable Javascript on remote websites"), true ) ); + m_pCheckBoxRemoteJavascript->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 25.0f ) ); + m_pCheckBoxRemoteJavascript->GetPosition ( vecTemp ); + m_pCheckBoxRemoteJavascript->AutoSize ( NULL, 20.0f ); + + m_pCheckBoxBrowserPluginsEnabled = reinterpret_cast < CGUICheckBox* > ( pManager->CreateCheckBox(pTabBrowser, _("Enable plugins (like Flash, Silverlight; Java is disabled by default)"), true ) ); + m_pCheckBoxBrowserPluginsEnabled->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 25.0f ) ); + m_pCheckBoxBrowserPluginsEnabled->GetPosition ( vecTemp ); + m_pCheckBoxBrowserPluginsEnabled->AutoSize ( NULL, 20.0f ); + + m_pLabelBrowserCustomBlacklist = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabBrowser, _("Custom blacklist") ) ); + m_pLabelBrowserCustomBlacklist->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 30.0f ) ); + m_pLabelBrowserCustomBlacklist->GetPosition ( vecTemp ); + m_pLabelBrowserCustomBlacklist->AutoSize ( NULL, 5.0f ); + m_pLabelBrowserCustomBlacklist->SetFont ( "default-bold-small" ); + + m_pEditBrowserBlacklistAdd = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pTabBrowser ) ); + m_pEditBrowserBlacklistAdd->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 25.0f ) ); + m_pEditBrowserBlacklistAdd->GetPosition ( vecTemp ); + m_pEditBrowserBlacklistAdd->SetSize ( CVector2D ( 191.0f, 22.0f ) ); + m_pEditBrowserBlacklistAdd->SetText ( _("Enter a domain e.g. google.com") ); + + m_pButtonBrowserBlacklistAdd = reinterpret_cast < CGUIButton* > ( pManager->CreateButton ( pTabBrowser, _("Block") ) ); + m_pButtonBrowserBlacklistAdd->SetPosition ( CVector2D ( vecTemp.fX + m_pEditBrowserBlacklistAdd->GetSize ().fX + 2.0f, vecTemp.fY ) ); + m_pButtonBrowserBlacklistAdd->SetSize ( CVector2D ( 64.0f, 22.0f ) ); + + m_pGridBrowserBlacklist = reinterpret_cast < CGUIGridList* > ( pManager->CreateGridList ( pTabBrowser ) ); + m_pGridBrowserBlacklist->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 32.0f ) ); + m_pGridBrowserBlacklist->GetPosition ( vecTemp ); + m_pGridBrowserBlacklist->SetSize ( CVector2D ( 256.0f, 150.0f ) ); + m_pGridBrowserBlacklist->AddColumn ( _("Domain"), 0.9f ); + + m_pButtonBrowserBlacklistRemove = reinterpret_cast < CGUIButton* > ( pManager->CreateButton ( pTabBrowser, _("Remove domain") ) ); + m_pButtonBrowserBlacklistRemove->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + m_pGridBrowserBlacklist->GetSize ().fY + 5.0f ) ); + m_pButtonBrowserBlacklistRemove->SetSize ( CVector2D ( 140.0f, 22.0f ) ); + + m_pLabelBrowserCustomBlacklist->GetPosition ( vecTemp ); // Reset vecTemp + + m_pLabelBrowserCustomWhitelist = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabBrowser, _("Custom whitelist") ) ); + m_pLabelBrowserCustomWhitelist->SetPosition ( CVector2D ( 276.0f , vecTemp.fY ) ); + m_pLabelBrowserCustomWhitelist->GetPosition ( vecTemp ); + m_pLabelBrowserCustomWhitelist->AutoSize ( NULL, 5.0f ); + m_pLabelBrowserCustomWhitelist->SetFont ( "default-bold-small" ); + + m_pEditBrowserWhitelistAdd = reinterpret_cast < CGUIEdit* > ( pManager->CreateEdit ( pTabBrowser ) ); + m_pEditBrowserWhitelistAdd->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 25.0f ) ); + m_pEditBrowserWhitelistAdd->GetPosition ( vecTemp ); + m_pEditBrowserWhitelistAdd->SetSize ( CVector2D ( 191.0f, 22.0f ) ); + m_pEditBrowserWhitelistAdd->SetText ( _("Enter a domain e.g. google.com") ); + + m_pButtonBrowserWhitelistAdd = reinterpret_cast < CGUIButton* > ( pManager->CreateButton ( pTabBrowser, _("Allow") ) ); + m_pButtonBrowserWhitelistAdd->SetPosition ( CVector2D ( vecTemp.fX + m_pEditBrowserWhitelistAdd->GetSize ().fX + 2.0f, vecTemp.fY ) ); + m_pButtonBrowserWhitelistAdd->SetSize ( CVector2D ( 64.0f, 22.0f ) ); + + m_pGridBrowserWhitelist = reinterpret_cast < CGUIGridList* > ( pManager->CreateGridList ( pTabBrowser ) ); + m_pGridBrowserWhitelist->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + 32.0f ) ); + m_pGridBrowserWhitelist->GetPosition ( vecTemp ); + m_pGridBrowserWhitelist->SetSize ( CVector2D ( 256.0f, 150.0f ) ); + m_pGridBrowserWhitelist->AddColumn ( _("Domain"), 0.9f ); + + m_pButtonBrowserWhitelistRemove = reinterpret_cast < CGUIButton* > ( pManager->CreateButton ( pTabBrowser, _("Remove domain") ) ); + m_pButtonBrowserWhitelistRemove->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY + m_pGridBrowserWhitelist->GetSize ().fY + 5.0f ) ); + m_pButtonBrowserWhitelistRemove->SetSize ( CVector2D ( 140.0f, 22.0f ) ); + /** * Advanced tab **/ vecTemp = CVector2D ( 12.f, 12.f ); float fComboWidth = 170.f; + float fHeaderHeight = 20; + float fLineHeight = 27; // Misc section label m_pAdvancedMiscLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Misc") ) ); m_pAdvancedMiscLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY ) ); m_pAdvancedMiscLabel->SetFont ( "default-bold-small" ); m_pAdvancedMiscLabel->AutoSize ( ); - vecTemp.fY += 20; + vecTemp.fY += fHeaderHeight; fIndentX = pManager->CGUI_GetMaxTextExtent( "default-normal", _("Fast CJ clothes loading:"), _("Browser speed:"), _("Single connection:"), + _("Packet tag:"), + _("Progress animation:"), _("Fullscreen mode:"), _("Process priority:"), _("Debug setting:"), @@ -1134,7 +1225,7 @@ void CSettings::CreateGUI ( void ) m_pFastClothesCombo->AddItem ( _("On") )->SetData ( (void*)CMultiplayer::FAST_CLOTHES_ON ); m_pFastClothesCombo->AddItem ( _("Auto") )->SetData ( (void*)CMultiplayer::FAST_CLOTHES_AUTO ); m_pFastClothesCombo->SetReadOnly ( true ); - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; // Browser scan speed m_pBrowserSpeedLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Browser speed:") ) ); @@ -1161,7 +1252,33 @@ void CSettings::CreateGUI ( void ) m_pSingleDownloadCombo->AddItem ( _("Default") )->SetData ( (void*)0 ); m_pSingleDownloadCombo->AddItem ( _("On") )->SetData ( (void*)1 ); m_pSingleDownloadCombo->SetReadOnly ( true ); - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; + + // Packet tag + m_pPacketTagLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Packet tag:") ) ); + m_pPacketTagLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY ) ); + m_pPacketTagLabel->AutoSize ( ); + + m_pPacketTagCombo = reinterpret_cast < CGUIComboBox* > ( pManager->CreateComboBox ( pTabAdvanced, "" ) ); + m_pPacketTagCombo->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 1.0f ) ); + m_pPacketTagCombo->SetSize ( CVector2D ( fComboWidth, 95.0f ) ); + m_pPacketTagCombo->AddItem ( _("Default") )->SetData ( (void*)0 ); + m_pPacketTagCombo->AddItem ( _("On") )->SetData ( (void*)1 ); + m_pPacketTagCombo->SetReadOnly ( true ); + vecTemp.fY += fLineHeight; + + // Progress animation + m_pProgressAnimationLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Progress animation:") ) ); + m_pProgressAnimationLabel->SetPosition ( CVector2D ( vecTemp.fX, vecTemp.fY ) ); + m_pProgressAnimationLabel->AutoSize ( ); + + m_pProgressAnimationCombo = reinterpret_cast < CGUIComboBox* > ( pManager->CreateComboBox ( pTabAdvanced, "" ) ); + m_pProgressAnimationCombo->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 1.0f ) ); + m_pProgressAnimationCombo->SetSize ( CVector2D ( fComboWidth, 95.0f ) ); + m_pProgressAnimationCombo->AddItem ( _("Off") )->SetData ( (void*)0 ); + m_pProgressAnimationCombo->AddItem ( _("Default") )->SetData ( (void*)1 ); + m_pProgressAnimationCombo->SetReadOnly ( true ); + vecTemp.fY += fLineHeight; // Fullscreen mode m_pFullscreenStyleLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Fullscreen mode:") ) ); @@ -1175,7 +1292,7 @@ void CSettings::CreateGUI ( void ) m_pFullscreenStyleCombo->AddItem ( _("Borderless window") )->SetData ( (void*)FULLSCREEN_BORDERLESS ); m_pFullscreenStyleCombo->AddItem ( _("Borderless keep res") )->SetData ( (void*)FULLSCREEN_BORDERLESS_KEEP_RES ); m_pFullscreenStyleCombo->SetReadOnly ( true ); - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; // Process priority m_pPriorityLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, "Process priority:" ) ); @@ -1207,7 +1324,7 @@ void CSettings::CreateGUI ( void ) m_pDebugSettingCombo->AddItem ( "#0000 Joystick" )->SetData ( (void*)EDiagnosticDebug::JOYSTICK_0000 ); m_pDebugSettingCombo->AddItem ( "#0000 Lua trace" )->SetData ( (void*)EDiagnosticDebug::LUA_TRACE_0000 ); m_pDebugSettingCombo->SetReadOnly ( true ); - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; m_pDebugSettingCombo->SetText ( _("Default") ); SetApplicationSetting ( "diagnostics", "debug-setting", "none" ); @@ -1237,7 +1354,7 @@ void CSettings::CreateGUI ( void ) m_pStreamingMemoryMaxLabel->SetPosition ( CVector2D ( vecTemp.fX + vecSize.fX + 5.0f, vecTemp.fY ) ); m_pStreamingMemoryMaxLabel->AutoSize ( ); vecTemp.fX = 22.f; - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; // Windows 8 compatibility m_pWin8Label = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Windows 8 compatibility:") ) ); @@ -1253,7 +1370,7 @@ void CSettings::CreateGUI ( void ) m_pWin8MouseCheckBox = reinterpret_cast < CGUICheckBox* > ( pManager->CreateCheckBox ( pTabAdvanced, _("Mouse fix") ) ); m_pWin8MouseCheckBox->SetPosition ( CVector2D ( vecTemp.fX + fIndentX, vecTemp.fY - 1.0f ) ); m_pWin8MouseCheckBox->AutoSize ( NULL, 20.0f ); - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; vecTemp.fX -= 110; if ( GetApplicationSetting ( "os-version" ) < "6.2" ) @@ -1262,7 +1379,7 @@ void CSettings::CreateGUI ( void ) m_pWin8Label->SetVisible ( false ); m_pWin8ColorCheckBox->SetVisible ( false ); m_pWin8MouseCheckBox->SetVisible ( false ); - vecTemp.fY -= 29; + vecTemp.fY -= fLineHeight; #endif } @@ -1271,7 +1388,7 @@ void CSettings::CreateGUI ( void ) m_pAdvancedUpdaterLabel->SetPosition ( CVector2D ( vecTemp.fX - 10.0f, vecTemp.fY ) ); m_pAdvancedUpdaterLabel->SetFont ( "default-bold-small" ); m_pAdvancedUpdaterLabel->AutoSize ( _("Auto updater") ); - vecTemp.fY += 20; + vecTemp.fY += fHeaderHeight; // UpdateAutoInstall m_pUpdateAutoInstallLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Install important updates:") ) ); @@ -1284,7 +1401,15 @@ void CSettings::CreateGUI ( void ) m_pUpdateAutoInstallCombo->AddItem ( _("Off") )->SetData ( (void*)0 ); m_pUpdateAutoInstallCombo->AddItem ( _("Default") )->SetData ( (void*)1 ); m_pUpdateAutoInstallCombo->SetReadOnly ( true ); - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; + + if ( true ) + { + // Always hide for now + m_pUpdateAutoInstallLabel->SetVisible ( false ); + m_pUpdateAutoInstallCombo->SetVisible ( false ); + vecTemp.fY -= fLineHeight; + } // Update build type m_pUpdateBuildTypeLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, _("Update build type:") ) ); @@ -1306,11 +1431,11 @@ void CSettings::CreateGUI ( void ) m_pButtonUpdate->AutoSize ( NULL, 20.0f, 8.0f ); m_pButtonUpdate->SetClickHandler ( GUI_CALLBACK ( &CSettings::OnUpdateButtonClick, this ) ); m_pButtonUpdate->SetZOrderingEnabled ( false ); - vecTemp.fY += 29; + vecTemp.fY += fLineHeight; vecTemp.fX -= fComboWidth + 15; // Description label - vecTemp.fY = 354; + vecTemp.fY = 354 + 10; m_pAdvancedSettingDescriptionLabel = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( pTabAdvanced, "" ) ); m_pAdvancedSettingDescriptionLabel->SetPosition ( CVector2D ( vecTemp.fX + 10.f, vecTemp.fY ) ); m_pAdvancedSettingDescriptionLabel->SetFont ( "default-bold-small" ); @@ -1340,6 +1465,10 @@ void CSettings::CreateGUI ( void ) m_pCheckBoxAllowScreenUpload->SetClickHandler ( GUI_CALLBACK( &CSettings::OnAllowScreenUploadClick, this ) ); m_pCheckBoxCustomizedSAFiles->SetClickHandler ( GUI_CALLBACK( &CSettings::OnCustomizedSAFilesClick, this ) ); m_pCheckBoxShowUnsafeResolutions->SetClickHandler ( GUI_CALLBACK( &CSettings::ShowUnsafeResolutionsClick, this ) ); + m_pButtonBrowserBlacklistAdd->SetClickHandler ( GUI_CALLBACK ( &CSettings::OnBrowserBlacklistAdd, this ) ); + m_pButtonBrowserBlacklistRemove->SetClickHandler ( GUI_CALLBACK ( &CSettings::OnBrowserBlacklistRemove, this ) ); + m_pButtonBrowserWhitelistAdd->SetClickHandler ( GUI_CALLBACK ( &CSettings::OnBrowserWhitelistAdd, this ) ); + m_pButtonBrowserWhitelistRemove->SetClickHandler ( GUI_CALLBACK ( &CSettings::OnBrowserWhitelistRemove, this ) ); /* // Give a warning if no community account settings were stored in config CCore::GetSingleton ().ShowMessageBox ( CORE_SETTINGS_COMMUNITY_WARNING, _("Multi Theft Auto: Community settings"), MB_ICON_WARNING ); @@ -1370,6 +1499,18 @@ void CSettings::CreateGUI ( void ) m_pSingleDownloadCombo->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) ); m_pSingleDownloadCombo->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) ); + m_pPacketTagLabel->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) ); + m_pPacketTagLabel->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) ); + + m_pPacketTagCombo->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) ); + m_pPacketTagCombo->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) ); + + m_pProgressAnimationLabel->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) ); + m_pProgressAnimationLabel->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) ); + + m_pProgressAnimationCombo->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) ); + m_pProgressAnimationCombo->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) ); + m_pFullscreenStyleLabel->SetMouseEnterHandler ( GUI_CALLBACK ( &CSettings::OnShowAdvancedSettingDescription, this ) ); m_pFullscreenStyleLabel->SetMouseLeaveHandler ( GUI_CALLBACK ( &CSettings::OnHideAdvancedSettingDescription, this ) ); @@ -1451,6 +1592,32 @@ void CSettings::ShowRestartQuestion ( void ) } +void DisconnectCallback ( void* ptr, unsigned int uiButton ) +{ + CCore::GetSingleton ().GetLocalGUI ()->GetMainMenu ()->GetQuestionWindow ()->Reset (); + + if ( uiButton == 1 ) + { + CCommands::GetSingleton ().Execute ( "disconnect", "" ); + } +} + + +void CSettings::ShowDisconnectQuestion ( void ) +{ + SString strMessage = _("Some settings will be changed when you disconnect the current server"); + strMessage += _("\n\nDo you want to disconnect now?"); + CQuestionBox* pQuestionBox = CCore::GetSingleton ().GetLocalGUI ()->GetMainMenu ()->GetQuestionWindow (); + pQuestionBox->Reset (); + pQuestionBox->SetTitle ( _("DISCONNECT REQUIRED") ); + pQuestionBox->SetMessage ( strMessage ); + pQuestionBox->SetButton ( 0, _("No") ); + pQuestionBox->SetButton ( 1, _("Yes") ); + pQuestionBox->SetCallback ( DisconnectCallback ); + pQuestionBox->Show (); +} + + bool CSettings::OnMouseDoubleClick ( CGUIMouseEventArgs Args ) { if ( Args.pWindow == m_pBindsList ) { @@ -2035,24 +2202,24 @@ void CSettings::ProcessKeyBinds ( void ) // If the primary key is different than the original one if ( pPriKey != pBind->boundKey ) { // Did we have any keys with the same "up" state? - CCommandBind* pUpBind = pKeyBinds->GetBindFromCommand ( szCommand, NULL, true, pBind->boundKey->szKey, true, false ); + CCommandBind* pUpBind = pKeyBinds->FindMatchingUpBind( pBind ); if ( pUpBind ) { - pUpBind->boundKey = pPriKey; + pKeyBinds->UserChangeCommandBoundKey( pUpBind, pPriKey ); } - pBind->boundKey = pPriKey; + pKeyBinds->UserChangeCommandBoundKey( pBind, pPriKey ); } } // If the primary key field was empty, we can remove the keybind else { // Remove any matching "up" state binds we may have - CCommandBind* pUpBind = pKeyBinds->GetBindFromCommand ( szCommand, NULL, true, pBind->boundKey->szKey, true, false ); + CCommandBind* pUpBind = pKeyBinds->FindMatchingUpBind( pBind ); if ( pUpBind ) { - pKeyBinds->Remove ( pUpBind ); + pKeyBinds->UserRemoveCommandBoundKey( pUpBind ); } - pKeyBinds->Remove ( pBind ); + pKeyBinds->UserRemoveCommandBoundKey( pBind ); } } // If there was no keybind for this command, create it @@ -2077,24 +2244,24 @@ void CSettings::ProcessKeyBinds ( void ) if ( pSecKeys[k] != pBind->boundKey ) { // Did we have any keys with the same "up" state? - CCommandBind* pUpBind = pKeyBinds->GetBindFromCommand ( szCommand, NULL, true, pBind->boundKey->szKey, true, false ); + CCommandBind* pUpBind = pKeyBinds->FindMatchingUpBind ( pBind ); if ( pUpBind ) { - pUpBind->boundKey = pSecKeys[k]; + pKeyBinds->UserChangeCommandBoundKey( pUpBind, pSecKeys[k] ); } - pBind->boundKey = pSecKeys[k]; + pKeyBinds->UserChangeCommandBoundKey( pBind, pSecKeys[k] ); } } // If the secondary key field was empty, we should remove the keybind else { // Remove any matching "up" state binds we may have - CCommandBind* pUpBind = pKeyBinds->GetBindFromCommand ( szCommand, NULL, true, pBind->boundKey->szKey, true, false ); + CCommandBind* pUpBind = pKeyBinds->FindMatchingUpBind ( pBind ); if ( pUpBind ) { - pKeyBinds->Remove ( pUpBind ); + pKeyBinds->UserRemoveCommandBoundKey( pUpBind ); } - pKeyBinds->Remove ( pBind ); + pKeyBinds->UserRemoveCommandBoundKey( pBind ); } } // If this key bind didn't exist, create it @@ -2103,13 +2270,13 @@ void CSettings::ProcessKeyBinds ( void ) if ( strResource.empty() ) pKeyBinds->AddCommand ( pSecKeys[k], szCommand, szArguments ); else - pKeyBinds->AddCommand ( pSecKeys[k]->szKey, szCommand, szArguments, true, strResource.c_str (), true ); + pKeyBinds->AddCommand ( pSecKeys[k]->szKey, szCommand, szArguments, true, strResource.c_str () ); // Also add a matching "up" state if applicable CCommandBind* pUpBind = pKeyBinds->GetBindFromCommand ( szCommand, NULL, true, pPriKey->szKey, true, false ); if ( pUpBind ) { - pKeyBinds->AddCommand ( pSecKeys[k]->szKey, szCommand, pUpBind->szArguments, false, pUpBind->szResource, true ); + pKeyBinds->AddCommand ( pSecKeys[k]->szKey, szCommand, pUpBind->szArguments, false, pUpBind->szResource ); } } } @@ -2236,6 +2403,8 @@ void CSettings::Initialize ( void ) (*iters)->rowCount = 0; } + pKeyBinds->SortCommandBinds(); + // Loop through all the available controls int i; for ( i = 0 ; *g_bcControls [ i ].szControl != NULL ; i++ ); @@ -2691,6 +2860,16 @@ void CSettings::LoadData ( void ) if ( iVar == 0 ) m_pSingleDownloadCombo->SetText ( _("Default") ); else if ( iVar == 1 ) m_pSingleDownloadCombo->SetText ( _("On") ); + // Packet tag + CVARS_GET ( "packet_tag", iVar ); + if ( iVar == 0 ) m_pPacketTagCombo->SetText ( _("Default") ); + else if ( iVar == 1 ) m_pPacketTagCombo->SetText ( _("On") ); + + // Progress animation + CVARS_GET ( "progress_animation", iVar ); + if ( iVar == 0 ) m_pProgressAnimationCombo->SetText ( _("Off") ); + else if ( iVar == 1 ) m_pProgressAnimationCombo->SetText ( _("Default") ); + // Windows 8 16-bit color iVar = GetApplicationSettingInt( "Win8Color16" ); m_pWin8ColorCheckBox->SetSelected ( iVar != 0 ); @@ -2749,6 +2928,24 @@ void CSettings::LoadData ( void ) CVARS_GET ( "chat_line_fade_out", iVar ); SetMilliseconds ( m_pChatLineFadeout, iVar ); } + + // Browser + CVARS_GET ( "browser_remote_websites", bVar ); m_pCheckBoxRemoteBrowser->SetSelected ( bVar ); + CVARS_GET ( "browser_remote_javascript", bVar ); m_pCheckBoxRemoteJavascript->SetSelected ( bVar ); + CVARS_GET ( "browser_plugins", bVar ); m_pCheckBoxBrowserPluginsEnabled->SetSelected ( bVar ); + + m_pGridBrowserBlacklist->Clear (); + m_pGridBrowserWhitelist->Clear (); + + std::vector> customBlacklist; + CCore::GetSingleton ().GetWebCore ()->GetFilterEntriesByType ( customBlacklist, eWebFilterType::WEBFILTER_USER ); + for ( std::vector>::iterator iter = customBlacklist.begin(); iter != customBlacklist.end (); ++iter ) + { + if ( iter->second == false ) + m_pGridBrowserBlacklist->SetItemText ( m_pGridBrowserBlacklist->AddRow (), 1, iter->first ); + else + m_pGridBrowserWhitelist->SetItemText ( m_pGridBrowserWhitelist->AddRow (), 1, iter->first ); + } } void CSettings::SaveData ( void ) @@ -2935,6 +3132,20 @@ void CSettings::SaveData ( void ) CVARS_SET ( "single_download", iSelected ); } + // Packet tag + if ( CGUIListItem* pSelected = m_pPacketTagCombo->GetSelectedItem () ) + { + int iSelected = ( int ) pSelected->GetData(); + CVARS_SET ( "packet_tag", iSelected ); + } + + // Progress animation + if ( CGUIListItem* pSelected = m_pProgressAnimationCombo->GetSelectedItem () ) + { + int iSelected = ( int ) pSelected->GetData(); + CVARS_SET ( "progress_animation", iSelected ); + } + // Windows 8 16-bit color SetApplicationSettingInt( "Win8Color16", m_pWin8ColorCheckBox->GetSelected() ); @@ -3018,6 +3229,39 @@ void CSettings::SaveData ( void ) unsigned int value = SharedUtil::Lerp ( min, fPos, max ); CVARS_SET ( "streaming_memory", value ); + // Webbrowser settings + bool bOldRemoteWebsites, bOldRemoteJavascript, bOldPlugins; + CVARS_GET ( "browser_remote_websites", bOldRemoteWebsites ); + CVARS_GET ( "browser_remote_javascript", bOldRemoteJavascript ); + CVARS_GET ( "browser_plugins", bOldPlugins ); + + bool bBrowserSettingChanged = false; + if ( bOldRemoteWebsites != m_pCheckBoxRemoteBrowser->GetSelected() + || bOldRemoteJavascript != m_pCheckBoxRemoteJavascript->GetSelected() + || bOldPlugins != m_pCheckBoxBrowserPluginsEnabled->GetSelected()) + { + bBrowserSettingChanged = true; + CVARS_SET ( "browser_remote_websites", m_pCheckBoxRemoteBrowser->GetSelected () ); + CVARS_SET ( "browser_remote_javascript", m_pCheckBoxRemoteJavascript->GetSelected () ); + CVARS_SET ("browser_plugins", m_pCheckBoxBrowserPluginsEnabled->GetSelected () ); + } + + std::vector customBlacklist; + for ( int i = 0; i < m_pGridBrowserBlacklist->GetRowCount (); ++i ) + { + customBlacklist.push_back ( m_pGridBrowserBlacklist->GetItemText ( i, 1 ) ); + } + CCore::GetSingleton ().GetWebCore ()->WriteCustomList ( "customblacklist", customBlacklist ); + + std::vector customWhitelist; + for ( int i = 0; i < m_pGridBrowserWhitelist->GetRowCount (); ++i ) + { + customWhitelist.push_back ( m_pGridBrowserWhitelist->GetItemText ( i, 1 ) ); + } + CCore::GetSingleton ().GetWebCore ()->WriteCustomList ( "customwhitelist", customWhitelist ); + if ( m_bBrowserListsChanged ) + bBrowserSettingChanged = true; + // Ensure CVARS ranges ok CClientVariables::GetSingleton().ValidateValues (); @@ -3029,6 +3273,8 @@ void CSettings::SaveData ( void ) // Ask to restart? if ( bIsVideoModeChanged || bIsAntiAliasingChanged || bIsAeroChanged || bIsDriverOverridesChanged || bIsCustomizedSAFilesChanged || bIsLocaleChanged ) ShowRestartQuestion(); + else if ( CModManager::GetSingleton ().IsLoaded () && bBrowserSettingChanged ) + ShowDisconnectQuestion(); } void CSettings::RemoveKeyBindSection ( char * szSectionName ) @@ -3656,6 +3902,79 @@ bool CSettings::ShowUnsafeResolutionsClick ( CGUIElement* pElement ) return true; } +bool CSettings::OnBrowserBlacklistAdd ( CGUIElement* pElement ) +{ + SString strDomain = m_pEditBrowserBlacklistAdd->GetText (); + if ( !strDomain.empty () ) + { + bool bExists = false; + for ( int i = 0; i < m_pGridBrowserBlacklist->GetRowCount (); ++i ) + { + if ( m_pGridBrowserBlacklist->GetItemText ( i, 1 ) == strDomain ) + { + bExists = true; + break; + } + } + + if ( !bExists ) + { + m_pGridBrowserBlacklist->SetItemText ( m_pGridBrowserBlacklist->AddRow (), 1, strDomain ); + m_bBrowserListsChanged = true; + } + } + return true; +} + +bool CSettings::OnBrowserBlacklistRemove ( CGUIElement* pElement ) +{ + int iSelectedRow = m_pGridBrowserBlacklist->GetSelectedItemRow (); + if ( iSelectedRow > -1 ) + { + m_pGridBrowserBlacklist->RemoveRow ( iSelectedRow ); + m_bBrowserListsChanged = true; + } + + return true; +} + +bool CSettings::OnBrowserWhitelistAdd ( CGUIElement* pElement ) +{ + SString strDomain = m_pEditBrowserWhitelistAdd->GetText (); + if ( !strDomain.empty () ) + { + bool bExists = false; + for ( int i = 0; i < m_pGridBrowserWhitelist->GetRowCount (); ++i ) + { + if ( m_pGridBrowserWhitelist->GetItemText ( i, 1 ) == strDomain ) + { + bExists = true; + break; + } + } + + if ( !bExists ) + { + m_pGridBrowserWhitelist->SetItemText ( m_pGridBrowserWhitelist->AddRow (), 1, strDomain ); + m_bBrowserListsChanged = true; + } + } + return true; +} + +bool CSettings::OnBrowserWhitelistRemove ( CGUIElement* pElement ) +{ + int iSelectedRow = m_pGridBrowserWhitelist->GetSelectedItemRow (); + if ( iSelectedRow > -1 ) + { + m_pGridBrowserWhitelist->RemoveRow ( iSelectedRow ); + m_bBrowserListsChanged = true; + } + + return true; +} + + void NewNicknameCallback ( void* ptr, unsigned int uiButton, std::string strNick ) { if ( uiButton == 1 ) // We hit OK @@ -3705,6 +4024,10 @@ bool CSettings::OnShowAdvancedSettingDescription ( CGUIElement* pElement ) strText = std::string( _( "Browser speed:" ) ) + " " + std::string( _( "Older routers may require a slower scan speed." ) ); else if ( pLabel && pLabel == m_pSingleDownloadLabel || pComboBox && pComboBox == m_pSingleDownloadCombo ) strText = std::string( _( "Single connection:" ) ) + " " + std::string( _( "Switch on to use only one connection when downloading." ) ); + else if ( pLabel && pLabel == m_pPacketTagLabel || pComboBox && pComboBox == m_pPacketTagCombo ) + strText = std::string( _( "Packet tag:" ) ) + " " + std::string( _( "Tag network packets to help ISPs identify MTA traffic." ) ); + else if ( pLabel && pLabel == m_pProgressAnimationLabel || pComboBox && pComboBox == m_pProgressAnimationCombo ) + strText = std::string( _( "Progress animation:" ) ) + " " + std::string( _( "Spinning circle animation at the bottom of the screen" ) ); else if ( pLabel && pLabel == m_pFullscreenStyleLabel || pComboBox && pComboBox == m_pFullscreenStyleCombo ) strText = std::string( _( "Fullscreen mode:" ) ) + " " + std::string( _( "Experimental feature." ) ); else if ( pLabel && pLabel == m_pDebugSettingLabel || pComboBox && pComboBox == m_pDebugSettingCombo ) diff --git a/MTA10/core/CSettings.h b/MTA10/core/CSettings.h index aa22203bf59..56ae5cf692f 100644 --- a/MTA10/core/CSettings.h +++ b/MTA10/core/CSettings.h @@ -138,6 +138,7 @@ class CSettings void RequestNewNickname ( void ); void ShowRestartQuestion ( void ); + void ShowDisconnectQuestion ( void ); void TabSkip ( bool bBackwards ); @@ -214,6 +215,10 @@ class CSettings CGUIComboBox* m_pBrowserSpeedCombo; CGUILabel* m_pSingleDownloadLabel; CGUIComboBox* m_pSingleDownloadCombo; + CGUILabel* m_pPacketTagLabel; + CGUIComboBox* m_pPacketTagCombo; + CGUILabel* m_pProgressAnimationLabel; + CGUIComboBox* m_pProgressAnimationCombo; CGUILabel* m_pDebugSettingLabel; CGUIComboBox* m_pDebugSettingCombo; CGUILabel* m_pWin8Label; @@ -317,6 +322,22 @@ class CSettings CGUIEdit* m_pChatLineLife; CGUIEdit* m_pChatLineFadeout; + CGUILabel* m_pLabelBrowserGeneral; + CGUICheckBox* m_pCheckBoxRemoteBrowser; + CGUICheckBox* m_pCheckBoxRemoteJavascript; + CGUICheckBox* m_pCheckBoxBrowserPluginsEnabled; + CGUILabel* m_pLabelBrowserCustomBlacklist; + CGUIEdit* m_pEditBrowserBlacklistAdd; + CGUIButton* m_pButtonBrowserBlacklistAdd; + CGUIGridList* m_pGridBrowserBlacklist; + CGUIButton* m_pButtonBrowserBlacklistRemove; + CGUILabel* m_pLabelBrowserCustomWhitelist; + CGUIEdit* m_pEditBrowserWhitelistAdd; + CGUIButton* m_pButtonBrowserWhitelistAdd; + CGUIGridList* m_pGridBrowserWhitelist; + CGUIButton* m_pButtonBrowserWhitelistRemove; + bool m_bBrowserListsChanged; + bool OnJoypadTextChanged ( CGUIElement* pElement ); bool OnAxisSelectClick ( CGUIElement* pElement ); bool OnAudioDefaultClick ( CGUIElement* pElement ); @@ -343,6 +364,10 @@ class CSettings bool OnUpdateButtonClick ( CGUIElement* pElement ); bool OnMouseSensitivityChanged ( CGUIElement* pElement ); bool OnVerticalAimSensitivityChanged ( CGUIElement* pElement ); + bool OnBrowserBlacklistAdd ( CGUIElement* pElement ); + bool OnBrowserBlacklistRemove( CGUIElement* pElement ); + bool OnBrowserWhitelistAdd ( CGUIElement* pElement ); + bool OnBrowserWhitelistRemove( CGUIElement* pElement ); bool OnMouseDoubleClick ( CGUIMouseEventArgs Args ); diff --git a/MTA10/core/CWebCore.cpp b/MTA10/core/CWebCore.cpp new file mode 100644 index 00000000000..f7888ae7a43 --- /dev/null +++ b/MTA10/core/CWebCore.cpp @@ -0,0 +1,851 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: core/CWebCore.cpp +* PURPOSE: Webbrowser class +* +*****************************************************************************/ + +#include "StdInc.h" +#include "CWebCore.h" +#include "CWebView.h" +#include "CWebsiteRequests.h" +#include +#include +#include +#include +#include +#include +#include "WebBrowserHelpers.h" + +#ifdef CEF_ENABLE_SANDBOX + #pragma comment(lib, "cef_sandbox.lib") +#endif + +CWebCore::CWebCore () +{ + m_pRequestsGUI = nullptr; + m_bTestmodeEnabled = false; + m_pAudioSessionManager = nullptr; + m_pXmlConfig = nullptr; + m_pFocusedWebView = nullptr; + + MakeSureXMLNodesExist (); + InitialiseWhiteAndBlacklist (); + + // Update dynamic lists from QA server + UpdateListsFromMaster (); + + // Get AudioVolume COM interface if the Audio Core API is available + if ( GetApplicationSetting("os-version") >= "6.2" ) + { + InitialiseCoreAudio (); + } +} + +CWebCore::~CWebCore () +{ + // Shutdown CEF + CefShutdown(); + + if ( m_pAudioSessionManager ) + m_pAudioSessionManager->Release (); + + delete m_pRequestsGUI; + delete m_pXmlConfig; +} + +bool CWebCore::Initialise () +{ + CefMainArgs mainArgs; + void* sandboxInfo = nullptr; + CefRefPtr app = new CCefApp; + +#if CEF_ENABLE_SANDBOX + CefScopedSandboxInfo scopedSandbox; + sandboxInfo = scopedSandbox.sandbox_info(); +#endif + + if ( CefExecuteProcess ( mainArgs, app, sandboxInfo ) >= 0 ) + return false; + + CefSettings settings; +#if !CEF_ENABLE_SANDBOX + settings.no_sandbox = true; +#endif + + // Specifiy sub process executable path +#ifndef MTA_DEBUG + CefString ( &settings.browser_subprocess_path ).FromASCII( CalcMTASAPath ( "MTA\\CEF\\CEFLauncher.exe" ) ); +#else + CefString ( &settings.browser_subprocess_path ).FromASCII( CalcMTASAPath ( "MTA\\CEF\\CEFLauncher_d.exe" ) ); +#endif + //CefString ( &settings.user_agent ).FromASCII ( "Multi Theft Auto: San Andreas Client; Chromium" ); + CefString ( &settings.resources_dir_path ).FromASCII ( CalcMTASAPath( "MTA\\CEF") ); + CefString ( &settings.locales_dir_path ).FromASCII( CalcMTASAPath( "MTA\\CEF\\locales" ) ); + CefString ( &settings.log_file ).FromASCII ( CalcMTASAPath ( "MTA\\CEF\\cefdebug.txt" ) ); +#ifdef MTA_DEBUG + settings.log_severity = cef_log_severity_t::LOGSEVERITY_INFO; +#else + settings.log_severity = cef_log_severity_t::LOGSEVERITY_WARNING; +#endif + + settings.multi_threaded_message_loop = true; + settings.windowless_rendering_enabled = true; + + bool state = CefInitialize ( mainArgs, settings, app, sandboxInfo ); + + // Register custom scheme handler factory + CefRegisterSchemeHandlerFactory ( "mtalocal", "", app ); + + return state; +} + +CWebViewInterface* CWebCore::CreateWebView ( unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent ) +{ + // Create our webview implementation + CefRefPtr pWebView = new CWebView ( uiWidth, uiHeight, bIsLocal, pWebBrowserRenderItem, bTransparent ); + m_WebViews.push_back ( pWebView ); + + return static_cast < CWebViewInterface* > ( pWebView.get () ); +} + +void CWebCore::DestroyWebView ( CWebViewInterface* pWebViewInterface ) +{ + CefRefPtr pWebView = dynamic_cast ( pWebViewInterface ); + if ( pWebView ) + { + // Ensure that no attached events are in the queue + RemoveWebViewEvents ( pWebView ); + pWebView->NotifyPaint (); + + m_WebViews.remove ( pWebView ); + //pWebView->Release(); // Do not release since other references get corrupted then + pWebView->CloseBrowser (); + } +} + +void CWebCore::DoPulse () +{ + // Check for queued whitelist/blacklist downloads + g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->ProcessQueuedFiles (); + + // Execute queued events on the main thread (Lua calls must be executed on the main thread) + DoEventQueuePulse (); +} + +CWebView* CWebCore::FindWebView ( CefRefPtr browser ) +{ + for ( auto pWebView : m_WebViews ) + { + // CefBrowser objects are not unique + if ( pWebView->GetCefBrowser ()->GetIdentifier () == browser->GetIdentifier () ) + return pWebView.get (); + } + return nullptr; +} + +void CWebCore::AddEventToEventQueue ( std::function event, CWebView* pWebView, const SString& name ) +{ +#ifndef MTA_DEBUG + UNREFERENCED_PARAMETER(name); +#endif + if ( pWebView->IsBeingDestroyed () ) + return; + + std::lock_guard lock ( m_EventQueueMutex ); + +#ifndef MTA_DEBUG + m_EventQueue.push_back ( EventEntry ( event, pWebView ) ); +#else + m_EventQueue.push_back ( EventEntry ( event, pWebView, name ) ); +#endif +} + +void CWebCore::RemoveWebViewEvents ( CWebView* pWebView ) +{ + std::lock_guard lock ( m_EventQueueMutex ); + + for ( auto iter = m_EventQueue.begin (); iter != m_EventQueue.end (); ) + { + // Increment iterator before we remove the element from the list (to guarantee iterator validity) + auto tempIterator = iter++; + if ( tempIterator->pWebView == pWebView ) + m_EventQueue.erase ( tempIterator ); + } +} + +void CWebCore::DoEventQueuePulse () +{ + std::lock_guard lock ( m_EventQueueMutex ); + + for ( auto& event : m_EventQueue ) + { + event.callback (); + } + + // Clear message queue + m_EventQueue.clear (); + + // Invoke paint method if necessary on the main thread + for ( auto& view : m_WebViews ) + { + view->NotifyPaint (); + } +} + +eURLState CWebCore::GetURLState ( const SString& strURL ) +{ + std::lock_guard lock ( m_FilterMutex ); + + // Initialize wildcard whitelist (be careful with modifying) | Todo: Think about the following + static SString wildcardWhitelist[] = { "*.googlevideo.com", "*.google.com", "*.youtube.com", "*.ytimg.com", "*.vimeocdn.com" }; + + for ( int i = 0; i < sizeof(wildcardWhitelist) / sizeof(SString); ++i ) + { + if ( WildcardMatch ( wildcardWhitelist[i], strURL ) ) + return eURLState::WEBPAGE_ALLOWED; + } + + google::dense_hash_map::iterator iter = m_Whitelist.find ( strURL ); + if ( iter != m_Whitelist.end () ) + { + if ( iter->second.first == true ) + return eURLState::WEBPAGE_ALLOWED; + else + { + if ( m_bTestmodeEnabled ) g_pCore->DebugPrintfColor ( "[BROWSER] Blocked page: %s", 255, 0, 0, strURL.c_str() ); + return eURLState::WEBPAGE_DISALLOWED; + } + } + + if ( m_bTestmodeEnabled ) g_pCore->DebugPrintfColor ( "[BROWSER] Blocked page: %s", 255, 0, 0, strURL.c_str() ); + return eURLState::WEBPAGE_NOT_LISTED; +} + +void CWebCore::ResetFilter ( bool bResetRequestsOnly ) +{ + std::lock_guard lock ( m_FilterMutex ); + + // Clear old data + m_PendingRequests.clear (); + + if ( !bResetRequestsOnly ) + { + m_Whitelist.clear (); + + // Re-add "default" entries + InitialiseWhiteAndBlacklist (); + } + else + { + // Erase all WEBFILTER_REQUEST entries + google::dense_hash_map::iterator iter = m_Whitelist.begin (); + for ( ; iter != m_Whitelist.end (); ) + { + if ( iter->second.second == eWebFilterType::WEBFILTER_REQUEST ) + m_Whitelist.erase ( iter++ ); + else + ++iter; + } + } +} + +void CWebCore::InitialiseWhiteAndBlacklist ( bool bAddHardcoded, bool bAddDynamic ) +{ + if ( bAddDynamic ) + { + // Hardcoded whitelist + static SString whitelist[] = { + "google.com", "youtube.com", "www.youtube-nocookie.com", "vimeo.com", "player.vimeo.com", "code.jquery.com", + "myvideo.com", "mtasa.com", "multitheftauto.com", "mtavc.com", "www.googleapis.com", "ajax.googleapis.com", + }; + + // Hardcoded blacklist + static SString blacklist[] = { "nobrain.dk" }; + + // Blacklist or whitelist URLs now + for ( unsigned int i = 0; i < sizeof(whitelist) / sizeof(SString); ++i ) + { + AddAllowedPage ( whitelist[i], eWebFilterType::WEBFILTER_HARDCODED ); + } + for ( unsigned int i = 0; i < sizeof(blacklist) / sizeof(SString); ++i ) + { + AddBlockedPage ( blacklist[i], eWebFilterType::WEBFILTER_HARDCODED ); + } + } + + // Load dynamic and custom blacklist from XML config + if ( bAddDynamic ) + LoadListsFromXML ( true, true, true ); +} + +void CWebCore::AddAllowedPage ( const SString& strURL, eWebFilterType filterType ) +{ + std::lock_guard lock ( m_FilterMutex ); + + m_Whitelist[strURL] = std::pair ( true, filterType ); +} + +void CWebCore::AddBlockedPage ( const SString& strURL, eWebFilterType filterType ) +{ + std::lock_guard lock ( m_FilterMutex ); + + m_Whitelist[strURL] = std::pair ( false, filterType ); +} + +void CWebCore::RequestPages ( const std::vector& pages ) +{ + // Add to pending pages queue + bool bNewItem = false; + for ( std::vector::const_iterator iter = pages.begin(); iter != pages.end(); ++iter ) + { + eURLState status = GetURLState ( *iter ); + if ( status == eURLState::WEBPAGE_ALLOWED || status == eURLState::WEBPAGE_DISALLOWED ) + continue; + + m_PendingRequests.push_back ( *iter ); + bNewItem = true; + } + + if ( bNewItem ) + { + // Open CEGUI dialog + if ( !m_pRequestsGUI ) + m_pRequestsGUI = new CWebsiteRequests; + + // Set pending requests memo content and show the window + m_pRequestsGUI->SetPendingRequests ( m_PendingRequests ); + m_pRequestsGUI->Show (); + } +} + +void CWebCore::AllowPendingPages ( bool bRemember ) +{ + for ( const auto& request : m_PendingRequests ) + { + AddAllowedPage ( request, !bRemember ? eWebFilterType::WEBFILTER_REQUEST : eWebFilterType::WEBFILTER_USER ); + } + + // Trigger an event now + CModManager::GetSingleton ().GetCurrentMod ()->WebsiteRequestResultHandler ( m_PendingRequests ); + m_PendingRequests.clear (); + + if ( bRemember ) + { + std::vector> result; // Contains only allowed entries + CCore::GetSingleton ().GetWebCore ()->GetFilterEntriesByType ( result, eWebFilterType::WEBFILTER_USER, eWebFilterState::WEBFILTER_ALLOWED ); + std::vector customWhitelist; + for ( std::vector>::iterator iter = result.begin (); iter != result.end (); ++iter ) + customWhitelist.push_back ( iter->first ); + + WriteCustomList ( "customwhitelist", customWhitelist, false ); + } +} + +void CWebCore::DenyPendingPages () +{ + m_PendingRequests.clear (); +} + +bool CWebCore::CanLoadRemotePages () +{ + bool bCanLoadRemotePages; + CVARS_GET ( "browser_remote_websites", bCanLoadRemotePages ); + return bCanLoadRemotePages; +} + +void CWebCore::OnPreScreenshot () +{ + // Clear all textures + g_pCore->GetWebCore ()->ClearTextures (); +} + +void CWebCore::OnPostScreenshot () +{ + // Re-draw textures + for ( auto& pWebView : m_WebViews ) + { + pWebView->GetCefBrowser ()->GetHost ()->Invalidate ( CefBrowserHost::PaintElementType::PET_VIEW ); + } +} + +void CWebCore::ProcessInputMessage ( UINT uMsg, WPARAM wParam, LPARAM lParam ) +{ + if ( !m_pFocusedWebView || !( uMsg == WM_KEYDOWN || uMsg == WM_KEYUP || uMsg == WM_CHAR || uMsg == WM_SYSCHAR || uMsg == WM_SYSKEYDOWN || uMsg == WM_SYSKEYUP ) ) + return; + + CefKeyEvent keyEvent; + keyEvent.windows_key_code = wParam; + keyEvent.native_key_code = lParam; + keyEvent.modifiers = GetCefKeyboardModifiers ( wParam, lParam ); + keyEvent.is_system_key = uMsg == WM_SYSCHAR || uMsg == WM_SYSKEYDOWN || uMsg == WM_SYSKEYUP; + + if ( uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN ) + keyEvent.type = cef_key_event_type_t::KEYEVENT_RAWKEYDOWN; + else if ( uMsg == WM_KEYUP || uMsg == WM_SYSKEYUP ) + keyEvent.type = cef_key_event_type_t::KEYEVENT_KEYUP; + else if ( uMsg == WM_CHAR || uMsg == WM_SYSCHAR ) + keyEvent.type = cef_key_event_type_t::KEYEVENT_CHAR; + + m_pFocusedWebView->InjectKeyboardEvent ( keyEvent ); +} + +void CWebCore::ClearTextures () +{ + for ( auto& pWebBrowser : m_WebViews ) + { + pWebBrowser->ClearTexture (); + } +} + +bool CWebCore::InitialiseCoreAudio() +{ + const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); + const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator); + const IID IID_IAudioSessionManager2 = __uuidof(IAudioSessionManager2); + + IMMDeviceEnumerator* pEnumerator; + CoCreateInstance ( CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&pEnumerator ); + if ( !pEnumerator ) + return false; + + IMMDevice* pMMDevice; + pEnumerator->GetDefaultAudioEndpoint ( EDataFlow::eRender, ERole::eMultimedia, &pMMDevice ); + pEnumerator->Release (); + if ( !pMMDevice ) + return false; + + IAudioSessionManager2* pAudioSessionManager; + pMMDevice->Activate ( IID_IAudioSessionManager2, 0, NULL, (void**)&pAudioSessionManager ); + pMMDevice->Release (); + if ( !pAudioSessionManager ) + return false; + + m_pAudioSessionManager = pAudioSessionManager; + return true; +} + +bool CWebCore::SetGlobalAudioVolume ( float fVolume ) +{ + if ( fVolume < 0.0f || fVolume > 1.0f ) + return false; + + if ( GetApplicationSetting ( "os-version" ) < "6.2" || !m_pAudioSessionManager ) + { + for ( auto& pWebView : m_WebViews ) + { + pWebView->SetAudioVolume ( fVolume ); + } + } + else + { + IAudioSessionEnumerator* pSessionEnumerator; + m_pAudioSessionManager->GetSessionEnumerator ( &pSessionEnumerator ); + if ( !pSessionEnumerator ) + return false; + + // Obtain the associated ISimpleAudioVolume interface + int sessionCount; + pSessionEnumerator->GetCount ( &sessionCount ); + for ( int i = 0; i < sessionCount; ++i ) + { + IAudioSessionControl2* pSessionControl; + pSessionEnumerator->GetSession ( i, (IAudioSessionControl**)&pSessionControl ); + PWSTR szIdentifier; + pSessionControl->GetSessionIdentifier(&szIdentifier); + + if ( std::wstring(szIdentifier).find(L"CEFLauncher") != std::string::npos ) + { + ISimpleAudioVolume* pSimpleAudioVolume; + pSessionControl->QueryInterface ( &pSimpleAudioVolume ); + pSimpleAudioVolume->SetMasterVolume ( fVolume, NULL ); + } + pSessionControl->Release (); + } + pSessionEnumerator->Release (); + } + return true; +} + +bool CWebCore::UpdateListsFromMaster () +{ + if ( !m_pXmlConfig ) + return false; + + CXMLNode* pRootNode = m_pXmlConfig->GetRootNode (); + if ( !pRootNode || !MakeSureXMLNodesExist () ) + return false; + + // Fetch white- and blacklist revision from config + CXMLNode* pWhiteRevNode = pRootNode->FindSubNode ( "whitelistrev" ); + if ( !pWhiteRevNode || !pWhiteRevNode->GetTagContent ( m_iWhitelistRevision ) ) + { + m_iWhitelistRevision = 0; + } + CXMLNode* pBlackRevNode = pRootNode->FindSubNode ( "blacklistrev" ); + if ( !pBlackRevNode || !pBlackRevNode->GetTagContent ( m_iBlacklistRevision ) ) + { + m_iBlacklistRevision = 0; + } + + // Get last update timestamp and compare with current time + CXMLNode* pLastUpdateNode = pRootNode->FindSubNode ( "lastupdate" ); + if ( pLastUpdateNode ) + { + SString lastUpdateTime = pLastUpdateNode->GetTagContent (); + + time_t currentTime; + time ( ¤tTime ); + + if ( lastUpdateTime < SString ( "%d", (long long)currentTime - BROWSER_LIST_UPDATE_INTERVAL ) ) + { + #ifdef MTA_DEBUG + OutputDebugLine ( "Updating white- and blacklist..." ); + #endif + g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString("%s?type=getrev", BROWSER_UPDATE_URL), + NULL, 0, NULL, 0, false, this, &CWebCore::StaticFetchRevisionProgress, false, 3 ); + + pLastUpdateNode->SetTagContent ( SString ( "%d", (long long)currentTime ) ); + m_pXmlConfig->Write (); + } + } + + return true; +} + +bool CWebCore::MakeSureXMLNodesExist () +{ + // Check xml file + if ( !m_pXmlConfig ) + { + SString browserDataPath = CalcMTASAPath ( MTA_BROWSERDATA_PATH ); + bool exists = FileExists ( browserDataPath ); + + m_pXmlConfig = g_pCore->GetXML ()->CreateXML ( browserDataPath ); + + if ( !m_pXmlConfig || ( exists && !m_pXmlConfig->Parse () ) ) + return false; + } + + CXMLNode* pRootNode = m_pXmlConfig->GetRootNode (); + if ( !pRootNode ) + { + pRootNode = m_pXmlConfig->CreateRootNode ( "browserdata" ); + if ( !pRootNode ) + return false; + } + + if ( !pRootNode->FindSubNode ( "lastupdate" ) ) + { + CXMLNode* pNode = pRootNode->CreateSubNode ( "lastupdate" ); + if ( !pNode ) + return false; + + pNode->SetTagContent ( 0 ); + } + + if ( !pRootNode->FindSubNode ( "whitelistrev" ) ) + { + if ( !pRootNode->CreateSubNode ( "whitelistrev" ) ) + return false; + } + + if ( !pRootNode->FindSubNode ( "blacklistrev" ) ) + { + if ( !pRootNode->CreateSubNode ( "blacklistrev" ) ) + return false; + } + + if ( !pRootNode->FindSubNode ( "globalwhitelist" ) ) + { + if ( !pRootNode->CreateSubNode ( "globalwhitelist" ) ) + return false; + } + + if ( !pRootNode->FindSubNode ( "globalblacklist" ) ) + { + if ( !pRootNode->CreateSubNode ( "globalblacklist" ) ) + return false; + } + + if ( !pRootNode->FindSubNode ( "customblacklist" ) ) + { + if ( !pRootNode->CreateSubNode ( "customblacklist" ) ) + return false; + } + + if ( !pRootNode->FindSubNode ( "customwhitelist" ) ) + { + if ( !pRootNode->CreateSubNode ( "customwhitelist" ) ) + return false; + } + + return true; +} + +void CWebCore::LoadListsFromXML ( bool bWhitelist, bool bBlacklist, bool bCustomLists ) +{ + if ( !m_pXmlConfig ) + return; + + CXMLNode* pRootNode = m_pXmlConfig->GetRootNode (); + if ( !pRootNode ) + return; + + if ( bWhitelist ) + { + CXMLNode* pWhiteSubNode = pRootNode->FindSubNode ( "globalwhitelist" ); + if ( pWhiteSubNode ) + { + for ( std::list::iterator iter = pWhiteSubNode->ChildrenBegin (); iter != pWhiteSubNode->ChildrenEnd (); ++iter ) + { + AddAllowedPage ( (*iter)->GetTagContent (), eWebFilterType::WEBFILTER_DYNAMIC ); + } + } + } + + if ( bBlacklist ) + { + CXMLNode* pBlackSubNode = pRootNode->FindSubNode ( "globalblacklist" ); + if ( pBlackSubNode ) + { + for ( std::list::iterator iter = pBlackSubNode->ChildrenBegin (); iter != pBlackSubNode->ChildrenEnd (); ++iter ) + { + AddBlockedPage ( (*iter)->GetTagContent (), eWebFilterType::WEBFILTER_DYNAMIC ); + } + } + } + + if ( bCustomLists ) + { + CXMLNode* pBlackSubNode = pRootNode->FindSubNode ( "customblacklist" ); + if ( pBlackSubNode ) + { + for ( std::list::iterator iter = pBlackSubNode->ChildrenBegin (); iter != pBlackSubNode->ChildrenEnd (); ++iter ) + { + AddBlockedPage ( (*iter)->GetTagContent (), eWebFilterType::WEBFILTER_USER ); + } + } + CXMLNode* pWhiteSubNode = pRootNode->FindSubNode ( "customwhitelist" ); + if ( pWhiteSubNode ) + { + for ( std::list::iterator iter = pWhiteSubNode->ChildrenBegin (); iter != pWhiteSubNode->ChildrenEnd (); ++iter ) + { + AddAllowedPage ( (*iter)->GetTagContent (), eWebFilterType::WEBFILTER_USER ); + } + } + } +} + +void CWebCore::WriteCustomList ( const SString& strListName, const std::vector& customList, bool bReset ) +{ + if ( !m_pXmlConfig || !MakeSureXMLNodesExist () ) + return; + + CXMLNode* pRootNode = m_pXmlConfig->GetRootNode (); + if ( !pRootNode ) + return; + + CXMLNode* pCustomListNode = pRootNode->FindSubNode ( strListName ); + if ( !pCustomListNode ) + return; + + pCustomListNode->DeleteAllSubNodes(); + for ( std::vector::const_iterator iter = customList.begin (); iter != customList.end (); ++iter ) + { + CXMLNode* pNode = pCustomListNode->CreateSubNode ( "url" ); + if ( pNode ) + pNode->SetTagContent ( *iter ); + } + + // Write custom blacklist and reload from XML + m_pXmlConfig->Write (); + if ( bReset ) + ResetFilter ( false ); +} + +void CWebCore::GetFilterEntriesByType ( std::vector>& outEntries, eWebFilterType filterType, eWebFilterState state ) +{ + std::lock_guard lock ( m_FilterMutex ); + + google::dense_hash_map::iterator iter = m_Whitelist.begin (); + for ( ; iter != m_Whitelist.end(); ++iter ) + { + if ( iter->second.second == filterType ) + { + if ( state == eWebFilterState::WEBFILTER_ALL ) + outEntries.push_back ( std::pair ( iter->first, iter->second.first ) ); + else if ( state == eWebFilterState::WEBFILTER_ALLOWED && iter->second.first == true ) + outEntries.push_back ( std::pair ( iter->first, iter->second.first ) ); + else + outEntries.push_back ( std::pair ( iter->first, iter->second.first ) ); + } + } +} + +bool CWebCore::StaticFetchRevisionProgress ( double dDownloadNow, double dDownloadTotal, char* pCompletedData, size_t completedLength, void *pObj, bool bComplete, int iError ) +{ + CWebCore* pWebCore = static_cast < CWebCore* > ( pObj ); + if ( bComplete ) + { + SString strData = pCompletedData; + SString strWhiteRevision, strBlackRevision; + strData.Split ( ";", &strWhiteRevision, &strBlackRevision ); + + if ( !strWhiteRevision.empty () && !strBlackRevision.empty () ) + { + int iWhiteListRevision = atoi ( strWhiteRevision ); + if ( iWhiteListRevision > pWebCore->m_iWhitelistRevision ) + { + g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString("%s?type=fetchwhite", BROWSER_UPDATE_URL ), + NULL, 0, NULL, 0, false, pWebCore, &CWebCore::StaticFetchWhitelistProgress, false, 3 ); + + pWebCore->m_iWhitelistRevision = iWhiteListRevision; + } + int iBlackListRevision = atoi ( strBlackRevision ); + if ( iBlackListRevision > pWebCore->m_iBlacklistRevision ) + { + g_pCore->GetNetwork ()->GetHTTPDownloadManager ( EDownloadModeType::WEBBROWSER_LISTS )->QueueFile ( SString("%s?type=fetchblack", BROWSER_UPDATE_URL), + NULL, 0, NULL, 0, false, pWebCore, &CWebCore::StaticFetchBlacklistProgress, false, 3 ); + + pWebCore->m_iBlacklistRevision = iBlackListRevision; + } + } + } + + return true; +} + +bool CWebCore::StaticFetchWhitelistProgress ( double dDownloadNow, double dDownloadTotal, char* pCompletedData, size_t completedLength, void *pObj, bool bComplete, int iError ) +{ + if ( !bComplete ) + return false; + + CWebCore* pWebCore = static_cast < CWebCore* > ( pObj ); + if ( !pWebCore->m_pXmlConfig ) + return false; + + if ( !pWebCore->MakeSureXMLNodesExist () ) + return false; + + CXMLNode* pRootNode = pWebCore->m_pXmlConfig->GetRootNode (); + std::vector whitelist; + SString strData = pCompletedData; + strData.Split ( ";", whitelist ); + CXMLNode* pListNode = pRootNode->FindSubNode ( "globalwhitelist" ); + if ( !pListNode ) + return false; + pListNode->DeleteAllSubNodes (); + + for ( std::vector::const_iterator iter = whitelist.begin (); iter != whitelist.end (); ++iter ) + { + CXMLNode* pNode = pListNode->CreateSubNode ( "url" ); + pNode->SetTagContent ( *iter ); + } + + // Set whitelist revision + CXMLNode* pNode = pRootNode->FindSubNode ( "whitelistrev" ); + if ( !pNode ) + return false; + pNode->SetTagContent ( pWebCore->m_iWhitelistRevision ); + + // Write changes to the XML file + pWebCore->m_pXmlConfig->Write (); + + pWebCore->LoadListsFromXML ( true, false, false ); + +#ifdef MTA_DEBUG + OutputDebugLine ( "Updated whitelist!" ); +#endif + return true; +} + +bool CWebCore::StaticFetchBlacklistProgress ( double dDownloadNow, double dDownloadTotal, char* pCompletedData, size_t completedLength, void *pObj, bool bComplete, int iError ) +{ + if ( !bComplete ) + return false; + + CWebCore* pWebCore = static_cast < CWebCore* > ( pObj ); + if ( !pWebCore->m_pXmlConfig ) + return false; + + if ( !pWebCore->MakeSureXMLNodesExist () ) + return false; + + CXMLNode* pRootNode = pWebCore->m_pXmlConfig->GetRootNode (); + std::vector blacklist; + SString strData = pCompletedData; + strData.Split ( ";", blacklist ); + CXMLNode* pListNode = pRootNode->FindSubNode ( "globalblacklist" ); + if ( !pListNode ) + return false; + pListNode->DeleteAllSubNodes (); + + for ( std::vector::const_iterator iter = blacklist.begin (); iter != blacklist.end (); ++iter ) + { + CXMLNode* pNode = pListNode->CreateSubNode ( "url" ); + pNode->SetTagContent ( *iter ); + } + + // Set blacklist revision + CXMLNode* pNode = pRootNode->FindSubNode ( "blacklistrev" ); + if ( !pNode ) + return false; + pNode->SetTagContent ( pWebCore->m_iBlacklistRevision ); + + // Write changes to the XML file + pWebCore->m_pXmlConfig->Write (); + + pWebCore->LoadListsFromXML ( false, true, false ); + +#ifdef MTA_DEBUG + OutputDebugLine ( "Updated browser blacklist!" ); +#endif + return true; +} + +////////////////////////////////////////////////////////////// +// CefApp implementation // +////////////////////////////////////////////////////////////// +void CCefApp::OnRegisterCustomSchemes ( CefRefPtr < CefSchemeRegistrar > registrar ) +{ + // Register custom MTA scheme (has to be called in all proceseses) + registrar->AddCustomScheme ( "mtalocal", false, false, false ); +} + +CefRefPtr CCefApp::Create ( CefRefPtr browser, CefRefPtr frame, const CefString& scheme_name, CefRefPtr request ) +{ + if (scheme_name != "mtalocal") + return nullptr; + + CWebCore* pWebCore = static_cast(g_pCore->GetWebCore ()); + auto pWebView = pWebCore->FindWebView ( browser ); + if ( !pWebView || !pWebView->IsLocal () ) + return nullptr; + + CefURLParts urlParts; + if ( !CefParseURL ( request->GetURL (), urlParts ) ) + return nullptr; + + // Get full path + SString path = UTF16ToMbUTF8 ( urlParts.path.str ).substr ( 2 ); + if ( !pWebView->GetFullPathFromLocal ( path ) ) + return nullptr; + + // Get mime type from extension + CefString mimeType; + size_t pos = path.find_last_of('.'); + if (pos != std::string::npos) + mimeType = CefGetMimeType ( path.substr ( pos + 1 ) ); + else + mimeType = "text/plain"; + + auto stream = CefStreamReader::CreateForFile ( path ); + if ( stream.get () ) + return new CefStreamResourceHandler ( mimeType, stream ); + + return nullptr; +} diff --git a/MTA10/core/CWebCore.h b/MTA10/core/CWebCore.h new file mode 100644 index 00000000000..40b6ff4f8f1 --- /dev/null +++ b/MTA10/core/CWebCore.h @@ -0,0 +1,130 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: core/CWebCore.h +* PURPOSE: Webbrowser class +* +*****************************************************************************/ + +#ifndef __CWEBCORE_H +#define __CWEBCORE_H + +#undef GetNextSibling +#undef GetFirstChild +#include +#include +#include +#include +#define MTA_BROWSERDATA_PATH "mta/cef/browserdata.xml" +#define BROWSER_LIST_UPDATE_INTERVAL (24*60*60) +#define BROWSER_UPDATE_URL "http://cef.multitheftauto.com/get.php" +#define CEF_ENABLE_SANDBOX 0 +#define GetNextSibling(hwnd) GetWindow(hwnd, GW_HWNDNEXT) // Re-define the conflicting macro +#define GetFirstChild(hwnd) GetTopWindow(hwnd) + +class CWebBrowserItem; +class CWebsiteRequests; +class CWebView; +struct IAudioSessionManager2; + +class CWebCore : public CWebCoreInterface +{ + struct EventEntry + { + std::function callback; + CWebView* pWebView; + #ifdef MTA_DEBUG + SString name; + #endif + + EventEntry(const std::function& callback_, CWebView* pWebView_) : callback(callback_), pWebView(pWebView_) {} +#ifdef MTA_DEBUG + EventEntry(const std::function& callback_, CWebView* pWebView_, const SString& name_) : callback(callback_), pWebView(pWebView_), name(name_) {} +#endif + }; + +public: + CWebCore(); + ~CWebCore(); + bool Initialise (); + + CWebViewInterface* CreateWebView ( unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent ); + void DestroyWebView ( CWebViewInterface* pWebViewInterface ); + void DoPulse (); + CWebView* FindWebView ( CefRefPtr browser ); + + void AddEventToEventQueue( std::function func, CWebView* pWebView, const SString& name ); + void RemoveWebViewEvents ( CWebView* pWebView ); + void DoEventQueuePulse (); + + eURLState GetURLState ( const SString& strURL ); + void ResetFilter ( bool bResetRequestsOnly = true ); + void InitialiseWhiteAndBlacklist ( bool bAddHardcoded = true, bool bAddDynamic = true ); + void AddAllowedPage ( const SString& strURL, eWebFilterType filterType ); + void AddBlockedPage ( const SString& strURL, eWebFilterType filterType ); + void RequestPages ( const std::vector& pages ); + void AllowPendingPages ( bool bRemember ); + void DenyPendingPages (); + + inline bool IsTestModeEnabled () { return m_bTestmodeEnabled; }; + inline void SetTestModeEnabled ( bool bEnabled ) { m_bTestmodeEnabled = bEnabled; }; + + inline CWebViewInterface* GetFocusedWebView () { return (CWebViewInterface*) m_pFocusedWebView; }; + inline void SetFocusedWebView ( CWebView* pWebView ) { m_pFocusedWebView = pWebView; }; + void ProcessInputMessage ( UINT uMsg, WPARAM wParam, LPARAM lParam ); + void ClearTextures (); + + bool CanLoadRemotePages (); + + void OnPreScreenshot (); + void OnPostScreenshot (); + + bool InitialiseCoreAudio (); + bool SetGlobalAudioVolume( float fVolume ); + + bool UpdateListsFromMaster(); + bool MakeSureXMLNodesExist(); + void LoadListsFromXML ( bool bWhitelist, bool bBlacklist, bool bCustomLists ); + void WriteCustomList ( const SString& strListName, const std::vector& customList, bool bReset = true ); + void GetFilterEntriesByType( std::vector>& outEntries, eWebFilterType filterType, eWebFilterState state = eWebFilterState::WEBFILTER_ALL ); + static bool StaticFetchRevisionProgress ( double dDownloadNow, double dDownloadTotal, char* pCompletedData, size_t completedLength, void *pObj, bool bComplete, int iError ); + static bool StaticFetchWhitelistProgress ( double dDownloadNow, double dDownloadTotal, char* pCompletedData, size_t completedLength, void *pObj, bool bComplete, int iError ); + static bool StaticFetchBlacklistProgress ( double dDownloadNow, double dDownloadTotal, char* pCompletedData, size_t completedLength, void *pObj, bool bComplete, int iError ); + +private: + typedef std::pair WebFilterPair; + + CWebsiteRequests* m_pRequestsGUI; + std::list> m_WebViews; + bool m_bTestmodeEnabled; + CWebView* m_pFocusedWebView; + HCURSOR m_aCursors[16]; + + std::list m_EventQueue; + std::mutex m_EventQueueMutex; + + CFastHashMap m_Whitelist; + std::vector m_PendingRequests; + std::recursive_mutex m_FilterMutex; + + IAudioSessionManager2* m_pAudioSessionManager; + + CXMLFile* m_pXmlConfig; + int m_iWhitelistRevision; + int m_iBlacklistRevision; +}; + +class CCefApp : public CefApp, public CefSchemeHandlerFactory +{ +public: + virtual void OnRegisterCustomSchemes ( CefRefPtr registrar ) override; + + // CefSchemeHandlerFactory methods + virtual CefRefPtr Create ( CefRefPtr browser, CefRefPtr frame, const CefString& scheme_name, CefRefPtr request ) override; + + IMPLEMENT_REFCOUNTING(CCefApp); +}; + +#endif diff --git a/MTA10/core/CWebView.cpp b/MTA10/core/CWebView.cpp new file mode 100644 index 00000000000..038b8b01e56 --- /dev/null +++ b/MTA10/core/CWebView.cpp @@ -0,0 +1,662 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: core/CWebView.cpp +* PURPOSE: Web view class +* +*****************************************************************************/ +#include "StdInc.h" +#include "CWebView.h" +#include +#include +#include + +CWebView::CWebView ( unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent ) +{ + m_bIsLocal = bIsLocal; + m_bIsTransparent = bTransparent; + m_pWebBrowserRenderItem = pWebBrowserRenderItem; + m_pEventsInterface = nullptr; + m_bBeingDestroyed = false; +} + +CWebView::~CWebView () +{ + if ( IsMainThread () ) + { + if ( g_pCore->GetWebCore ()->GetFocusedWebView () == this ) + g_pCore->GetWebCore ()->SetFocusedWebView ( nullptr ); + } + + // Ensure that CefRefPtr::~CefRefPtr doesn't try to release it twice (it has already been released in CWebView::OnBeforeClose) + m_pWebView = nullptr; + +#ifdef MTA_DEBUG + OutputDebugLine ( "CWebView::~CWebView" ); +#endif +} + +void CWebView::Initialise () +{ + // Initialise the web session (which holds the actual settings) in in-memory mode + CefBrowserSettings browserSettings; + browserSettings.windowless_frame_rate = g_pCore->GetFrameRateLimit (); + browserSettings.javascript_access_clipboard = cef_state_t::STATE_DISABLED; + browserSettings.java = cef_state_t::STATE_DISABLED; + browserSettings.caret_browsing = cef_state_t::STATE_ENABLED; + browserSettings.universal_access_from_file_urls = cef_state_t::STATE_DISABLED; // Also filtered by resource interceptor, but set this nevertheless + browserSettings.file_access_from_file_urls = cef_state_t::STATE_DISABLED; + browserSettings.webgl = cef_state_t::STATE_ENABLED; + browserSettings.javascript_open_windows = cef_state_t::STATE_DISABLED; + + bool bEnabledPlugins; + CVARS_GET ( "browser_plugins", bEnabledPlugins ); + browserSettings.plugins = bEnabledPlugins ? cef_state_t::STATE_ENABLED : cef_state_t::STATE_DISABLED; + if ( !m_bIsLocal ) + { + bool bEnabledJavascript; + CVARS_GET ( "browser_remote_javascript", bEnabledJavascript ); + browserSettings.javascript = bEnabledJavascript ? cef_state_t::STATE_ENABLED : cef_state_t::STATE_DISABLED; + } + + CefWindowInfo windowInfo; + windowInfo.SetAsWindowless ( g_pCore->GetHookedWindow (), m_bIsTransparent ); + + CefBrowserHost::CreateBrowser ( windowInfo, this, "", browserSettings, nullptr ); +} + +void CWebView::CloseBrowser () +{ + // CefBrowserHost::CloseBrowser calls the destructor after the browser has been destroyed + m_bBeingDestroyed = true; + + if ( m_pWebView ) + m_pWebView->GetHost ()->CloseBrowser ( true ); +} + +bool CWebView::LoadURL ( const SString& strURL, bool bFilterEnabled ) +{ + if ( !m_pWebView ) + return false; + + CefURLParts urlParts; + if ( !CefParseURL ( strURL, urlParts ) ) + return false; // Invalid URL + + // Are we allowed to browse this website? + if ( bFilterEnabled && g_pCore->GetWebCore ()->GetURLState ( UTF16ToMbUTF8 ( urlParts.host.str ) ) != eURLState::WEBPAGE_ALLOWED ) + return false; + + // Load it! + m_pWebView->GetMainFrame ()->LoadURL ( strURL ); + + return true; +} + +bool CWebView::IsLoading () +{ + if ( !m_pWebView ) + return false; + + return m_pWebView->IsLoading (); +} + +void CWebView::GetURL ( SString& outURL ) +{ + if ( !m_pWebView ) + return; + + if ( !m_bIsLocal ) + outURL = static_cast < SString > ( m_pWebView->GetMainFrame ()->GetURL () ); + else + outURL = m_strTempURL; +} + +void CWebView::GetTitle ( SString& outTitle ) +{ + outTitle = m_CurrentTitle; +} + +void CWebView::SetRenderingPaused ( bool bPaused ) +{ + if ( m_pWebView ) + m_pWebView->GetHost ()->WasHidden ( bPaused ); +} + +void CWebView::Focus () +{ + if ( m_pWebView ) + { + m_pWebView->GetHost ()->SetFocus ( true ); + m_pWebView->GetHost ()->SendFocusEvent ( true ); + } + g_pCore->GetWebCore()->SetFocusedWebView ( this ); +} + +void CWebView::ClearTexture () +{ + IDirect3DSurface9* pD3DSurface = m_pWebBrowserRenderItem->m_pD3DRenderTargetSurface; + if ( !pD3DSurface ) + return; + + D3DLOCKED_RECT LockedRect; + D3DSURFACE_DESC SurfaceDesc; + + pD3DSurface->GetDesc ( &SurfaceDesc ); + pD3DSurface->LockRect ( &LockedRect, NULL, 0 ); + + memset ( LockedRect.pBits, 0xFF, SurfaceDesc.Width * SurfaceDesc.Height * 4 ); + pD3DSurface->UnlockRect(); +} + +void CWebView::ExecuteJavascript ( const SString& strJavascriptCode ) +{ + if ( m_pWebView ) + m_pWebView->GetMainFrame ()->ExecuteJavaScript ( strJavascriptCode, "", 0 ); +} + +void CWebView::InjectMouseMove ( int iPosX, int iPosY ) +{ + if ( !m_pWebView ) + return; + + CefMouseEvent mouseEvent; + mouseEvent.x = iPosX; + mouseEvent.y = iPosY; + m_pWebView->GetHost ()->SendMouseMoveEvent ( mouseEvent, false ); + m_vecMousePosition.x = iPosX; + m_vecMousePosition.y = iPosY; +} + +void CWebView::InjectMouseDown ( eWebBrowserMouseButton mouseButton ) +{ + if ( !m_pWebView ) + return; + + CefMouseEvent mouseEvent; + mouseEvent.x = m_vecMousePosition.x; + mouseEvent.y = m_vecMousePosition.y; + + m_pWebView->GetHost ()->SendMouseClickEvent ( mouseEvent, static_cast < CefBrowserHost::MouseButtonType > ( mouseButton ), false, 1 ); +} + +void CWebView::InjectMouseUp ( eWebBrowserMouseButton mouseButton ) +{ + if ( !m_pWebView ) + return; + + CefMouseEvent mouseEvent; + mouseEvent.x = m_vecMousePosition.x; + mouseEvent.y = m_vecMousePosition.y; + + m_pWebView->GetHost ()->SendMouseClickEvent ( mouseEvent, static_cast < CefBrowserHost::MouseButtonType > ( mouseButton ), true, 1 ); +} + +void CWebView::InjectMouseWheel ( int iScrollVert, int iScrollHorz ) +{ + if ( !m_pWebView ) + return; + + CefMouseEvent mouseEvent; + mouseEvent.x = m_vecMousePosition.x; + mouseEvent.y = m_vecMousePosition.y; + + m_pWebView->GetHost ()->SendMouseWheelEvent ( mouseEvent, iScrollHorz, iScrollVert ); +} + +void CWebView::InjectKeyboardEvent ( const CefKeyEvent& keyEvent ) +{ + if ( m_pWebView ) + m_pWebView->GetHost ()->SendKeyEvent ( keyEvent ); +} + +bool CWebView::SetAudioVolume ( float fVolume ) +{ + if ( !m_pWebView || fVolume < 0.0f || fVolume > 1.0f ) + return false; + + // Since the necessary interfaces of the core audio API were introduced in Win7, we've to fallback to HTML5 audio + SString strJSCode ( "var tags = document.getElementsByTagName('audio'); for (var i=0; iGetMainFrame ()->ExecuteJavaScript ( strJSCode, "", 0 ); + return true; +} + +bool CWebView::GetFullPathFromLocal ( SString& strPath ) +{ + return m_pEventsInterface->Events_OnResourcePathCheck ( strPath ); +} + + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefClient::OnProcessMessageReceived // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefClient.html#OnProcessMessageReceived(CefRefPtr%3CCefBrowser%3E,CefProcessId,CefRefPtr%3CCefProcessMessage%3E) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnProcessMessageReceived ( CefRefPtr browser, CefProcessId source_process, CefRefPtr message ) +{ + CefRefPtr argList = message->GetArgumentList (); + if ( message->GetName () == "TriggerLuaEvent" || message->GetName () == "TriggerServerLuaEvent" ) + { + // Get event name + CefString eventName = argList->GetString ( 0 ); + + // Get number of arguments from IPC process message + int numArgs = argList->GetInt ( 1 ); + + // Get args + std::vector args; + for ( int i = 2; i < numArgs + 2; ++i ) + { + args.push_back ( argList->GetString ( i ) ); + } + + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnTriggerEvent, m_pEventsInterface, SString ( eventName ), args, message->GetName () == "TriggerServerLuaEvent" ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnProcessMessageReceived1" ); + + // The message was handled + return true; + } + if ( message->GetName () == "InputFocus" ) + { + // Retrieve arguments from process message + bool gainedFocus = argList->GetBool ( 0 ); + + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnInputFocusChanged, m_pEventsInterface, gainedFocus ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnProcessMessageReceived2" ); + } + + // The message wasn't handled + return false; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefRenderHandler::GetViewRect // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderHandler.html#GetViewRect(CefRefPtr%3CCefBrowser%3E,CefRect&) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::GetViewRect ( CefRefPtr browser, CefRect& rect ) +{ + if ( m_bBeingDestroyed ) + return false; + + IDirect3DSurface9* pD3DSurface = m_pWebBrowserRenderItem->m_pD3DRenderTargetSurface; + if ( !pD3DSurface ) + return false; + + D3DSURFACE_DESC SurfaceDesc; + pD3DSurface->GetDesc ( &SurfaceDesc ); + + rect.x = 0; + rect.y = 0; + rect.width = SurfaceDesc.Width; + rect.height = SurfaceDesc.Height; + return true; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefRenderHandler::OnPaint // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderHandler.html#OnPaint(CefRefPtr%3CCefBrowser%3E,PaintElementType,constRectList&,constvoid*,int,int) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnPaint ( CefRefPtr browser, CefRenderHandler::PaintElementType paintType, const CefRenderHandler::RectList& dirtyRects, const void* buffer, int width, int height ) +{ + if ( m_bBeingDestroyed ) + return; + + IDirect3DSurface9* pD3DSurface = m_pWebBrowserRenderItem->m_pD3DRenderTargetSurface; + if ( !pD3DSurface ) + return; + + /* + DirectX9 is not thread safe, so locking the texture from another thread causes D3DDevice::Present to block forever (-> client freeze) + The only way we can get rid of this problem is (imo) locking CEF until the texture has been written (unlocking/notifying is done in CWebCore::DoEventQueuePulse). + If someone knows a better solution than this weird construction, feel free to contact me (Jusonex). + */ + + auto f = [&]() { + if ( m_bBeingDestroyed ) + return; + + D3DLOCKED_RECT LockedRect; + D3DSURFACE_DESC SurfaceDesc; + + pD3DSurface->GetDesc ( &SurfaceDesc ); + pD3DSurface->LockRect ( &LockedRect, NULL, 0 ); + + // Dirty rect implementation, don't use this as loops are significantly slower than memcpy + /*auto surfaceData = (int*)LockedRect.pBits; + auto sourceData = (const int*)buffer; + auto pitch = LockedRect.Pitch; + + for (auto& rect : dirtyRects) + { + for (int y = rect.y; y < rect.y+rect.height; ++y) + { + for (int x = rect.x; x < rect.x+rect.width; ++x) + { + int index = y * pitch / 4 + x; + surfaceData[index] = sourceData[index]; + } + } + }*/ + + // Copy entire texture + memcpy ( LockedRect.pBits, buffer, width * height * 4 ); + + pD3DSurface->UnlockRect (); + }; + g_pCore->GetWebCore ()->AddEventToEventQueue ( f, this, "OnPaint" ); + + std::unique_lock lock ( m_PaintMutex ); + m_PaintCV.wait ( lock ); +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefRenderHandler::OnCursorChange // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRenderHandler.html#OnCursorChange(CefRefPtr%3CCefBrowser%3E,CefCursorHandle) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnCursorChange ( CefRefPtr browser, CefCursorHandle cursor, CursorType type, const CefCursorInfo& cursorInfo ) +{ + // Find the cursor index by the cursor handle + unsigned char cursorIndex = static_cast < unsigned char > ( type ); + + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnChangeCursor, m_pEventsInterface, cursorIndex ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnCursorChange" ); +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefLoadHandler::OnLoadStart // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefLoadHandler.html#OnLoadStart(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnLoadStart ( CefRefPtr browser, CefRefPtr frame ) +{ + SString strURL; + ConvertURL ( frame->GetURL (), strURL ); + + if ( strURL == "blank" ) + return; + + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnNavigate, m_pEventsInterface, strURL, frame->IsMain () ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnLoadStart" ); +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefLoadHandler::OnLoadEnd // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefLoadHandler.html#OnLoadEnd(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,int) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnLoadEnd ( CefRefPtr browser, CefRefPtr frame, int httpStatusCode ) +{ + if ( frame->IsMain () ) + { + SString strURL; + ConvertURL ( frame->GetURL (), strURL ); + + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnDocumentReady, m_pEventsInterface, strURL ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnLoadEnd" ); + } +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefLoadHandler::OnLoadError // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefLoadHandler.html#OnLoadError(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,ErrorCode,constCefString&,constCefString&) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnLoadError ( CefRefPtr browser, CefRefPtr frame, CefLoadHandler::ErrorCode errorCode, const CefString& errorText, const CefString& failedURL ) +{ + SString strURL; + ConvertURL ( failedURL, strURL ); + + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnLoadingFailed, m_pEventsInterface, strURL, errorCode, SString ( errorText ) ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnLoadError" ); +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefRequestHandler::OnBeforeBrowe // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRequestHandler.html#OnBeforeBrowse(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefRequest%3E,bool) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnBeforeBrowse ( CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool isRedirect ) +{ + /* + From documentation: + The |request| object cannot be modified in this callback. + CefLoadHandler::OnLoadingStateChange will be called twice in all cases. If the navigation is allowed CefLoadHandler::OnLoadStart and CefLoadHandler::OnLoadEnd will be called. + If the navigation is canceled CefLoadHandler::OnLoadError will be called with an |errorCode| value of ERR_ABORTED. + */ + + CefURLParts urlParts; + if ( !CefParseURL ( request->GetURL(), urlParts ) ) + return true; // Cancel if invalid URL (this line will normally not be executed) + + WString scheme = urlParts.scheme.str; + if ( scheme == L"http" || scheme == L"https" ) + { + if ( IsLocal () ) + return true; // Block remote here requests generally + + if ( g_pCore->GetWebCore ()->GetURLState ( UTF16ToMbUTF8 ( urlParts.host.str ) ) != eURLState::WEBPAGE_ALLOWED ) + return true; + + return false; + } + else if ( scheme == L"mtalocal" ) + return false; + + // Block everything else + return true; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefRequestHandler::OnBeforeResourceLoad // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefRequestHandler.html#OnBeforeResourceLoad(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,CefRefPtr%3CCefRequest%3E) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnBeforeResourceLoad ( CefRefPtr browser, CefRefPtr frame, CefRefPtr request ) +{ + // Mostly the same as CWebView::OnBeforeBrowse + CefURLParts urlParts; + if ( !CefParseURL ( request->GetURL (), urlParts ) ) + return true; // Cancel if invalid URL (this line will normally not be executed) + + WString scheme = urlParts.scheme.str; + if ( scheme == L"http" || scheme == L"https" ) + { + if ( IsLocal () ) + return true; // Block remote requests in local mode generally + + if ( g_pCore->GetWebCore ()->GetURLState ( UTF16ToMbUTF8 ( urlParts.host.str ) ) != eURLState::WEBPAGE_ALLOWED ) + return true; // Block if explicitly forbidden + + // Allow + return false; + } + else if ( scheme == L"mtalocal" ) + { + // Allow :) + return false; + } + + // Block everything else + return true; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefLifeSpanHandler::OnBeforeClose // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefLifeSpanHandler.html#OnBeforeClose(CefRefPtr%3CCefBrowser%3E) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnBeforeClose ( CefRefPtr browser ) +{ + // Remove events owned by this webview and invoke left callbacks + g_pCore->GetWebCore ()->RemoveWebViewEvents ( this ); + NotifyPaint (); + + m_pWebView = nullptr; + + // Remove focused web view reference + if ( g_pCore->GetWebCore ()->GetFocusedWebView () == this ) + g_pCore->GetWebCore ()->SetFocusedWebView ( nullptr ); +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefLifeSpanHandler::OnBeforePopup // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefLifeSpanHandler.html#OnBeforePopup(CefRefPtr%3CCefBrowser%3E,CefRefPtr%3CCefFrame%3E,constCefString&,constCefString&,constCefPopupFeatures&,CefWindowInfo&,CefRefPtr%3CCefClient%3E&,CefBrowserSettings&,bool*) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnBeforePopup ( CefRefPtr browser, CefRefPtr frame, const CefString& target_url, const CefString& target_frame_name, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr& client, CefBrowserSettings& settings, bool* no_javascript_access ) +{ + // ATTENTION: This method is called on the IO thread + + // Trigger the popup/new tab event + SString strTagetURL, strOpenerURL; + ConvertURL ( target_url, strTagetURL ); + ConvertURL ( frame->GetURL (), strOpenerURL ); + + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnPopup, m_pEventsInterface, strTagetURL, strOpenerURL ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnBeforePopup" ); + + // Block popups generally + return true; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefLifeSpanHandler::OnAfterCreated // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefLifeSpanHandler.html#OnAfterCreated(CefRefPtr) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnAfterCreated ( CefRefPtr browser ) +{ + // Set web view reference + m_pWebView = browser; + + // Call created event callback + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnCreated, m_pEventsInterface ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnAfterCreated" ); +} + + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefJSDialogHandler::OnJSDialog // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefJSDialogHandler.html#OnJSDialog(CefRefPtr%3CCefBrowser%3E,constCefString&,constCefString&,JSDialogType,constCefString&,constCefString&,CefRefPtr%3CCefJSDialogCallback%3E,bool&) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnJSDialog ( CefRefPtr browser, const CefString& origin_url, const CefString& accept_lang, CefJSDialogHandler::JSDialogType dialog_type, const CefString& message_text, const CefString& default_prompt_text, CefRefPtr< CefJSDialogCallback > callback, bool& suppress_message ) +{ + // TODO: Provide a way to influence Javascript dialogs via Lua + // e.g. addEventHandler("onClientBrowserDialog", browser, function(message, defaultText) continueBrowserDialog("My input") end) + + // Suppress the dialog + suppress_message = true; + return false; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefDialogHandler::OnFileDialog // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefDialogHandler.html#OnFileDialog(CefRefPtr%3CCefBrowser%3E,FileDialogMode,constCefString&,constCefString&,conststd::vector%3CCefString%3E&,CefRefPtr%3CCefFileDialogCallback%3E) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnFileDialog ( CefRefPtr browser, CefDialogHandler::FileDialogMode mode, const CefString& title, const CefString& default_file_name, const std::vector< CefString >& accept_types, CefRefPtr< CefFileDialogCallback > callback ) +{ + // Don't show the dialog + return true; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefDisplayHandler::OnTitleChange // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefDisplayHandler.html#OnTitleChange(CefRefPtr%3CCefBrowser%3E,constCefString&) // +// // +//////////////////////////////////////////////////////////////////// +void CWebView::OnTitleChange ( CefRefPtr browser, const CefString& title ) +{ + m_CurrentTitle = UTF16ToMbUTF8 ( title ); +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefDisplayHandler::OnTooltip // +// http://magpcss.org/ceforum/apidocs3/projects/(default)/CefDisplayHandler.html#OnTooltip(CefRefPtr%3CCefBrowser%3E,CefString&) // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnTooltip ( CefRefPtr browser, CefString& title ) +{ + // Queue event to run on the main thread + auto func = std::bind ( &CWebBrowserEventsInterface::Events_OnTooltip, m_pEventsInterface, UTF16ToMbUTF8 ( title ) ); + g_pCore->GetWebCore ()->AddEventToEventQueue ( func, this, "OnTooltip" ); + + return true; +} + +//////////////////////////////////////////////////////////////////// +// // +// Implementation: CefDisplayHandler::OnConsoleMessage // +// http://magpcss.org/ceforum/apidocs/projects/%28default%29/CefDisplayHandler.html#OnConsoleMessage%28CefRefPtr%3CCefBrowser%3E,constCefString&,constCefString&,int%29 // +// // +//////////////////////////////////////////////////////////////////// +bool CWebView::OnConsoleMessage ( CefRefPtr browser, const CefString& message, const CefString& source, int line ) +{ + // Redirect console message to debug window (if development mode is enabled) + if ( g_pCore->GetWebCore ()->IsTestModeEnabled () ) + { + g_pCore->DebugPrintfColor ( "[BROWSER] Console: %s (%s)", 255, 0, 0, UTF16ToMbUTF8 ( message ).c_str (), UTF16ToMbUTF8 ( source ).c_str () ); + } + + return true; +} + + +void CWebView::ConvertURL ( const CefString& url, SString& convertedURL ) +{ + CefURLParts urlParts; + if ( !CefParseURL ( url, urlParts ) ) + { + convertedURL = ""; + return; + } + WString scheme = urlParts.scheme.str; + + if ( scheme == L"http" || scheme == L"https" ) + { + convertedURL = UTF16ToMbUTF8 ( urlParts.spec.str ); + } + else + { + // Get the file name (charsequence after last /) + WString tempStr = urlParts.path.str; + size_t pos = tempStr.find_last_of ( L"/" ); + + if ( pos != std::wstring::npos && pos < tempStr.size () ) + convertedURL = UTF16ToMbUTF8 ( tempStr.SubStr ( pos + 1 ) ); + else + convertedURL = ""; + } +} diff --git a/MTA10/core/CWebView.h b/MTA10/core/CWebView.h new file mode 100644 index 00000000000..76171823d82 --- /dev/null +++ b/MTA10/core/CWebView.h @@ -0,0 +1,131 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: core/CWebView.h +* PURPOSE: Web view class +* +*****************************************************************************/ + +#ifndef __CWEBVIEW_H +#define __CWEBVIEW_H + +#undef GetNextSibling +#undef GetFirstChild +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#define GetNextSibling(hwnd) GetWindow(hwnd, GW_HWNDNEXT) // Re-define the conflicting macro +#define GetFirstChild(hwnd) GetTopWindow(hwnd) + +class CWebView : public CWebViewInterface, private CefClient, private CefRenderHandler, private CefLoadHandler, private CefRequestHandler, private CefLifeSpanHandler, private CefJSDialogHandler, private CefDialogHandler, private CefDisplayHandler +{ +public: + CWebView ( unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent = false ); + virtual ~CWebView (); + void Initialise (); + void SetWebBrowserEvents ( CWebBrowserEventsInterface* pInterface ) { m_pEventsInterface = pInterface; }; + void CloseBrowser (); + inline CefRefPtrGetCefBrowser() { return m_pWebView; }; + + inline bool IsBeingDestroyed () { return m_bBeingDestroyed; } + void SetBeingDestroyed ( bool state ) { m_bBeingDestroyed = state; } + + // Exported methods + bool LoadURL ( const SString& strURL, bool bFilterEnabled = true ); + bool IsLoading (); + void GetURL ( SString& outURL ); + void GetTitle ( SString& outTitle ); + void SetRenderingPaused ( bool bPaused ); + void Focus (); + void ClearTexture (); + inline void NotifyPaint () { m_PaintCV.notify_one (); } + + void ExecuteJavascript ( const SString& strJavascriptCode ); + + void InjectMouseMove ( int iPosX, int iPosY ); + void InjectMouseDown ( eWebBrowserMouseButton mouseButton ); + void InjectMouseUp ( eWebBrowserMouseButton mouseButton ); + void InjectMouseWheel ( int iScrollVert, int iScrollHorz ); + void InjectKeyboardEvent ( const CefKeyEvent& keyEvent ); + + bool IsLocal () { return m_bIsLocal; }; + void SetTempURL ( const SString& strTempURL ) { m_strTempURL = strTempURL; }; + + bool SetAudioVolume ( float fVolume ); + + bool GetFullPathFromLocal ( SString& strPath ); + + // CefClient methods + virtual CefRefPtr GetRenderHandler() override { return this; }; + virtual CefRefPtr GetLoadHandler() override { return this; }; + virtual CefRefPtr GetRequestHandler() override { return this; }; + virtual CefRefPtr GetLifeSpanHandler() override { return this; }; + virtual CefRefPtr GetJSDialogHandler() override { return this; }; + virtual CefRefPtr GetDialogHandler() override { return this; }; + virtual CefRefPtr GetDisplayHandler() override { return this; }; + virtual bool OnProcessMessageReceived ( CefRefPtr browser, CefProcessId source_process, CefRefPtr message ) override; + + // CefRenderHandler methods + virtual bool GetViewRect ( CefRefPtr browser, CefRect& rect ) override; + virtual void OnPaint ( CefRefPtr browser, CefRenderHandler::PaintElementType paintType, const CefRenderHandler::RectList& dirtyRects, const void* buffer, int width, int height ) override; + virtual void OnCursorChange ( CefRefPtr browser, CefCursorHandle cursor, CursorType type, const CefCursorInfo& cursorInfo ) override; + + // CefLoadHandler methods + virtual void OnLoadStart ( CefRefPtr browser, CefRefPtr frame ) override; + virtual void OnLoadEnd ( CefRefPtr browser, CefRefPtr frame, int httpStatusCode ) override; + virtual void OnLoadError ( CefRefPtr browser, CefRefPtr frame, CefLoadHandler::ErrorCode errorCode, const CefString& errorText, const CefString& failedURL ) override; + + // CefRequestHandler methods + virtual bool OnBeforeBrowse ( CefRefPtr browser, CefRefPtr frame, CefRefPtr request, bool isRedirect ) override; + virtual bool OnBeforeResourceLoad ( CefRefPtr browser, CefRefPtr frame, CefRefPtr request ) override; + + // CefLifeSpawnHandler methods + virtual void OnBeforeClose ( CefRefPtr browser ) override; + virtual bool OnBeforePopup ( CefRefPtr browser, CefRefPtr frame, const CefString& target_url, const CefString& target_frame_name, const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, CefRefPtr& client, CefBrowserSettings& settings, bool* no_javascript_access ) override; + virtual void OnAfterCreated ( CefRefPtr browser) override; + + // CefJSDialogHandler methods + virtual bool OnJSDialog ( CefRefPtr browser, const CefString& origin_url, const CefString& accept_lang, CefJSDialogHandler::JSDialogType dialog_type, const CefString& message_text, const CefString& default_prompt_text, CefRefPtr< CefJSDialogCallback > callback, bool& suppress_message ) override; + + // CefDialogHandler methods + virtual bool OnFileDialog ( CefRefPtr browser, CefDialogHandler::FileDialogMode mode, const CefString& title, const CefString& default_file_name, const std::vector< CefString >& accept_types, CefRefPtr< CefFileDialogCallback > callback ) override; + + // CefDisplayHandler methods + virtual void OnTitleChange ( CefRefPtr browser, const CefString& title ) override; + virtual bool OnTooltip ( CefRefPtr browser, CefString& text ) override; + virtual bool OnConsoleMessage ( CefRefPtr browser, const CefString& message, const CefString& source, int line ) override; + +protected: + void ConvertURL ( const CefString& url, SString& convertedURL ); + +private: + CefRefPtr m_pWebView; + CWebBrowserItem* m_pWebBrowserRenderItem; + + bool m_bBeingDestroyed; + bool m_bIsLocal; + bool m_bIsTransparent; + SString m_strTempURL; + POINT m_vecMousePosition; + SString m_CurrentTitle; + std::mutex m_PaintMutex; + std::condition_variable m_PaintCV; + + CWebBrowserEventsInterface* m_pEventsInterface; + +public: + // Implement smartpointer methods (all Cef-classes require that since they are derived from CefBase) + IMPLEMENT_REFCOUNTING(CWebView); +}; + +#endif diff --git a/MTA10/core/CWebsiteRequests.cpp b/MTA10/core/CWebsiteRequests.cpp new file mode 100644 index 00000000000..829fd49303f --- /dev/null +++ b/MTA10/core/CWebsiteRequests.cpp @@ -0,0 +1,105 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: core/CWebsiteRequests.cpp +* PURPOSE: Website requests GUI class +* +*****************************************************************************/ + +#include "StdInc.h" +#include "CWebsiteRequests.h" + +CWebsiteRequests::CWebsiteRequests() +{ + CGUI* pManager = g_pCore->GetGUI (); + CVector2D vecResolution = pManager->GetResolution (); + + m_pWindow = reinterpret_cast < CGUIWindow* > ( pManager->CreateWnd ( NULL, _("Website requests") ) ); + m_pWindow->SetMovable ( true ); + m_pWindow->SetSizingEnabled ( false ); + m_pWindow->SetPosition ( CVector2D ( vecResolution.fX / 2 - WEBSITEREQUESTS_WINDOW_DEFAULTWIDTH / 2, vecResolution.fY / 2 - WEBSITEREQUESTS_WINDOW_DEFAULTHEIGHT / 2), false ); + m_pWindow->SetSize ( CVector2D ( WEBSITEREQUESTS_WINDOW_DEFAULTWIDTH, WEBSITEREQUESTS_WINDOW_DEFAULTHEIGHT) ); + m_pWindow->SetAlwaysOnTop ( true ); + + m_pLabel1 = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( m_pWindow, _("The server requests the following websites in order to load them (later):") ) ); + m_pLabel1->SetPosition ( CVector2D ( 10, 26 ), false ); + m_pLabel1->SetSize ( CVector2D ( 456, 25 ), false ); + m_pLabel1->SetFont ( "default-bold" ); + + m_pLabel2 = reinterpret_cast < CGUILabel* > ( pManager->CreateLabel ( m_pWindow, _("NEVER ENTER SENSITIVE DATA TO PROTECT THEM FROM BEING STOLEN") ) ); + m_pLabel2->SetPosition ( CVector2D ( 10, 45 ), false ); + m_pLabel2->SetSize ( CVector2D ( 456, 25 ), false ); + m_pLabel2->SetFont ( "default-bold" ); + m_pLabel2->SetTextColor ( 255, 0, 0 ); + + m_pAddressMemo = reinterpret_cast < CGUIMemo* > ( pManager->CreateMemo ( m_pWindow, "" ) ); + m_pAddressMemo->SetPosition ( CVector2D ( 10, 71 ), false ); + m_pAddressMemo->SetSize ( CVector2D ( 456, 160 ), false ); + m_pAddressMemo->SetFont ( "default-bold" ); + m_pAddressMemo->SetReadOnly ( true ); + + m_pCheckRemember = reinterpret_cast < CGUICheckBox* > ( pManager->CreateCheckBox ( m_pWindow, "Remember decision" ) ); + m_pCheckRemember->SetPosition ( CVector2D ( 10, 229 ) ); + m_pCheckRemember->SetSize ( CVector2D ( 456, 30 ) ); + m_pCheckRemember->SetFont ( "default-bold" ); + + m_pButtonAllow = reinterpret_cast < CGUIButton* > ( pManager->CreateButton ( m_pWindow, _("Allow") ) ); + m_pButtonAllow->SetPosition ( CVector2D ( 10, 259 ), false ); + m_pButtonAllow->SetSize ( CVector2D ( 204, 28 ), false ); + m_pButtonAllow->SetProperty ( "NormalTextColour", "FF40A62E" ); + m_pButtonAllow->SetClickHandler ( GUI_CALLBACK ( &CWebsiteRequests::OnAllowButtonClick, this ) ); + + m_pButtonDeny = reinterpret_cast < CGUIButton* > ( pManager->CreateButton ( m_pWindow, _("Deny") ) ); + m_pButtonDeny->SetPosition ( CVector2D ( 262, 259 ), false ); + m_pButtonDeny->SetSize ( CVector2D ( 204, 28 ), false ); + m_pButtonDeny->SetProperty ( "NormalTextColour", "FFC4020F"); + m_pButtonDeny->SetClickHandler ( GUI_CALLBACK ( &CWebsiteRequests::OnDenyButtonClick, this ) ); +} + +CWebsiteRequests::~CWebsiteRequests () +{ +} + +void CWebsiteRequests::Show () +{ + m_pWindow->SetVisible ( true ); + m_pWindow->BringToFront (); +} + +void CWebsiteRequests::Hide () +{ + m_pWindow->SetVisible ( false ); +} + +void CWebsiteRequests::SetPendingRequests ( const std::vector& pendingRequests ) +{ + SString content = ""; + for ( std::vector::const_iterator iter = pendingRequests.begin(); iter != pendingRequests.end(); ++iter ) + { + content += *iter + "\n"; + } + + // Apply text + m_pAddressMemo->SetText ( content.c_str() ); +} + +void CWebsiteRequests::Clear () +{ + m_pAddressMemo->SetText (""); +} + +bool CWebsiteRequests::OnAllowButtonClick ( CGUIElement* pElement ) +{ + g_pCore->GetWebCore ()->AllowPendingPages ( m_pCheckRemember->GetSelected () ); + Hide (); + return true; +} + +bool CWebsiteRequests::OnDenyButtonClick ( CGUIElement* pElement ) +{ + g_pCore->GetWebCore ()->DenyPendingPages (); + Hide (); + return true; +} diff --git a/MTA10/core/CWebsiteRequests.h b/MTA10/core/CWebsiteRequests.h new file mode 100644 index 00000000000..da148f75e42 --- /dev/null +++ b/MTA10/core/CWebsiteRequests.h @@ -0,0 +1,48 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: core/CWebsiteRequests.h +* PURPOSE: Website requests GUI class +* +*****************************************************************************/ + +#ifndef __CWEBSITEREQUESTS_H +#define __CWEBSITEREQUESTS_H + +#define WEBSITEREQUESTS_WINDOW_DEFAULTWIDTH 476 +#define WEBSITEREQUESTS_WINDOW_DEFAULTHEIGHT 297 +class CGUIWindow; +class CGUILabel; +class CGUIMemo; +class CGUIButton; + +class CWebsiteRequests +{ +public: + CWebsiteRequests (); + ~CWebsiteRequests (); + + void Show (); + void Hide (); + + void SetPendingRequests ( const std::vector& pendingRequests ); + void Clear (); + +protected: + CGUIWindow* m_pWindow; + CGUILabel* m_pLabel1; + CGUILabel* m_pLabel2; + CGUIMemo* m_pAddressMemo; + CGUICheckBox* m_pCheckRemember; + CGUIButton* m_pButtonAllow; + CGUIButton* m_pButtonDeny; + +private: + bool OnAllowButtonClick(CGUIElement* pElement); + bool OnDenyButtonClick(CGUIElement* pElement); + +}; + +#endif diff --git a/MTA10/core/StdInc.h b/MTA10/core/StdInc.h index 5688404b7a3..fc234bc8c62 100644 --- a/MTA10/core/StdInc.h +++ b/MTA10/core/StdInc.h @@ -32,6 +32,7 @@ #include #include #include +#include // Localization @@ -70,3 +71,4 @@ #include "CMemStats.h" #include "CGraphStats.h" #include "CNickGen.h" +#include "CWebView.h" diff --git a/MTA10/core/WebBrowserHelpers.h b/MTA10/core/WebBrowserHelpers.h new file mode 100644 index 00000000000..baade04b53f --- /dev/null +++ b/MTA10/core/WebBrowserHelpers.h @@ -0,0 +1,101 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: core/WebBrowserHelpers.h +* PURPOSE: Webbrowser helper classes and functions +* +*****************************************************************************/ +#ifndef __WEBBROWSERHELPERS +#define __WEBBROWSERHELPERS +#include +#include + +bool isKeyDown ( WPARAM wParam ) +{ + return (GetKeyState(wParam) & 0x8000) != 0; +} + +int GetCefKeyboardModifiers ( WPARAM wParam, LPARAM lParam ) +{ + int modifiers = 0; + if (isKeyDown(VK_SHIFT)) + modifiers |= EVENTFLAG_SHIFT_DOWN; + if (isKeyDown(VK_CONTROL)) + modifiers |= EVENTFLAG_CONTROL_DOWN; + if (isKeyDown(VK_MENU)) + modifiers |= EVENTFLAG_ALT_DOWN; + + // Low bit set from GetKeyState indicates "toggled". + if (::GetKeyState(VK_NUMLOCK) & 1) + modifiers |= EVENTFLAG_NUM_LOCK_ON; + if (::GetKeyState(VK_CAPITAL) & 1) + modifiers |= EVENTFLAG_CAPS_LOCK_ON; + + switch (wParam) { + case VK_RETURN: + if ((lParam >> 16) & KF_EXTENDED) + modifiers |= EVENTFLAG_IS_KEY_PAD; + break; + case VK_INSERT: + case VK_DELETE: + case VK_HOME: + case VK_END: + case VK_PRIOR: + case VK_NEXT: + case VK_UP: + case VK_DOWN: + case VK_LEFT: + case VK_RIGHT: + if (!((lParam >> 16) & KF_EXTENDED)) + modifiers |= EVENTFLAG_IS_KEY_PAD; + break; + case VK_NUMLOCK: + case VK_NUMPAD0: + case VK_NUMPAD1: + case VK_NUMPAD2: + case VK_NUMPAD3: + case VK_NUMPAD4: + case VK_NUMPAD5: + case VK_NUMPAD6: + case VK_NUMPAD7: + case VK_NUMPAD8: + case VK_NUMPAD9: + case VK_DIVIDE: + case VK_MULTIPLY: + case VK_SUBTRACT: + case VK_ADD: + case VK_DECIMAL: + case VK_CLEAR: + modifiers |= EVENTFLAG_IS_KEY_PAD; + break; + case VK_SHIFT: + if (isKeyDown(VK_LSHIFT)) + modifiers |= EVENTFLAG_IS_LEFT; + else if (isKeyDown(VK_RSHIFT)) + modifiers |= EVENTFLAG_IS_RIGHT; + break; + case VK_CONTROL: + if (isKeyDown(VK_LCONTROL)) + modifiers |= EVENTFLAG_IS_LEFT; + else if (isKeyDown(VK_RCONTROL)) + modifiers |= EVENTFLAG_IS_RIGHT; + break; + case VK_MENU: + if (isKeyDown(VK_LMENU)) + modifiers |= EVENTFLAG_IS_LEFT; + else if (isKeyDown(VK_RMENU)) + modifiers |= EVENTFLAG_IS_RIGHT; + break; + case VK_LWIN: + modifiers |= EVENTFLAG_IS_LEFT; + break; + case VK_RWIN: + modifiers |= EVENTFLAG_IS_RIGHT; + break; + } + return modifiers; +} + +#endif diff --git a/MTA10/core/_Core 2008.vcproj b/MTA10/core/_Core 2008.vcproj index 9626276b63d..1c8491ca30f 100644 --- a/MTA10/core/_Core 2008.vcproj +++ b/MTA10/core/_Core 2008.vcproj @@ -45,7 +45,7 @@ + + @@ -718,6 +722,18 @@ RelativePath=".\CVideoModeManager.cpp" > + + + + + + @@ -1343,6 +1359,18 @@ RelativePath=".\CVideoModeManager.h" > + + + + + + @@ -1351,6 +1379,10 @@ RelativePath=".\StdInc.h" > + + @@ -1469,6 +1501,10 @@ RelativePath="..\sdk\core\CSetCursorPosHookInterface.h" > + + DynamicLibrary - v120 false MultiByte true + v120_xp DynamicLibrary - v120 false MultiByte true + v120_xp DynamicLibrary false MultiByte - v120 + v120_xp @@ -75,7 +75,7 @@ core - $(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\output\MTA San Andreas\mta\ false core @@ -86,7 +86,7 @@ Disabled - .;../../vendor;../sdk;../../Shared/sdk;../../vendor/sparsehash/current/src;../../vendor/sparsehash/current/src/windows;../../vendor/pthreads/include;../../vendor/jpeg/jpeg-8d;../../vendor/zlib;../../vendor/tinygettext;%(AdditionalIncludeDirectories) + .;../../vendor;../sdk;../../Shared/sdk;../../vendor/sparsehash/current/src;../../vendor/sparsehash/current/src/windows;../../vendor/pthreads/include;../../vendor/jpeg/jpeg-8d;../../vendor/zlib;../../vendor/tinygettext;../../vendor/cef3/;%(AdditionalIncludeDirectories) _WIN32_WINNT=0x502;WIN32;MTA_DEBUG;_CRT_SECURE_NO_WARNINGS;INITGUID;PNG_SETJMP_NOT_SUPPORTED;%(PreprocessorDefinitions) true EnableFastChecks @@ -110,10 +110,10 @@ 0x0409 - strmiids.lib;libv2.lib;zlib_d.lib;libpng_d.lib;odbc32.lib;odbccp32.lib;dinput8.lib;dxguid.lib;shlwapi.lib;d3dx9.lib;winmm.lib;Imagehlp.lib;ws2_32.lib;gdi32.lib;Userenv.lib;Imm32.lib;pthread_d.lib;jpeg_d.lib;Psapi.lib;xinput9_1_0.lib;%(AdditionalDependencies) + strmiids.lib;libv2.lib;zlib_d.lib;libpng_d.lib;odbc32.lib;odbccp32.lib;dinput8.lib;dxguid.lib;shlwapi.lib;d3dx9.lib;winmm.lib;Imagehlp.lib;ws2_32.lib;gdi32.lib;Userenv.lib;Imm32.lib;pthread_d.lib;jpeg_d.lib;Psapi.lib;xinput.lib;libcef.lib;..\..\vendor\cef3\out\Debug\lib\libcef_dll_wrapper.lib;%(AdditionalDependencies) NotSet true - ../../Shared/XML;../../vendor/libv2/lib;../../vendor/libpng/$(PlatformTarget)/$(Configuration);../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../vendor/detours/lib;../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../vendor/jpeg/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + ../../Shared/XML;../../vendor/libv2/lib;../../vendor/libpng/$(PlatformTarget)/$(Configuration);../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../vendor/detours/lib;../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../vendor/jpeg/$(PlatformTarget)/$(Configuration);../../vendor/cef3/Debug;%(AdditionalLibraryDirectories) true $(IntDir)$(TargetName).pdb @@ -135,7 +135,7 @@ true Speed true - .;../../vendor;../sdk;../../Shared/sdk;../../vendor/sparsehash/current/src;../../vendor/sparsehash/current/src/windows;../../vendor/pthreads/include;../../vendor/jpeg/jpeg-8d;../../vendor/zlib;../../vendor/tinygettext;%(AdditionalIncludeDirectories) + .;../../vendor;../sdk;../../Shared/sdk;../../vendor/sparsehash/current/src;../../vendor/sparsehash/current/src/windows;../../vendor/pthreads/include;../../vendor/jpeg/jpeg-8d;../../vendor/zlib;../../vendor/tinygettext;../../vendor/cef3/;%(AdditionalIncludeDirectories) _WIN32_WINNT=0x502;WIN32;_CRT_SECURE_NO_WARNINGS;INITGUID;PNG_SETJMP_NOT_SUPPORTED;%(PreprocessorDefinitions) true MultiThreadedDLL @@ -154,12 +154,12 @@ 0x0409 - strmiids.lib;libv2.lib;zlib.lib;libpng.lib;odbc32.lib;odbccp32.lib;dinput8.lib;dxguid.lib;shlwapi.lib;d3dx9.lib;wsock32.lib;winmm.lib;Imagehlp.lib;gdi32.lib;Userenv.lib;Imm32.lib;pthread.lib;jpeg.lib;Psapi.lib;xinput9_1_0.lib;%(AdditionalDependencies) + strmiids.lib;libv2.lib;zlib.lib;libpng.lib;odbc32.lib;odbccp32.lib;dinput8.lib;dxguid.lib;shlwapi.lib;d3dx9.lib;wsock32.lib;winmm.lib;Imagehlp.lib;gdi32.lib;Userenv.lib;Imm32.lib;pthread.lib;jpeg.lib;Psapi.lib;xinput.lib;libcef.lib;..\..\vendor\cef3\out\Release\lib\libcef_dll_wrapper.lib;%(AdditionalDependencies) true - ../../Shared/XML;../../vendor/libv2/lib;../../vendor/libpng/$(PlatformTarget)/$(Configuration);../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../vendor/detours/lib;../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../vendor/jpeg/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + ../../Shared/XML;../../vendor/libv2/lib;../../vendor/libpng/$(PlatformTarget)/$(Configuration);../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../vendor/detours/lib;../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../vendor/jpeg/$(PlatformTarget)/$(Configuration);../../vendor/cef3/Release;%(AdditionalLibraryDirectories) LIBCMT;%(IgnoreSpecificDefaultLibraries) true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)/../symbols/$(Configuration)_$(SafeParentName).pdb true true @@ -181,7 +181,7 @@ true Speed true - .;../../vendor;../sdk;../../Shared/sdk;../../vendor/sparsehash/current/src;../../vendor/sparsehash/current/src/windows;../../vendor/pthreads/include;../../vendor/jpeg/jpeg-8d;../../vendor/zlib;../../vendor/tinygettext;%(AdditionalIncludeDirectories) + .;../../vendor;../sdk;../../Shared/sdk;../../vendor/sparsehash/current/src;../../vendor/sparsehash/current/src/windows;../../vendor/pthreads/include;../../vendor/jpeg/jpeg-8d;../../vendor/zlib;../../vendor/tinygettext;../../vendor/cef3/;%(AdditionalIncludeDirectories) _WIN32_WINNT=0x502;WIN32;_CRT_SECURE_NO_WARNINGS;INITGUID;PNG_SETJMP_NOT_SUPPORTED;%(PreprocessorDefinitions) true MultiThreadedDLL @@ -200,12 +200,12 @@ 0x0409 - strmiids.lib;libv2.lib;zlib.lib;libpng.lib;odbc32.lib;odbccp32.lib;dinput8.lib;dxguid.lib;shlwapi.lib;d3dx9.lib;wsock32.lib;winmm.lib;Imagehlp.lib;gdi32.lib;Userenv.lib;Imm32.lib;pthread.lib;jpeg.lib;Psapi.lib;xinput9_1_0.lib;%(AdditionalDependencies) + strmiids.lib;libv2.lib;zlib.lib;libpng.lib;odbc32.lib;odbccp32.lib;dinput8.lib;dxguid.lib;shlwapi.lib;d3dx9.lib;wsock32.lib;winmm.lib;Imagehlp.lib;gdi32.lib;Userenv.lib;Imm32.lib;pthread.lib;jpeg.lib;Psapi.lib;xinput.lib;libcef.lib;libcef_dll_wrapper.lib;%(AdditionalDependencies) true - ../../Shared/XML;../../vendor/libv2/lib;../../vendor/libpng/$(PlatformTarget)/$(Configuration);../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../vendor/detours/lib;../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../vendor/jpeg/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)..\vendor/libv2\lib;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\libpng;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\zlib;$(SolutionDir)..\vendor\detours\lib;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pthread;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\jpeg;$(SolutionDir)..\vendor\cef3\Release\;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\libcef_dll_wrapper\lib;%(AdditionalLibraryDirectories) LIBCMT;%(IgnoreSpecificDefaultLibraries) true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb true true @@ -301,6 +301,7 @@ + @@ -317,6 +318,9 @@ + + + Create @@ -394,6 +398,9 @@ + + + @@ -477,8 +484,12 @@ + + + + diff --git a/MTA10/core/_Core 2008.vcxproj.filters b/MTA10/core/_Core 2008.vcxproj.filters index 2dff9b39000..02dd8523fc3 100644 --- a/MTA10/core/_Core 2008.vcxproj.filters +++ b/MTA10/core/_Core 2008.vcxproj.filters @@ -374,6 +374,18 @@ Source Files\utils\tinygettext + + Source Files + + + Source Files + + + Source Files + + + Source Files + @@ -1285,5 +1297,26 @@ Header Files\utils\tinygettext + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files\sdk\core + + + Header Files\sdk\core + + + Header Files\sdk\core + \ No newline at end of file diff --git a/MTA10/game_sa/CPointLightsSA.cpp b/MTA10/game_sa/CPointLightsSA.cpp index 2d98e829dc5..bf225c8a9e9 100644 --- a/MTA10/game_sa/CPointLightsSA.cpp +++ b/MTA10/game_sa/CPointLightsSA.cpp @@ -3,7 +3,7 @@ * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: game_sa/CPointLightsSA.cpp -* PURPOSE: Point lights class +* PURPOSE: PointLights entity * DEVELOPERS: Jax <> * * Multi Theft Auto is available from http://www.multitheftauto.com/ @@ -12,29 +12,30 @@ #include "StdInc.h" -void CPointLightsSA::AddLight ( unsigned char ucType, CVector vec_2, CVector vec_3, float fRed, float fGreen, float fBlue, float f_7, unsigned char uc_8, bool bCreatesShadow, CEntity * pEntity ) +void CPointLightsSA::AddLight ( int iMode, const CVector vecPosition, CVector vecDirection, float fRadius, SColor color, unsigned char uc_8, bool bCreatesShadow, CEntity * pAffected ) { DWORD dwEntityInterface = 0; - if ( pEntity ) dwEntityInterface = ( DWORD ) pEntity->GetInterface (); + if ( pAffected ) dwEntityInterface = ( DWORD ) pAffected->GetInterface (); DWORD dwFunc = FUNC_CPointLights_AddLight; - float f_3x = vec_3.fX, f_3y = vec_3.fY, f_3z = vec_3.fZ; - float f_2x = vec_2.fX, f_2y = vec_2.fY, f_2z = vec_2.fZ; + float fPosX = vecPosition.fX, fPosY = vecPosition.fY, fPosZ = vecPosition.fZ; + float fDirX = vecDirection.fX, fDirY = vecDirection.fY, fDirZ = vecDirection.fZ; + float fRed = (float)color.R / 255, fGreen = (float)color.G / 255, fBlue = (float)color.B / 255; _asm { push dwEntityInterface push bCreatesShadow push uc_8 - push f_7 push fBlue push fGreen push fRed - push f_3z - push f_3y - push f_3x - push f_2z - push f_2y - push f_2x - push ucType + push fRadius + push fDirZ + push fDirY + push fDirX + push fPosZ + push fPosY + push fPosX + push iMode call dwFunc add esp, 56 } diff --git a/MTA10/game_sa/CPointLightsSA.h b/MTA10/game_sa/CPointLightsSA.h index 2bda3068ea9..aa3f4d4c359 100644 --- a/MTA10/game_sa/CPointLightsSA.h +++ b/MTA10/game_sa/CPointLightsSA.h @@ -3,15 +3,15 @@ * PROJECT: Multi Theft Auto v1.0 * LICENSE: See LICENSE in the top level directory * FILE: game_sa/CPointLightsSA.h -* PURPOSE: Point lights class header +* PURPOSE: Header file for PointLights entity class * DEVELOPERS: Jax <> * * Multi Theft Auto is available from http://www.multitheftauto.com/ * *****************************************************************************/ -#ifndef __CPointLightsSA_H -#define __CPointLightsSA_H +#ifndef __CGAMESA_POINTLIGHTS +#define __CGAMESA_POINTLIGHTS #include @@ -20,7 +20,7 @@ class CPointLightsSA : public CPointLights { public: - void AddLight ( unsigned char ucType, CVector vec_2, CVector vec_3, float fRed, float fGreen, float fBlue, float f_7, unsigned char uc_8, bool bCreatesShadow, CEntity * pEntity ); + void AddLight ( int iMode, const CVector vecPosition, CVector vecDirection, float fRadius, SColor color, unsigned char uc_8, bool bCreatesShadow, CEntity * pAffected ); }; #endif \ No newline at end of file diff --git a/MTA10/game_sa/CRenderWareSA.cpp b/MTA10/game_sa/CRenderWareSA.cpp index 4c9b37b1c6b..89a5045ed57 100644 --- a/MTA10/game_sa/CRenderWareSA.cpp +++ b/MTA10/game_sa/CRenderWareSA.cpp @@ -446,28 +446,6 @@ CColModel * CRenderWareSA::ReadCOL ( const CBuffer& fileData ) return NULL; } -// Positions the front seat by reading out the vector from the 'ped_frontseat' atomic in the clump (RpClump*) -// and changing the vector in the CModelInfo class identified by the model id (usModelID) -bool CRenderWareSA::PositionFrontSeat ( RpClump *pClump, unsigned short usModelID ) -{ - // get the modelinfo array (+5Ch contains a pointer to vehicle specific dummy data) - DWORD *pPool = ( DWORD* ) ARRAY_ModelInfo; - DWORD *pVehicleDummies = ( DWORD* ) ( pPool[usModelID] + 0x5C ); - - // read out the 'ped_frontseat' frame - RwFrame * pPedFrontSeat = RwFrameFindFrame ( RpGetFrame ( pClump ), "ped_frontseat" ); - if ( pPedFrontSeat == NULL ) - return false; - - // in the vehicle specific dummy data, +30h contains the front seat vector - CVector *vecFrontSeat = ( CVector* ) ( pVehicleDummies + 0x30 ); - vecFrontSeat->fX = pPedFrontSeat->modelling.pos.x; - vecFrontSeat->fY = pPedFrontSeat->modelling.pos.y; - vecFrontSeat->fZ = pPedFrontSeat->modelling.pos.z; - - return true; -} - // Loads all atomics from a clump into a container struct and returns the number of atomics it loaded unsigned int CRenderWareSA::LoadAtomics ( RpClump * pClump, RpAtomicContainer * pAtomics ) { diff --git a/MTA10/game_sa/CRenderWareSA.h b/MTA10/game_sa/CRenderWareSA.h index 1bbb88ac161..b9fc0fdd857 100644 --- a/MTA10/game_sa/CRenderWareSA.h +++ b/MTA10/game_sa/CRenderWareSA.h @@ -61,10 +61,6 @@ class CRenderWareSA : public CRenderWare // Replaces a CColModel for a specific object identified by the object id (usModelID) void ReplaceCollisions ( CColModel * pColModel, unsigned short usModelID ); - // Positions the front seat by reading out the vector from the 'ped_frontseat' atomic in the clump (RpClump*) - // and changing the vector in the CModelInfo class identified by the model id (usModelID) - bool PositionFrontSeat ( RpClump * pClump, unsigned short usModelID ); - // Loads all atomics from a clump into a container struct and returns the number of atomics it loaded unsigned int LoadAtomics ( RpClump * pClump, RpAtomicContainer * pAtomics ); diff --git a/MTA10/game_sa/_game_sa 2008.vcxproj b/MTA10/game_sa/_game_sa 2008.vcxproj index 87db58ccc07..4f999e1f4e6 100644 --- a/MTA10/game_sa/_game_sa 2008.vcxproj +++ b/MTA10/game_sa/_game_sa 2008.vcxproj @@ -22,20 +22,20 @@ DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte false @@ -76,7 +76,7 @@ game_sa_d - $(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\output\MTA San Andreas\mta\ false game_sa @@ -123,6 +123,7 @@ $(IntDir)$(TargetName).lib MachineX86 + Console @@ -165,6 +166,7 @@ $(IntDir)$(TargetName).lib MachineX86 false + Console @@ -202,7 +204,7 @@ true true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb true true @@ -210,6 +212,7 @@ $(IntDir)$(TargetName).lib MachineX86 + Console diff --git a/MTA10/gui/gui 2008.vcxproj b/MTA10/gui/gui 2008.vcxproj index 8d59a39809f..21a03ec2f40 100644 --- a/MTA10/gui/gui 2008.vcxproj +++ b/MTA10/gui/gui 2008.vcxproj @@ -23,19 +23,19 @@ DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte @@ -73,7 +73,7 @@ cgui - $(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\output\MTA San Andreas\mta\ false cgui @@ -168,11 +168,11 @@ shlwapi.lib;d3dx9.lib;dxerr.lib;CEGUIBase.lib;DirectX9GUIRenderer.lib;CEGUIFalagardBase.lib;freetype2412ST.lib;%(AdditionalDependencies) true - ../../vendor/cegui-0.4.0-custom/lib;../../vendor/cegui-0.4.0-custom/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)..\vendor\cegui-0.4.0-custom\lib;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\CEGUI - Base;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\CEGUI - DirectX9GUIRenderer;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\CEGUI - FalagardBase;%(AdditionalLibraryDirectories) LIBCMT;%(IgnoreSpecificDefaultLibraries) true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Windows true diff --git a/MTA10/launch/GDFImp.rc b/MTA10/launch/GDFImp.rc index 22e13794f11..a0f1286c9af 100644 --- a/MTA10/launch/GDFImp.rc +++ b/MTA10/launch/GDFImp.rc @@ -1,7 +1,7 @@ ///////////////////////////////////////////////////////////////////////////// // Resource File for : GDFImp #include "GDFImp.h" -#include "vcexpress_rc_fix.h" +//#include "vcexpress_rc_fix.h" // The following line is a workaround for a redefinition warning in sal.h // when using Visual Studio 2005 compilers and includes. Comment out the @@ -11,7 +11,7 @@ ///////////////////////////////////////////////////////////////////////////// // This resource files requires the Platform SDK to be compiled. -#include +//#include // FIXME Removed to work with vs120_xp #define APSTUDIO_READONLY_SYMBOLS diff --git a/MTA10/launch/_Launch 2008.vcxproj b/MTA10/launch/_Launch 2008.vcxproj index 7f499b009b1..7a177ae368f 100644 --- a/MTA10/launch/_Launch 2008.vcxproj +++ b/MTA10/launch/_Launch 2008.vcxproj @@ -22,21 +22,21 @@ Application - v120 + v120_xp false MultiByte true Application - v120 + v120_xp false MultiByte true Application - v120 + v120_xp false MultiByte @@ -75,7 +75,7 @@ Multi Theft Auto - $(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\output\MTA San Andreas\ false Multi Theft Auto @@ -205,7 +205,7 @@ shlwapi.lib;psapi.lib;%(AdditionalDependencies) true true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Windows true diff --git a/MTA10/launch/launch.rc b/MTA10/launch/launch.rc index 232c930ef7a..989a186bfed 100644 --- a/MTA10/launch/launch.rc +++ b/MTA10/launch/launch.rc @@ -1,7 +1,7 @@ // Microsoft Visual C++ generated resource script. // #include "resource.h" -#include "vcexpress_rc_fix.h" +//#include "vcexpress_rc_fix.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// diff --git a/MTA10/loader/MainFunctions.cpp b/MTA10/loader/MainFunctions.cpp index a9d4fed0b85..a3a1646fb12 100644 --- a/MTA10/loader/MainFunctions.cpp +++ b/MTA10/loader/MainFunctions.cpp @@ -670,13 +670,6 @@ void CheckDataFiles( void ) return ExitProcess( EXIT_ERROR ); } - // Check for lua file - if ( !FileExists ( PathJoin( strMTASAPath, CHECK_DM_LUA_NAME ) ) ) - { - DisplayErrorMessageBox ( SString(_("Load failed. Please ensure that %s is installed correctly."),CHECK_DM_LUA_NAME), _E("CL19"), "lua-missing" ); - return ExitProcess( EXIT_ERROR ); - } - // Make sure the gta executable exists if ( !FileExists( PathJoin( strGTAPath, MTA_GTAEXE_NAME ) ) ) { @@ -791,7 +784,6 @@ void CheckLibVersions( void ) ,"MTA\\xmll.dll" ,"MTA\\game_sa.dll" ,"mods\\deathmatch\\client.dll" - ,"mods\\deathmatch\\lua5.1c.dll" ,"mods\\deathmatch\\pcre3.dll" }; SString strReqFileVersion; diff --git a/MTA10/loader/Utils.cpp b/MTA10/loader/Utils.cpp index 8116abdb1d9..69e0abd7fb5 100644 --- a/MTA10/loader/Utils.cpp +++ b/MTA10/loader/Utils.cpp @@ -1923,6 +1923,9 @@ void BsodDetectionPreLaunch( void ) { SetApplicationSetting( "diagnostics", "user-confirmed-bsod-time", strMinidumpTime ); IncApplicationSettingInt( DIAG_MINIDUMP_CONFIRMED_COUNT ); + + // BSOD might be caused by progress animation, so flag for it to be disabled + SetApplicationSettingInt( GENERAL_PROGRESS_ANIMATION_DISABLE, 1 ); } } } diff --git a/MTA10/loader/_Loader 2008.vcxproj b/MTA10/loader/_Loader 2008.vcxproj index 93a21c54e1d..25f9b728d45 100644 --- a/MTA10/loader/_Loader 2008.vcxproj +++ b/MTA10/loader/_Loader 2008.vcxproj @@ -22,21 +22,21 @@ DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte @@ -75,7 +75,7 @@ loader - $(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\output\MTA San Andreas\mta\ false loader @@ -206,9 +206,9 @@ shlwapi.lib;psapi.lib;UnRAR.lib;Version.lib;d3d9.lib;%(AdditionalDependencies) true - ..\..\vendor\unrar\build\unrardll32\$(Configuration);../../vendor/detours/lib;%(AdditionalLibraryDirectories) + $(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\unrar;$(SolutionDir)..\vendor\detours\lib;%(AdditionalLibraryDirectories) true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Windows true diff --git a/MTA10/mods/deathmatch/CClient.cpp b/MTA10/mods/deathmatch/CClient.cpp index 875eed1feb1..c5b9cec2de6 100644 --- a/MTA10/mods/deathmatch/CClient.cpp +++ b/MTA10/mods/deathmatch/CClient.cpp @@ -262,6 +262,15 @@ void CClient::IdleHandler ( void ) } +bool CClient::WebsiteRequestResultHandler ( const std::vector& newPages ) +{ + if ( g_pClientGame ) + return g_pClientGame->TriggerBrowserRequestResultEvent ( newPages ); + + return false; +} + + bool CClient::ProcessCommand ( const char* szCommandLine ) { return false; diff --git a/MTA10/mods/deathmatch/CClient.h b/MTA10/mods/deathmatch/CClient.h index dce18ced983..009863140e3 100644 --- a/MTA10/mods/deathmatch/CClient.h +++ b/MTA10/mods/deathmatch/CClient.h @@ -31,6 +31,8 @@ class CClient : public CClientBase void PostFrameExecutionHandler ( void ); void IdleHandler ( void ); + bool WebsiteRequestResultHandler ( const std::vector& newPages ); + bool ProcessCommand ( const char* szCommandLine ); //bool ProcessInput ( CInputMessage* pInputMessage ); diff --git a/MTA10/mods/deathmatch/StdInc.h b/MTA10/mods/deathmatch/StdInc.h index 64ba7e4f17d..ad8b359085a 100644 --- a/MTA10/mods/deathmatch/StdInc.h +++ b/MTA10/mods/deathmatch/StdInc.h @@ -73,6 +73,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +87,7 @@ #include #include #include +#include #include #include #include diff --git a/MTA10/mods/deathmatch/_Deathmatch 2008.vcproj b/MTA10/mods/deathmatch/_Deathmatch 2008.vcproj index 3792ab99704..1dbbc9beb0e 100644 --- a/MTA10/mods/deathmatch/_Deathmatch 2008.vcproj +++ b/MTA10/mods/deathmatch/_Deathmatch 2008.vcproj @@ -43,7 +43,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../../vendor/libv2;../../../vendor/libspeex;../../../vendor/portaudio;../../../vendor/bass;../../../Shared/publicsdk/include;../../Voice;./;../shared_logic;../../../Shared/XML/interface;../../../vendor;../../../vendor/lua/src;../../../vendor/zlib;"../../../vendor/json-c";../../sdk/;../../../Shared/sdk;../../../vendor/sparsehash/current/src;../../../vendor/sparsehash/current/src/windows;../../../Shared/animation;../../../vendor/bochs;../../../vendor/bob_withers;../../../Shared/mods/deathmatch/logic;../../../vendor/pcre" - PreprocessorDefinitions="WIN32;_DEBUG;MTA_DEBUG;_CRT_SECURE_NO_WARNINGS;LUA_USE_APICHECK" + PreprocessorDefinitions="WIN32;LUA_USE_APICHECK;_DEBUG;MTA_DEBUG;_CRT_SECURE_NO_WARNINGS;LUA_USE_APICHECK" StringPooling="true" MinimalRebuild="false" BasicRuntimeChecks="3" @@ -72,12 +72,12 @@ RegisterOutput="false" IgnoreImportLibrary="false" LinkLibraryDependencies="false" - AdditionalDependencies="libv2.lib lua5.1c_d.lib libspeexd.lib bass.lib bass_fx.lib bassmix.lib tags.lib Psapi.lib Winmm.lib kernel32.lib ws2_32.lib zlib_d.lib Iphlpapi.lib json_d.lib pcre3_d.lib" + AdditionalDependencies="libv2.lib libspeexd.lib bass.lib bass_fx.lib bassmix.lib tags.lib Psapi.lib Winmm.lib kernel32.lib ws2_32.lib zlib_d.lib Iphlpapi.lib json_d.lib pcre3_d.lib" ShowProgress="0" OutputFile="C:\Program Files\MTA San Andreas 1.4\mods\deathmatch\Client_d.dll" LinkIncremental="2" SuppressStartupBanner="true" - AdditionalLibraryDirectories="../../../vendor/libspeex;../../../vendor/bass/lib;"../../../vendor/lua/x86/$(ConfigurationName)Client";../../../vendor/libv2/lib;"../../../vendor/zlib/x86/$(ConfigurationName)";"../../../vendor/json-c/x86/$(ConfigurationName)";"../../../vendor/pcre/x86/$(ConfigurationName)"" + AdditionalLibraryDirectories="../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/libv2/lib;"../../../vendor/zlib/x86/$(ConfigurationName)";"../../../vendor/json-c/x86/$(ConfigurationName)";"../../../vendor/pcre/x86/$(ConfigurationName)"" IgnoreDefaultLibraryNames="LIBCMT" GenerateDebugInformation="true" ProgramDatabaseFile="$(IntDir)\$(TargetName).pdb" @@ -141,7 +141,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories="../../../vendor/libv2;../../../vendor/libspeex;../../../vendor/portaudio;../../../vendor/bass;../../../Shared/publicsdk/include;../../Voice;./;../shared_logic;../../../Shared/XML/interface;../../../vendor;../../../vendor/lua/src;../../../vendor/zlib;"../../../vendor/json-c";../../sdk/;../../../Shared/sdk;../../../vendor/sparsehash/current/src;../../../vendor/sparsehash/current/src/windows;../../../Shared/animation;../../../vendor/bochs;../../../vendor/bob_withers;../../../Shared/mods/deathmatch/logic;../../../vendor/pcre" - PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_WARNINGS;LUA_USE_APICHECK" + PreprocessorDefinitions="WIN32;LUA_USE_APICHECK;_CRT_SECURE_NO_WARNINGS;LUA_USE_APICHECK" StringPooling="true" RuntimeLibrary="2" RuntimeTypeInfo="true" @@ -165,11 +165,11 @@ IgnoreImportLibrary="false" LinkLibraryDependencies="false" AdditionalOptions="/FIXED:NO" - AdditionalDependencies="libv2.lib lua5.1c.lib libspeex.lib bass.lib bass_fx.lib bassmix.lib tags.lib Psapi.lib Winmm.lib kernel32.lib wsock32.lib zlib.lib json.lib pcre3.lib" + AdditionalDependencies="libv2.lib libspeex.lib bass.lib bass_fx.lib bassmix.lib tags.lib Psapi.lib Winmm.lib kernel32.lib wsock32.lib zlib.lib json.lib pcre3.lib" OutputFile="C:\Program Files\MTA San Andreas 1.4\mods\deathmatch\Client.dll" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories="../../../vendor/libspeex;../../../vendor/bass/lib;"../../../vendor/lua/x86/$(ConfigurationName)Client";../../../vendor/libv2/lib;"../../../vendor/zlib/x86/$(ConfigurationName)";"../../../vendor/json-c/x86/$(ConfigurationName)";"../../../vendor/pcre/x86/$(ConfigurationName)"" + AdditionalLibraryDirectories="../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/libv2/lib;"../../../vendor/zlib/x86/$(ConfigurationName)";"../../../vendor/json-c/x86/$(ConfigurationName)";"../../../vendor/pcre/x86/$(ConfigurationName)"" IgnoreAllDefaultLibraries="false" IgnoreDefaultLibraryNames="LIBCMT" GenerateDebugInformation="true" @@ -237,7 +237,7 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" AdditionalIncludeDirectories="../../../vendor/libv2;../../../vendor/libspeex;../../../vendor/portaudio;../../../vendor/bass;../../../Shared/publicsdk/include;../../Voice;./;../shared_logic;../../../Shared/XML/interface;../../../vendor;../../../vendor/lua/src;../../../vendor/zlib;"../../../vendor/json-c";../../sdk/;../../../Shared/sdk;../../../vendor/sparsehash/current/src;../../../vendor/sparsehash/current/src/windows;../../../Shared/animation;../../../vendor/bochs;../../../vendor/bob_withers;../../../Shared/mods/deathmatch/logic;../../../vendor/pcre" - PreprocessorDefinitions="WIN32;_CRT_SECURE_NO_WARNINGS;LUA_USE_APICHECK" + PreprocessorDefinitions="WIN32;LUA_USE_APICHECK;_CRT_SECURE_NO_WARNINGS;LUA_USE_APICHECK" StringPooling="true" RuntimeLibrary="2" RuntimeTypeInfo="true" @@ -261,11 +261,11 @@ IgnoreImportLibrary="false" LinkLibraryDependencies="false" AdditionalOptions="/FIXED:NO" - AdditionalDependencies="libv2.lib lua5.1c.lib libspeex.lib bass.lib bass_fx.lib bassmix.lib tags.lib Psapi.lib Winmm.lib kernel32.lib wsock32.lib zlib.lib json.lib pcre3.lib" + AdditionalDependencies="libv2.lib libspeex.lib bass.lib bass_fx.lib bassmix.lib tags.lib Psapi.lib Winmm.lib kernel32.lib wsock32.lib zlib.lib json.lib pcre3.lib" OutputFile="..\..\..\output\MTA San Andreas\mods\deathmatch\client.dll" LinkIncremental="1" SuppressStartupBanner="true" - AdditionalLibraryDirectories="../../../vendor/libspeex;../../../vendor/bass/lib;"../../../vendor/lua/x86/$(ConfigurationName)Client";../../../vendor/libv2/lib;"../../../vendor/zlib/x86/$(ConfigurationName)";"../../../vendor/json-c/x86/$(ConfigurationName)";"../../../vendor/pcre/x86/$(ConfigurationName)"" + AdditionalLibraryDirectories="../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/libv2/lib;"../../../vendor/zlib/x86/$(ConfigurationName)";"../../../vendor/json-c/x86/$(ConfigurationName)";"../../../vendor/pcre/x86/$(ConfigurationName)"" IgnoreAllDefaultLibraries="false" IgnoreDefaultLibraryNames="LIBCMT" GenerateDebugInformation="true" @@ -864,6 +864,14 @@ RelativePath="..\shared_logic\CClientPlayerVoice.cpp" > + + + + @@ -976,6 +984,10 @@ RelativePath="..\shared_logic\CClientWeaponManager.cpp" > + + @@ -1091,6 +1103,10 @@ RelativePath="..\shared_logic\lua\CLuaFunctionDefs.BodyClothes.cpp" > + + @@ -1151,6 +1167,10 @@ RelativePath="..\shared_logic\lua\CLuaFunctionDefs.Player.cpp" > + + @@ -1247,27 +1267,27 @@ > @@ -1288,51 +1308,923 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + @@ -2606,6 +3506,10 @@ RelativePath="..\shared_logic\CClientWeaponManager.h" > + + diff --git a/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj b/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj index 5e8d62ccf8d..f71b681d1df 100644 --- a/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj +++ b/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj @@ -23,19 +23,19 @@ DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte @@ -75,7 +75,7 @@ client - $(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\output\MTA San Andreas\mods\deathmatch\ false false client @@ -101,10 +101,10 @@ false - libv2.lib;lua5.1c_d.lib;libspeexd2013.lib;bass.lib;bass_fx.lib;bassmix.lib;tags.lib;Psapi.lib;Winmm.lib;kernel32.lib;ws2_32.lib;zlib_d.lib;Iphlpapi.lib;json_d.lib;pcre3_d.lib;%(AdditionalDependencies) + libv2.lib;libspeexd2013.lib;bass.lib;bass_fx.lib;bassmix.lib;tags.lib;Psapi.lib;Winmm.lib;kernel32.lib;ws2_32.lib;zlib_d.lib;Iphlpapi.lib;json_d.lib;pcre3_d.lib;%(AdditionalDependencies) NotSet true - ../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/lua/$(PlatformTarget)/$(Configuration)Client;../../../vendor/libv2/lib;../../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + ../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/libv2/lib;../../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) LIBCMT;%(IgnoreSpecificDefaultLibraries) true $(IntDir)$(TargetName).pdb @@ -142,9 +142,9 @@ /FIXED:NO %(AdditionalOptions) - libv2.lib;lua5.1c.lib;libspeex2013.lib;bass.lib;bass_fx.lib;bassmix.lib;tags.lib;Psapi.lib;Winmm.lib;kernel32.lib;wsock32.lib;zlib.lib;json.lib;pcre3.lib;%(AdditionalDependencies) + libv2.lib;libspeex2013.lib;bass.lib;bass_fx.lib;bassmix.lib;tags.lib;Psapi.lib;Winmm.lib;kernel32.lib;wsock32.lib;zlib.lib;json.lib;pcre3.lib;%(AdditionalDependencies) true - ../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/lua/$(PlatformTarget)/$(Configuration)Client;../../../vendor/libv2/lib;../../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + ../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/libv2/lib;../../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) false LIBCMT;%(IgnoreSpecificDefaultLibraries) true @@ -185,11 +185,11 @@ /FIXED:NO %(AdditionalOptions) libv2.lib;libspeex2013.lib;bass.lib;bass_fx.lib;bassmix.lib;tags.lib;Psapi.lib;Winmm.lib;kernel32.lib;wsock32.lib;zlib.lib;json.lib;%(AdditionalDependencies) true - ../../../vendor/libspeex;../../../vendor/bass/lib;../../../vendor/lua/$(PlatformTarget)/$(Configuration)Client;../../../vendor/libv2/lib;../../../vendor/zlib/$(PlatformTarget)/$(Configuration);../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)..\vendor\libspeex;$(SolutionDir)..\vendor\bass\lib;$(SolutionDir)..\vendor\libv2\lib;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\zlib;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\json;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pcre;%(AdditionalLibraryDirectories) false LIBCMT;%(IgnoreSpecificDefaultLibraries) true - ../../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Windows true @@ -202,17 +202,177 @@ + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + NotUsing + NotUsing + NotUsing + + + + + + @@ -593,12 +753,15 @@ + + + @@ -828,10 +991,6 @@ - - {7922db76-1413-4113-a2be-88fd233e910d} - false - {39452acc-ff12-488d-94b6-301b4efbb606} false diff --git a/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj.filters b/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj.filters index 8ab8ac5fbf2..27011cd19f5 100644 --- a/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj.filters +++ b/MTA10/mods/deathmatch/_Deathmatch 2008.vcxproj.filters @@ -75,6 +75,9 @@ {f747ba22-0747-4bf9-a21c-9e6afc47447d} + + {4ab2244d-178c-4ef0-856a-d8bc3800ebf7} + @@ -824,6 +827,114 @@ Source Files\shared_logic\lua\oopdefs + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\utils\lualib + + + Source Files\shared_logic + + + Source Files\shared_logic + + + Source Files\shared_logic\lua + + + Source Files\shared_logic + + + Source Files\shared_logic\lua + @@ -1531,5 +1642,14 @@ Header Files\shared_logic\lua + + Header Files\shared_logic + + + Header Files\shared_logic + + + Header Files\shared_logic + \ No newline at end of file diff --git a/MTA10/mods/deathmatch/logic/CClientGame.cpp b/MTA10/mods/deathmatch/logic/CClientGame.cpp index 20f45966501..7d574d38548 100644 --- a/MTA10/mods/deathmatch/logic/CClientGame.cpp +++ b/MTA10/mods/deathmatch/logic/CClientGame.cpp @@ -1256,20 +1256,6 @@ void CClientGame::DoPulses ( void ) } } - // Fire the engine ready event 10 frames after we're ingame - static int iFrameCount = 0; - - if ( iFrameCount <= 10 && m_Status == CClientGame::STATUS_JOINED ) - { - ++iFrameCount; - - // Give the game 5 frames to get ready - if ( iFrameCount == 10 ) - { - Event_OnIngameAndReady (); - } - } - // Check for radar input m_pRadarMap->DoPulse (); g_pCore->GetGraphics ()->SetAspectRatioAdjustmentSuspended( m_pRadarMap->IsRadarShowing() ); @@ -2314,6 +2300,7 @@ void CClientGame::SetAllDimensions ( unsigned short usDimension ) m_pManager->GetVehicleStreamer ()->SetDimension ( usDimension ); m_pManager->GetRadarMarkerManager ()->SetDimension ( usDimension ); m_pManager->GetSoundManager ()->SetDimension ( usDimension ); + m_pManager->GetPointLightsManager ()->SetDimension ( usDimension ); m_pNametags->SetDimension ( usDimension ); } @@ -2889,6 +2876,17 @@ void CClientGame::AddBuiltInEvents ( void ) m_Events.AddEvent ( "onClientObjectDamage", "loss, attacker", NULL, false ); m_Events.AddEvent ( "onClientObjectBreak", "attacker", NULL, false ); + // Web events + m_Events.AddEvent ( "onClientBrowserRequestsChange", "newPages", NULL, false ); + m_Events.AddEvent ( "onClientBrowserCreated", "", NULL, false ); + m_Events.AddEvent ( "onClientBrowserDocumentReady", "url", NULL, false ); + m_Events.AddEvent ( "onClientBrowserLoadingFailed", "url, errorcode, errordescription", NULL, false ); + m_Events.AddEvent ( "onClientBrowserNavigate", "url, mainframe", NULL, false ); + m_Events.AddEvent ( "onClientBrowserPopup", "targeturl, openerurl, ispopup", NULL, false ); + m_Events.AddEvent ( "onClientBrowserCursorChange", "cursor", NULL, false ); + m_Events.AddEvent ( "onClientBrowserTooltip", "text", NULL, false ); + m_Events.AddEvent ( "onClientBrowserInputFocusChanged", "gainedfocus", NULL, false ); + // Misc events m_Events.AddEvent ( "onClientFileDownloadComplete", "fileName, success", NULL, false ); @@ -3598,17 +3596,8 @@ void CClientGame::Event_OnIngame ( void ) } -void CClientGame::Event_OnIngameAndReady ( void ) -{ - // Fade in - //m_pCamera->FadeIn ( 1.0f ); -} - - void CClientGame::Event_OnIngameAndConnected ( void ) { - // Create a messagebox saying that we're verifying the client - //g_pCore->ShowMessageBox ( "Connecting", _("Verifying client ..."), false ); m_ulVerifyTimeStart = CClientTime::GetTime (); // Keep criminal records of how many times they've connected to servers @@ -3616,14 +3605,7 @@ void CClientGame::Event_OnIngameAndConnected ( void ) if ( m_ServerType == SERVER_TYPE_EDITOR ) SetApplicationSettingInt ( "times-connected-editor", GetApplicationSettingInt ("times-connected-editor") + 1 ); - /* // Notify the server telling we're ingame - NetBitStreamInterface* pBitStream = g_pNet->AllocateNetBitStream (); - if ( pBitStream ) - { - g_pNet->SendPacket ( PACKET_ID_PLAYER_INGAME_NOTICE, pBitStream ); - g_pNet->DeallocateNetBitStream ( pBitStream ); - }*/ m_pNetAPI->RPC ( PLAYER_INGAME_NOTICE ); } @@ -3896,6 +3878,7 @@ void CClientGame::PreWorldProcessHandler ( void ) void CClientGame::PostWorldProcessHandler ( void ) { m_pManager->GetMarkerManager ()->DoPulse (); + m_pManager->GetPointLightsManager ()->DoPulse (); // Update frame time slice uint uiCurrentTick = GetTickCount32 (); @@ -4071,14 +4054,14 @@ void CClientGame::DownloadInitialResourceFiles ( void ) else { g_pCore->GetConsole ()->Printf ( _("Download error: %s"), szHTTPError ); - if ( g_pClientGame->IsUsingExternalHTTPServer() && !g_pCore->ShouldUseInternalHTTPServer() ) - { - SString strMessage( "External HTTP file download error:%s (Reconnecting with internal HTTP)", szHTTPError ); - g_pClientGame->TellServerSomethingImportant( 1006, strMessage, true ); - g_pCore->Reconnect( "", 0, NULL, false, true ); - } - else - { + if ( g_pClientGame->IsUsingExternalHTTPServer() && !g_pCore->ShouldUseInternalHTTPServer() ) + { + SString strMessage( "External HTTP file download error:%s (Reconnecting with internal HTTP)", szHTTPError ); + g_pClientGame->TellServerSomethingImportant( 1006, strMessage, true ); + g_pCore->Reconnect( "", 0, NULL, false, true ); + } + else + { // Throw the error and disconnect AddReportLog( 7106, SString( "Game - HTTPError (%s)", szHTTPError ) ); @@ -6321,6 +6304,8 @@ void CClientGame::SetDevelopmentMode ( bool bEnable ) g_pGame->GetAudio ()->SetWorldSoundHandler ( CClientGame::StaticWorldSoundHandler ); else g_pGame->GetAudio ()->SetWorldSoundHandler ( NULL ); + + g_pCore->GetWebCore()->SetTestModeEnabled ( bEnable ); } @@ -6600,3 +6585,19 @@ void CClientGame::SetFileCacheRoot ( void ) AddReportLog( 7413, SString( "CClientGame::SetFileCacheRoot - Change shared from '%s' to '%s'", *strFileCachePath, *m_strFileCacheRoot ) ); } } + +bool CClientGame::TriggerBrowserRequestResultEvent ( const std::vector& newPages ) +{ + CLuaArguments Arguments; + CLuaArguments LuaTable; + int i = 0; + + for ( std::vector::const_iterator iter = newPages.begin (); iter != newPages.end (); ++iter ) + { + LuaTable.PushNumber ( ++i ); + LuaTable.PushString ( *iter ); + } + Arguments.PushTable ( &LuaTable ); + + return GetRootEntity ()->CallEvent ( "onClientBrowserRequestsChange", Arguments, false ); +} diff --git a/MTA10/mods/deathmatch/logic/CClientGame.h b/MTA10/mods/deathmatch/logic/CClientGame.h index 97069e6ef29..4f9f1fbb2aa 100644 --- a/MTA10/mods/deathmatch/logic/CClientGame.h +++ b/MTA10/mods/deathmatch/logic/CClientGame.h @@ -124,6 +124,7 @@ class CClientGame SCRIPTFILE, WATER, WEAPON, + POINTLIGHTS, UNKNOWN, }; @@ -433,6 +434,8 @@ class CClientGame void ChangeFloatPrecision ( bool bHigh ); bool IsHighFloatPrecision ( void ) const; + bool TriggerBrowserRequestResultEvent( const std::vector& newPages ); + private: // CGUI Callbacks @@ -483,7 +486,6 @@ class CClientGame void QuitPlayer ( CClientPlayer* pPlayer, eQuitReason Reason ); void Event_OnIngame ( void ); - void Event_OnIngameAndReady ( void ); void Event_OnIngameAndConnected ( void ); static bool StaticDamageHandler ( CPed* pDamagePed, CEventDamage * pEvent ); @@ -609,6 +611,7 @@ class CClientGame CClientPathManager* m_pPathManager; CClientTeamManager* m_pTeamManager; CClientPedManager* m_pPedManager; + CClientPointLightsManager* m_pPointLightsManager; CClientProjectileManager* m_pProjectileManager; CRPCFunctions* m_pRPCFunctions; CUnoccupiedVehicleSync* m_pUnoccupiedVehicleSync; diff --git a/MTA10/mods/deathmatch/logic/CClientPerfStat.LuaMemory.cpp b/MTA10/mods/deathmatch/logic/CClientPerfStat.LuaMemory.cpp index 4de76b2bdee..2893225cbb8 100644 --- a/MTA10/mods/deathmatch/logic/CClientPerfStat.LuaMemory.cpp +++ b/MTA10/mods/deathmatch/logic/CClientPerfStat.LuaMemory.cpp @@ -267,6 +267,7 @@ void CClientPerfStatLuaMemoryImpl::GetLuaMemoryStats ( CClientPerfStatResult* pR pResult->AddColumn ( "Shaders" ); pResult->AddColumn ( "RenderTargets" ); pResult->AddColumn ( "ScreenSources" ); + pResult->AddColumn ( "WebBrowsers" ); // Calc totals if ( strFilter == "" ) @@ -307,6 +308,7 @@ void CClientPerfStatLuaMemoryImpl::GetLuaMemoryStats ( CClientPerfStatResult* pR int ShaderCount = g_pClientGame->GetManager ()->GetRenderElementManager ()->GetShaderCount (); int RenderTargetCount = g_pClientGame->GetManager ()->GetRenderElementManager ()->GetRenderTargetCount (); int ScreenSourceCount = g_pClientGame->GetManager ()->GetRenderElementManager ()->GetScreenSourceCount (); + int WebBrowserCount = g_pClientGame->GetManager ()->GetRenderElementManager ()->GetWebBrowserCount (); TextItemCount = Max ( TextItemCount - 4, 0 ); // Remove count for radar items row[c++] = !TextItemCount ? "-" : SString ( "%d", TextItemCount ); row[c++] = !DxFontCount ? "-" : SString ( "%d", DxFontCount ); @@ -315,6 +317,7 @@ void CClientPerfStatLuaMemoryImpl::GetLuaMemoryStats ( CClientPerfStatResult* pR row[c++] = !ShaderCount ? "-" : SString ( "%d", ShaderCount ); row[c++] = !RenderTargetCount ? "-" : SString ( "%d", RenderTargetCount ); row[c++] = !ScreenSourceCount ? "-" : SString ( "%d", ScreenSourceCount ); + row[c++] = !WebBrowserCount ? "-" : SString ( "%d", WebBrowserCount ); } // For each VM diff --git a/MTA10/mods/deathmatch/logic/CNetworkStats.cpp b/MTA10/mods/deathmatch/logic/CNetworkStats.cpp index 71319a3d79c..cb3ae738ebe 100644 --- a/MTA10/mods/deathmatch/logic/CNetworkStats.cpp +++ b/MTA10/mods/deathmatch/logic/CNetworkStats.cpp @@ -83,7 +83,6 @@ void CNetworkStats::Draw ( void ) "Packet rate in/out: %u / %u\n" "BPS limit by CC: %llu\n" "BPS limit by OB: %llu\n" - "Encryption: %s\n" "Current wep bullet sync: %s\n" "Veh. Extrapolate amount: %d%%\n" "Veh. Extrapolate max: %dms\n" @@ -105,7 +104,6 @@ void CNetworkStats::Draw ( void ) (unsigned int)floor(m_fPacketSendRate + 0.5f), stats.isLimitedByCongestionControl ? 1ULL : 0ULL, stats.isLimitedByOutgoingBandwidthLimit ? 1ULL : 0ULL, - stats.encryptionStatus ? stats.encryptionStatus == 1 ? "On" : "Unknown" : "Off", bBulletSync ? "On" : "Off", vehExtrapolateSettings.iScalePercent, vehExtrapolateSettings.iMaxMs, diff --git a/MTA10/mods/deathmatch/logic/CResourceConfigItem.cpp b/MTA10/mods/deathmatch/logic/CResourceConfigItem.cpp index 6db631acfa1..ec0aed901ba 100644 --- a/MTA10/mods/deathmatch/logic/CResourceConfigItem.cpp +++ b/MTA10/mods/deathmatch/logic/CResourceConfigItem.cpp @@ -89,7 +89,8 @@ bool CResourceConfigItem::Stop ( void ) { delete m_pXMLFile; m_pXMLFile = NULL; + m_pXMLRootNode = NULL; } return true; -} +} \ No newline at end of file diff --git a/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index e2c707576da..b86f3138004 100644 --- a/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -1244,6 +1244,7 @@ bool CStaticFunctionDefinitions::SetElementDimension ( CClientEntity& Entity, un case CCLIENTRADARMARKER: case CCLIENTPED: case CCLIENTPICKUP: + case CCLIENTPOINTLIGHTS: case CCLIENTRADARAREA: case CCLIENTWORLDMESH: case CCLIENTSOUND: @@ -6437,11 +6438,11 @@ bool CStaticFunctionDefinitions::BindKey ( const char* szKey, const char* szHitS //Activate all keys for this command pKeyBinds->SetAllCommandsActive ( szResource, true, szCommandName, bHitState, szArguments, true ); //Check if its binded already (dont rebind) - if ( pKeyBinds->CommandExists ( szKey, szCommandName, true, bHitState, szArguments, szResource ) ) + if ( pKeyBinds->CommandExists ( szKey, szCommandName, true, bHitState, szArguments, szResource, true, true ) ) return true; if ( ( !stricmp ( szHitState, "down" ) || !stricmp ( szHitState, "both" ) ) && - pKeyBinds->AddCommand ( szKey, szCommandName, szArguments, bHitState, szResource ) ) + pKeyBinds->AddCommand ( szKey, szCommandName, szArguments, bHitState, szResource, true ) ) { pKeyBinds->SetCommandActive ( szKey, szCommandName, bHitState, szArguments, szResource, true, true ); bSuccess = true; @@ -6449,11 +6450,11 @@ bool CStaticFunctionDefinitions::BindKey ( const char* szKey, const char* szHitS bHitState = false; pKeyBinds->SetAllCommandsActive ( szResource, true, szCommandName, bHitState, szArguments, true ); - if ( pKeyBinds->CommandExists ( szKey, szCommandName, true, bHitState, szArguments, szResource ) ) + if ( pKeyBinds->CommandExists ( szKey, szCommandName, true, bHitState, szArguments, szResource, true, true ) ) return true; if ( ( !stricmp ( szHitState, "up" ) || !stricmp ( szHitState, "both" ) ) && - pKeyBinds->AddCommand ( szKey, szCommandName, szArguments, bHitState, szResource ) ) + pKeyBinds->AddCommand ( szKey, szCommandName, szArguments, bHitState, szResource, true ) ) { pKeyBinds->SetCommandActive ( szKey, szCommandName, bHitState, szArguments, szResource, true, true ); bSuccess = true; @@ -8623,4 +8624,100 @@ bool CStaticFunctionDefinitions::SetSoundPan ( CClientSound& pSound, float fPan bool CStaticFunctionDefinitions::GetSoundPan ( CClientSound& pSound, float& fPan ) { return pSound.GetPan ( fPan ); +} + +CClientPointLights* CStaticFunctionDefinitions::CreateLight ( CResource& Resource, int iMode, const CVector& vecPosition, float fRadius, SColor color, CVector& vecDirection ) +{ + // Create it + CClientPointLights* pLight = new CClientPointLights ( m_pManager, INVALID_ELEMENT_ID ); + if ( pLight ) + { + pLight->SetParent ( Resource.GetResourceDynamicEntity () ); + pLight->SetMode ( iMode ); + pLight->SetPosition ( vecPosition ); + pLight->SetRadius ( fRadius ); + pLight->SetColor ( color ); + pLight->SetDirection ( vecDirection ); + + return pLight; + } + + return NULL; +} + + +bool CStaticFunctionDefinitions::GetLightType ( CClientPointLights* pLight, int& iMode ) +{ + if ( pLight ) + { + iMode = pLight->GetMode (); + return true; + } + return false; +} + + +bool CStaticFunctionDefinitions::GetLightRadius ( CClientPointLights* pLight, float& fRadius ) +{ + if ( pLight ) + { + fRadius = pLight->GetRadius (); + return true; + } + return false; +} + + +bool CStaticFunctionDefinitions::GetLightColor ( CClientPointLights* pLight, SColor& outColor ) +{ + if ( pLight ) + { + outColor = pLight->GetColor (); + return true; + } + return false; +} + + +bool CStaticFunctionDefinitions::GetLightDirection ( CClientPointLights* pLight, CVector& vecDirection ) +{ + if ( pLight ) + { + vecDirection = pLight->GetDirection(); + return true; + } + return false; +} + + +bool CStaticFunctionDefinitions::SetLightRadius ( CClientPointLights* pLight, float fRadius ) +{ + if ( pLight ) + { + pLight->SetRadius ( fRadius ); + return true; + } + return false; +} + + +bool CStaticFunctionDefinitions::SetLightColor ( CClientPointLights* pLight, SColor color ) +{ + if ( pLight ) + { + pLight->SetColor ( color ); + return true; + } + return false; +} + + +bool CStaticFunctionDefinitions::SetLightDirection ( CClientPointLights* pLight, CVector vecDirection ) +{ + if ( pLight ) + { + pLight->SetDirection ( vecDirection ); + return true; + } + return false; } \ No newline at end of file diff --git a/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.h b/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.h index abd0f8b96eb..94815713973 100644 --- a/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.h +++ b/MTA10/mods/deathmatch/logic/CStaticFunctionDefinitions.h @@ -304,6 +304,16 @@ class CStaticFunctionDefinitions // Fire funcs static bool CreateFire ( CVector& vecPosition, float fSize ); + + // Light funcs + static CClientPointLights* CreateLight ( CResource& Resource, int iMode, const CVector& vecPosition, float fRadius, SColor color, CVector& vecDirection ); + static bool GetLightType ( CClientPointLights* pLight, int& iMode ); + static bool GetLightRadius ( CClientPointLights* pLight, float& fRadius ); + static bool GetLightColor ( CClientPointLights* pLight, SColor& outColor ); + static bool GetLightDirection ( CClientPointLights* pLight, CVector& vecDirection ); + static bool SetLightRadius ( CClientPointLights* pLight, float fRadius ); + static bool SetLightColor ( CClientPointLights* pLight, SColor color ); + static bool SetLightDirection ( CClientPointLights* pLight, CVector vecDirection ); // Audio funcs static bool PlaySoundFrontEnd ( unsigned char ucSound ); diff --git a/MTA10/mods/shared_logic/CBassAudio.cpp b/MTA10/mods/shared_logic/CBassAudio.cpp index dc6fd796afb..210daded962 100644 --- a/MTA10/mods/shared_logic/CBassAudio.cpp +++ b/MTA10/mods/shared_logic/CBassAudio.cpp @@ -606,7 +606,7 @@ void CBassAudio::SetPan ( float fPan ) BASS_ChannelSetAttribute( m_pSound, BASS_ATTRIB_PAN, fPan ); } -void CBassAudio::SetVolume ( float fVolume, bool bStore ) +void CBassAudio::SetVolume ( float fVolume ) { m_fVolume = fVolume; diff --git a/MTA10/mods/shared_logic/CBassAudio.h b/MTA10/mods/shared_logic/CBassAudio.h index cceecd3bdfb..76e5d0566eb 100644 --- a/MTA10/mods/shared_logic/CBassAudio.h +++ b/MTA10/mods/shared_logic/CBassAudio.h @@ -58,7 +58,7 @@ class CBassAudio void SetPlayPosition ( double dPosition ); double GetPlayPosition ( void ); double GetLength ( void ); - void SetVolume ( float fVolume, bool bStore = true ); + void SetVolume ( float fVolume ); void SetPlaybackSpeed ( float fSpeed ); void SetPosition ( const CVector& vecPosition ); void SetVelocity ( const CVector& vecVelocity ); diff --git a/MTA10/mods/shared_logic/CClientCamera.cpp b/MTA10/mods/shared_logic/CClientCamera.cpp index e308c616261..60cf6fcf0da 100644 --- a/MTA10/mods/shared_logic/CClientCamera.cpp +++ b/MTA10/mods/shared_logic/CClientCamera.cpp @@ -283,12 +283,12 @@ void CClientCamera::SetOrbitTarget ( const CVector& vecPosition ) { if ( m_pCamera ) { - CVector vecPlayerPosition; - g_pClientGame->GetLocalPlayer ()->GetPosition ( vecPlayerPosition ); + CVector vecCameraPosition; + GetPosition ( vecCameraPosition ); - float fDistance = (vecPosition - vecPlayerPosition).Length (); - float fAngleHorz = -atan2 ( vecPosition.fX - vecPlayerPosition.fX, vecPosition.fY - vecPlayerPosition.fY ) - PI/2; - float fAngleVert = atan2 ( vecPosition.fZ - vecPlayerPosition.fZ, fDistance ); + float fDistance = (vecPosition - vecCameraPosition).Length (); + float fAngleHorz = -atan2 ( vecPosition.fX - vecCameraPosition.fX, vecPosition.fY - vecCameraPosition.fY ) - PI/2; + float fAngleVert = atan2 ( vecPosition.fZ - vecCameraPosition.fZ, fDistance ); CCam* pCam = m_pCamera->GetCam ( m_pCamera->GetActiveCam () ); pCam->SetDirection ( fAngleHorz, fAngleVert ); diff --git a/MTA10/mods/shared_logic/CClientColModel.cpp b/MTA10/mods/shared_logic/CClientColModel.cpp index 09b39b617e3..54756412699 100644 --- a/MTA10/mods/shared_logic/CClientColModel.cpp +++ b/MTA10/mods/shared_logic/CClientColModel.cpp @@ -38,16 +38,25 @@ CClientColModel::~CClientColModel ( void ) } -bool CClientColModel::LoadCol ( const char* szFile ) +bool CClientColModel::LoadCol ( const SString& strFile, bool bIsRawData ) { // Not already got a col model? if ( !m_pColModel ) { + SString strFilename; CBuffer buffer; - buffer.LoadFromFile( szFile ); - g_pClientGame->GetResourceManager()->ValidateResourceFile( szFile, buffer ); + if ( !bIsRawData ) + { + strFilename = strFile; + buffer.LoadFromFile( strFilename ); + g_pClientGame->GetResourceManager()->ValidateResourceFile( strFilename, buffer ); + } + else + { + buffer = CBuffer( strFile, strFile.length() ); + } - if ( !g_pCore->GetNetwork ()->CheckFile ( "col", szFile ) ) + if ( !g_pCore->GetNetwork()->CheckFile( "col", strFilename, buffer ) ) return false; // Load the collision file @@ -141,3 +150,10 @@ void CClientColModel::InternalRestore ( unsigned short usModel ) CModelInfo* pModel = g_pGame->GetModelInfo ( usModel ); pModel->RestoreColModel (); } + + +// Return true if data looks like COL file contents +bool CClientColModel::IsCOLData ( const SString& strData ) +{ + return strData.length() > 32 && memcmp( strData, "COL", 3 ) == 0 && strData[7] == 0; +} diff --git a/MTA10/mods/shared_logic/CClientColModel.h b/MTA10/mods/shared_logic/CClientColModel.h index 6517cdd5a18..b2a2f037daa 100644 --- a/MTA10/mods/shared_logic/CClientColModel.h +++ b/MTA10/mods/shared_logic/CClientColModel.h @@ -24,7 +24,7 @@ class CClientColModel : public CClientEntity eClientEntityType GetType ( void ) const { return CCLIENTCOL; } - bool LoadCol ( const char* szFile ); + bool LoadCol ( const SString& strFile, bool bIsRawData ); inline bool IsLoaded ( void ) { return m_pColModel != NULL; }; bool Replace ( unsigned short usModel ); @@ -32,6 +32,7 @@ class CClientColModel : public CClientEntity void RestoreAll ( void ); bool HasReplaced ( unsigned short usModel ); + static bool IsCOLData ( const SString& strData ); // Sorta a hack that these are required by CClientEntity... diff --git a/MTA10/mods/shared_logic/CClientDFF.cpp b/MTA10/mods/shared_logic/CClientDFF.cpp index 6f9270b2d5c..83cb6f4e3a9 100644 --- a/MTA10/mods/shared_logic/CClientDFF.cpp +++ b/MTA10/mods/shared_logic/CClientDFF.cpp @@ -53,30 +53,53 @@ RpClump* CClientDFF::GetLoadedClump ( ushort usModelId ) m_pManager->GetModelRequestManager ()->RequestBlocking ( usModelId, "CClientDFF::LoadDFF" ); // Attempt loading it - CBuffer buffer; - buffer.LoadFromFile( m_strDffFilename ); - g_pClientGame->GetResourceManager()->ValidateResourceFile( m_strDffFilename, buffer ); - info.pClump = g_pGame->GetRenderWare ()->ReadDFF ( buffer, usModelId, CClientVehicleManager::IsValidModel ( usModelId ) ); + if( !m_bIsRawData ) // We have file + { + CBuffer buffer; + buffer.LoadFromFile( m_strDffFilename ); + g_pClientGame->GetResourceManager()->ValidateResourceFile( m_strDffFilename, buffer ); + if ( g_pCore->GetNetwork ()->CheckFile ( "dff", m_strDffFilename, buffer ) ) + { + info.pClump = g_pGame->GetRenderWare ()->ReadDFF ( buffer, usModelId, CClientVehicleManager::IsValidModel ( usModelId ) ); + } + } + else //We have raw data + { + info.pClump = g_pGame->GetRenderWare ()->ReadDFF ( m_RawDataBuffer, usModelId, CClientVehicleManager::IsValidModel ( usModelId ) ); + + // Remove raw data from memory (can only do one replace when using raw data) + m_RawDataBuffer.Clear (); + } } return info.pClump; } -bool CClientDFF::LoadDFF ( const char* szFile ) +bool CClientDFF::LoadDFF ( const SString& strFile, bool bIsRawData ) { // Should only be called once, directly after construction - assert ( m_strDffFilename.empty () ); + m_bIsRawData = bIsRawData; + if( !m_bIsRawData ) // If we have actual file + { + assert ( m_strDffFilename.empty () ); - m_strDffFilename = szFile; - if ( m_strDffFilename.empty () ) - return false; + m_strDffFilename = strFile; + if ( m_strDffFilename.empty () ) + return false; - if ( !FileExists ( m_strDffFilename ) ) - return false; + if ( !FileExists ( m_strDffFilename ) ) + return false; - if ( !g_pCore->GetNetwork ()->CheckFile ( "dff", m_strDffFilename ) ) - return false; + if ( !g_pCore->GetNetwork ()->CheckFile ( "dff", m_strDffFilename ) ) + return false; + } + else + { + m_RawDataBuffer = CBuffer( strFile, strFile.length() ); + if ( !g_pCore->GetNetwork ()->CheckFile ( "dff", "", m_RawDataBuffer ) ) + return false; + } // Do actual load later (in ReplaceModel) return true; @@ -332,3 +355,9 @@ bool CClientDFF::ReplaceVehicleModel ( RpClump* pClump, ushort usModel, bool bAl // Success return true; } + +// Return true if data looks like DFF file contents +bool CClientDFF::IsDFFData ( const SString& strData ) +{ + return strData.length() > 32 && memcmp( strData, "\x10\x00\x00\x00", 4 ) == 0; +} diff --git a/MTA10/mods/shared_logic/CClientDFF.h b/MTA10/mods/shared_logic/CClientDFF.h index b33ec51aa2e..ea16474bc77 100644 --- a/MTA10/mods/shared_logic/CClientDFF.h +++ b/MTA10/mods/shared_logic/CClientDFF.h @@ -36,7 +36,7 @@ class CClientDFF : public CClientEntity eClientEntityType GetType ( void ) const { return CCLIENTDFF; } - bool LoadDFF ( const char* szFile ); + bool LoadDFF ( const SString& strFile, bool bIsRawData ); bool ReplaceModel ( unsigned short usModel, bool bAlphaTransparency ); @@ -45,6 +45,8 @@ class CClientDFF : public CClientEntity void RestoreModel ( unsigned short usModel ); void RestoreModels ( void ); + static bool IsDFFData ( const SString& strData ); + // Sorta a hack that these are required by CClientEntity... void Unlink ( void ) {}; void GetPosition ( CVector& vecPosition ) const {}; @@ -64,6 +66,8 @@ class CClientDFF : public CClientEntity class CClientDFFManager* m_pDFFManager; SString m_strDffFilename; + CBuffer m_RawDataBuffer; + bool m_bIsRawData; std::map < ushort, SLoadedClumpInfo > m_LoadedClumpInfoMap; std::list < unsigned short > m_Replaced; diff --git a/MTA10/mods/shared_logic/CClientEntity.cpp b/MTA10/mods/shared_logic/CClientEntity.cpp index d8c3a817489..ba69980a2c8 100644 --- a/MTA10/mods/shared_logic/CClientEntity.cpp +++ b/MTA10/mods/shared_logic/CClientEntity.cpp @@ -1188,6 +1188,7 @@ bool CClientEntity::IsAttachable ( void ) case CCLIENTSOUND: case CCLIENTCOLSHAPE: case CCLIENTWEAPON: + case CCLIENTPOINTLIGHTS: { return true; break; @@ -1213,6 +1214,7 @@ bool CClientEntity::IsAttachToable ( void ) case CCLIENTSOUND: case CCLIENTCOLSHAPE: case CCLIENTCAMERA: + case CCLIENTPOINTLIGHTS: { return true; break; @@ -1262,6 +1264,8 @@ unsigned int CClientEntity::GetTypeID ( const char* szTypeName ) return CCLIENTRADARAREA; else if ( strcmp ( szTypeName, "sound" ) == 0 ) return CCLIENTSOUND; + else if ( strcmp ( szTypeName, "light" ) == 0 ) + return CCLIENTPOINTLIGHTS; else return CCLIENTUNKNOWN; } diff --git a/MTA10/mods/shared_logic/CClientEntity.h b/MTA10/mods/shared_logic/CClientEntity.h index 29777d0c49b..9b9b7f7dd99 100644 --- a/MTA10/mods/shared_logic/CClientEntity.h +++ b/MTA10/mods/shared_logic/CClientEntity.h @@ -78,8 +78,10 @@ enum eClientEntityType CCLIENTSHADER, CCLIENTWEAPON, CCLIENTEFFECT, + CCLIENTPOINTLIGHTS, CCLIENTSCREENSOURCE, CCLIENTRENDERTARGET, + CCLIENTBROWSER, CCLIENTUNKNOWN, }; @@ -140,8 +142,10 @@ enum eCClientEntityClassTypes CLASS_CClientShader, CLASS_CClientRenderTarget, CLASS_CClientScreenSource, + CLASS_CClientWebBrowser, CLASS_CClientWeapon, CLASS_CClientEffect, + CLASS_CClientPointLights, }; diff --git a/MTA10/mods/shared_logic/CClientManager.cpp b/MTA10/mods/shared_logic/CClientManager.cpp index e0513c4f3f2..a87fae863b5 100644 --- a/MTA10/mods/shared_logic/CClientManager.cpp +++ b/MTA10/mods/shared_logic/CClientManager.cpp @@ -54,6 +54,7 @@ CClientManager::CClientManager ( void ) m_pWaterManager = new CClientWaterManager ( this ); m_pWeaponManager = new CClientWeaponManager ( this ); m_pEffectManager = new CClientEffectManager ( this ); + m_pPointLightsManager = new CClientPointLightsManager ( this ); m_pPacketRecorder = new CClientPacketRecorder ( this ); m_bBeingDeleted = false; @@ -170,6 +171,9 @@ CClientManager::~CClientManager ( void ) delete m_pWeaponManager; m_pWeaponManager = NULL; + + delete m_pPointLightsManager; + m_pPointLightsManager = NULL; } // diff --git a/MTA10/mods/shared_logic/CClientManager.h b/MTA10/mods/shared_logic/CClientManager.h index f61001e0f30..54418200154 100644 --- a/MTA10/mods/shared_logic/CClientManager.h +++ b/MTA10/mods/shared_logic/CClientManager.h @@ -46,6 +46,7 @@ class CClientManager; #include "CClientWaterManager.h" #include "CClientWeaponManager.h" #include "CClientEffectManager.h" +#include "CClientPointLightsManager.h" class CClientProjectileManager; class CClientExplosionManager; @@ -96,6 +97,7 @@ class CClientManager inline CClientWaterManager* GetWaterManager ( void ) { return m_pWaterManager; } inline CClientWeaponManager* GetWeaponManager ( void ) { return m_pWeaponManager; } inline CClientEffectManager* GetEffectManager ( void ) { return m_pEffectManager; } + inline CClientPointLightsManager* GetPointLightsManager ( void ) { return m_pPointLightsManager; } inline bool IsGameLoaded ( void ) { return g_pGame->GetSystemState () == 9 && !m_bGameUnloadedFlag && g_pCore->GetNetwork ()->GetServerBitStreamVersion (); } inline bool IsBeingDeleted ( void ) { return m_bBeingDeleted; } @@ -146,6 +148,7 @@ class CClientManager CClientExplosionManager* m_pExplosionManager; CClientWeaponManager* m_pWeaponManager; CClientEffectManager* m_pEffectManager; + CClientPointLightsManager* m_pPointLightsManager; CClientPacketRecorder* m_pPacketRecorder; bool m_bBeingDeleted; bool m_bGameUnloadedFlag; diff --git a/MTA10/mods/shared_logic/CClientPointLights.cpp b/MTA10/mods/shared_logic/CClientPointLights.cpp new file mode 100644 index 00000000000..6255271aef1 --- /dev/null +++ b/MTA10/mods/shared_logic/CClientPointLights.cpp @@ -0,0 +1,73 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/CClientPointLights.cpp +* PURPOSE: PointLights entity class +* DEVELOPERS: Alexander Romanov +* +*****************************************************************************/ + +#include + +CClientPointLights::CClientPointLights ( class CClientManager* pManager, ElementID ID ) : ClassInit ( this ), CClientEntity ( ID ) +{ + // Init + m_pManager = pManager; + m_pPointLightsManager = pManager->GetPointLightsManager (); + m_iMode = 0; + m_fRadius = 3.0f; + m_Color = SColorRGBA ( 255, 0, 0, 0 ); + m_vecDirection = CVector ( ); + m_bCreatesShadow = false; + m_pAffected = NULL; + m_bStreamedIn = true; + + SetTypeName ( "light" ); + + // Make sure we're visible/invisible according to our dimension + RelateDimension ( m_pPointLightsManager->GetDimension () ); + + // Add us to the manager's list + m_pPointLightsManager->AddToList ( this ); +} + + +CClientPointLights::~CClientPointLights ( void ) +{ + // Remove us from the manager's list + Unlink (); +} + + +void CClientPointLights::Unlink ( void ) +{ + m_pPointLightsManager->RemoveFromList ( this ); +} + + +void CClientPointLights::DoPulse ( void ) +{ + // Update our position/rotation if we're attached + DoAttaching (); + + // Suppose to show? + if ( m_bStreamedIn ) + { + g_pGame->GetPointLights ()->AddLight ( m_iMode, m_vecPosition, m_vecDirection, m_fRadius, m_Color, 0, m_bCreatesShadow, 0 ); + } +} + + +void CClientPointLights::SetDimension ( unsigned short usDimension ) +{ + m_usDimension = usDimension; + RelateDimension ( m_pPointLightsManager->GetDimension () ); +} + + +void CClientPointLights::RelateDimension ( unsigned short usDimension ) +{ + m_bStreamedIn = ( usDimension == m_usDimension ); +} \ No newline at end of file diff --git a/MTA10/mods/shared_logic/CClientPointLights.h b/MTA10/mods/shared_logic/CClientPointLights.h new file mode 100644 index 00000000000..acfe793a77b --- /dev/null +++ b/MTA10/mods/shared_logic/CClientPointLights.h @@ -0,0 +1,73 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/CClientPointLights.h +* PURPOSE: PointLights entity class header +* DEVELOPERS: Alexander Romanov +* +*****************************************************************************/ + +#ifndef __CCLIENTPOINTLIGHTS_H +#define __CCLIENTPOINTLIGHTS_H + +#include "CClientEntity.h" + +class CClientPointLightsManager; + +class CClientPointLights : public CClientEntity +{ + DECLARE_CLASS( CClientPointLights, CClientEntity ) + friend class CClientPointLightsManager; + +public: + CClientPointLights ( class CClientManager* pManager, ElementID ID ); + ~CClientPointLights ( void ); + + void Unlink ( void ); + + eClientEntityType GetType ( void ) const { return CCLIENTPOINTLIGHTS; }; + + int GetMode ( void ) { return m_iMode; }; + void SetMode ( int iMode ) { m_iMode = iMode; }; + + void GetPosition ( CVector& vecPosition ) const { vecPosition = m_vecPosition; }; + void SetPosition ( const CVector& vecPosition ) { m_vecPosition = vecPosition; }; + + float GetRadius ( void ) { return m_fRadius; }; + void SetRadius ( float fRadius ) { m_fRadius = fRadius; }; + + SColor GetColor ( void ) { return m_Color; }; + void SetColor ( SColor color ) { m_Color = color; }; + + CVector& GetDirection ( void ) { return m_vecDirection; }; + void SetDirection ( CVector& vecDirection ) { m_vecDirection = vecDirection; }; + + bool GetCreatesShadow ( void ) { return m_bCreatesShadow; }; + void SetCreatesShadow ( bool bCreatesShadow ) { m_bCreatesShadow = bCreatesShadow; }; + + CClientEntity* GetAffected ( void ) { return m_pAffected; }; + void SetAffected ( CClientEntity* pAffected ) { m_pAffected = pAffected; }; + + void SetDimension ( unsigned short usDimension ); + void RelateDimension ( unsigned short usDimension ); + +protected: + void DoPulse ( void ); + + CClientPointLightsManager* m_pPointLightsManager; + + int m_iMode; + CVector m_vecPosition; + CVector m_vecDirection; + float m_fRadius; + SColor m_Color; + bool m_bCreatesShadow; + CClientEntity* m_pAffected; + + bool m_bStreamedIn; + +}; + +#endif \ No newline at end of file diff --git a/MTA10/mods/shared_logic/CClientPointLightsManager.cpp b/MTA10/mods/shared_logic/CClientPointLightsManager.cpp new file mode 100644 index 00000000000..76b0b2dd3d8 --- /dev/null +++ b/MTA10/mods/shared_logic/CClientPointLightsManager.cpp @@ -0,0 +1,105 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/CClientPointLightsManager.cpp +* PURPOSE: PointLights entity manager class +* DEVELOPERS: Alexander Romanov +* +*****************************************************************************/ + +#include "StdInc.h" + +using std::list; + +CClientPointLightsManager::CClientPointLightsManager ( CClientManager* pManager ) +{ + // Init + m_pManager = pManager; + m_bDontRemoveFromList = false; + m_usDimension = 0; +} + + +CClientPointLightsManager::~CClientPointLightsManager ( void ) +{ + // Make sure all the lights are deleted + DeleteAll (); +} + + +CClientPointLights* CClientPointLightsManager::Create ( ElementID EntityID ) +{ + if ( !Get ( EntityID ) ) + { + return new CClientPointLights ( m_pManager, EntityID ); + } + + return NULL; +} + + +void CClientPointLightsManager::Delete ( CClientPointLights* pLight ) +{ + delete pLight; +} + + +void CClientPointLightsManager::DeleteAll ( void ) +{ + // Delete all the lights + m_bDontRemoveFromList = true; + list < CClientPointLights* > ::const_iterator iter = m_List.begin (); + for ( ; iter != m_List.end (); iter++ ) + { + delete *iter; + } + m_bDontRemoveFromList = false; + + // Clear the list + m_List.clear (); +} + +CClientPointLights* CClientPointLightsManager::Get ( ElementID ID ) +{ + // Grab the element with the given id. Check its type. + CClientEntity* pEntity = CElementIDs::GetElement ( ID ); + if ( pEntity && pEntity->GetType () == CCLIENTPOINTLIGHTS ) + { + return static_cast < CClientPointLights* > ( pEntity ); + } + + return NULL; +} + + +void CClientPointLightsManager::SetDimension ( unsigned short usDimension ) +{ + list < CClientPointLights* > ::iterator iter = m_List.begin (); + for ( ; iter != m_List.end (); iter++ ) + { + (*iter)->RelateDimension ( usDimension ); + } + + m_usDimension = usDimension; +} + + +void CClientPointLightsManager::DoPulse ( void ) +{ + // Pulse each light + list < CClientPointLights* > ::const_iterator iter = m_List.begin (); + for ( ; iter != m_List.end (); ++iter ) + { + (*iter)->DoPulse (); + } +} + +void CClientPointLightsManager::RemoveFromList ( CClientPointLights* pLight ) +{ + if ( !m_bDontRemoveFromList ) + { + if ( !m_List.empty() ) m_List.remove ( pLight ); + } +} \ No newline at end of file diff --git a/MTA10/mods/shared_logic/CClientPointLightsManager.h b/MTA10/mods/shared_logic/CClientPointLightsManager.h new file mode 100644 index 00000000000..cef1c4ad1a8 --- /dev/null +++ b/MTA10/mods/shared_logic/CClientPointLightsManager.h @@ -0,0 +1,57 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/CClientPointLightsManager.h +* PURPOSE: PointLights entity manager class header +* DEVELOPERS: Alexander Romanov +* +*****************************************************************************/ + +#ifndef __CCLIENTPOINTLIGHTSMANAGER_H +#define __CCLIENTPOINTLIGHTSMANAGER_H + +#include "CClientPointLights.h" +#include +//class CClientPointLights; + +class CClientPointLightsManager +{ + friend class CClientManager; + friend class CClientPointLights; + +public: + CClientPointLightsManager ( CClientManager* pManager ); + ~CClientPointLightsManager ( void ); + + CClientPointLights* Create ( ElementID ID ); + + void Delete ( CClientPointLights* pLight ); + void DeleteAll ( void ); + + inline std::list < CClientPointLights* > ::const_iterator IterBegin ( void ) { return m_List.begin (); }; + inline std::list < CClientPointLights* > ::const_iterator IterEnd ( void ) { return m_List.end (); }; + + static CClientPointLights* Get ( ElementID ID ); + + unsigned short GetDimension ( void ) { return m_usDimension; }; + void SetDimension ( unsigned short usDimension ); + + void DoPulse ( void ); + +private: + + inline void AddToList ( CClientPointLights* pLight ) { m_List.push_back ( pLight ); }; + void RemoveFromList ( CClientPointLights* pLight ); + +private: + CClientManager* m_pManager; + + std::list < CClientPointLights* > m_List; + bool m_bDontRemoveFromList; + unsigned short m_usDimension; + +}; + +#endif \ No newline at end of file diff --git a/MTA10/mods/shared_logic/CClientProjectile.cpp b/MTA10/mods/shared_logic/CClientProjectile.cpp index f9b0198d973..f24873133fe 100644 --- a/MTA10/mods/shared_logic/CClientProjectile.cpp +++ b/MTA10/mods/shared_logic/CClientProjectile.cpp @@ -92,7 +92,6 @@ CClientProjectile::~CClientProjectile ( void ) { // Make sure we're destroyed delete m_pProjectile; - m_pProjectile = NULL; } @@ -107,13 +106,6 @@ void CClientProjectile::Unlink ( void ) { m_pProjectileManager->RemoveFromList ( this ); m_bLinked = false; - if ( m_pProjectile ) - { - // Make sure we're destroyed - delete m_pProjectile; - - m_pProjectile = NULL; - } } } diff --git a/MTA10/mods/shared_logic/CClientRenderElement.h b/MTA10/mods/shared_logic/CClientRenderElement.h index 40c002c9964..649b7ba979d 100644 --- a/MTA10/mods/shared_logic/CClientRenderElement.h +++ b/MTA10/mods/shared_logic/CClientRenderElement.h @@ -17,7 +17,7 @@ class CClientRenderElement : public CClientEntity CClientRenderElement ( CClientManager* pManager, ElementID ID ); ~CClientRenderElement ( void ); - void Unlink ( void ); + virtual void Unlink ( void ); void GetPosition ( CVector& vecPosition ) const { vecPosition = CVector (); } void SetPosition ( const CVector& vecPosition ) {} diff --git a/MTA10/mods/shared_logic/CClientRenderElementManager.cpp b/MTA10/mods/shared_logic/CClientRenderElementManager.cpp index 20eaad85ece..7cbff884ae8 100644 --- a/MTA10/mods/shared_logic/CClientRenderElementManager.cpp +++ b/MTA10/mods/shared_logic/CClientRenderElementManager.cpp @@ -28,6 +28,7 @@ CClientRenderElementManager::CClientRenderElementManager ( CClientManager* pClie m_uiStatsShaderCount = 0; m_uiStatsRenderTargetCount = 0; m_uiStatsScreenSourceCount = 0; + m_uiStatsWebBrowserCount = 0; } @@ -219,6 +220,35 @@ CClientScreenSource* CClientRenderElementManager::CreateScreenSource ( uint uiSi } +//////////////////////////////////////////////////////////////// +// +// CClientRenderElementManager::CreateWebBrowser +// +// +// +//////////////////////////////////////////////////////////////// +CClientWebBrowser* CClientRenderElementManager::CreateWebBrowser ( uint uiSizeX, uint uiSizeY, bool bIsLocal, bool bTransparent ) +{ + // Create the item + CWebBrowserItem* pWebBrowserItem = m_pRenderItemManager->CreateWebBrowser ( uiSizeX, uiSizeY ); + + // Check create worked + if ( !pWebBrowserItem ) + return NULL; + + // Create the element + CClientWebBrowser* pWebBrowserElement = new CClientWebBrowser ( m_pClientManager, INVALID_ELEMENT_ID, pWebBrowserItem, bIsLocal, bTransparent ); + + // Add to this manager's list + MapSet ( m_ItemElementMap, pWebBrowserItem, pWebBrowserElement ); + + // Update stats + m_uiStatsWebBrowserCount++; + + return pWebBrowserElement; +} + + //////////////////////////////////////////////////////////////// // // CClientRenderElementManager::FindAutoTexture @@ -291,6 +321,9 @@ void CClientRenderElementManager::Remove ( CClientRenderElement* pElement ) if ( pElement->IsA ( CClientScreenSource::GetClassId () ) ) m_uiStatsScreenSourceCount--; else + if ( pElement->IsA ( CClientWebBrowser::GetClassId () ) ) + m_uiStatsWebBrowserCount--; + else if ( pElement->IsA ( CClientTexture::GetClassId () ) ) m_uiStatsTextureCount--; diff --git a/MTA10/mods/shared_logic/CClientRenderElementManager.h b/MTA10/mods/shared_logic/CClientRenderElementManager.h index 8392527c4ea..5a8cf0a1247 100644 --- a/MTA10/mods/shared_logic/CClientRenderElementManager.h +++ b/MTA10/mods/shared_logic/CClientRenderElementManager.h @@ -17,6 +17,7 @@ class CClientTexture; class CClientShader; class CClientRenderTarget; class CClientScreenSource; +class CClientWebBrowser; class CClientRenderElementManager @@ -31,6 +32,7 @@ class CClientRenderElementManager CClientShader* CreateShader ( const SString& strFullFilePath, const SString& strRootPath, SString& strOutStatus, float fPriority, float fMaxDistance, bool bLayered, bool bDebug, int iTypeMask ); CClientRenderTarget* CreateRenderTarget ( uint uiSizeX, uint uiSizeY, bool bWithAlphaChannel ); CClientScreenSource* CreateScreenSource ( uint uiSizeX, uint uiSizeY ); + CClientWebBrowser* CreateWebBrowser ( uint uiSizeX, uint uiSizeY, bool bIsLocal, bool bTransparent ); CClientTexture* FindAutoTexture ( const SString& strFullFilePath, const SString& strUniqueName ); void Remove ( CClientRenderElement* pElement ); @@ -40,6 +42,7 @@ class CClientRenderElementManager uint GetShaderCount ( void ) { return m_uiStatsShaderCount; } uint GetRenderTargetCount ( void ) { return m_uiStatsRenderTargetCount; } uint GetScreenSourceCount ( void ) { return m_uiStatsScreenSourceCount; } + uint GetWebBrowserCount ( void ) { return m_uiStatsWebBrowserCount; } protected: CClientManager* m_pClientManager; CRenderItemManagerInterface* m_pRenderItemManager; @@ -51,4 +54,5 @@ class CClientRenderElementManager uint m_uiStatsShaderCount; uint m_uiStatsRenderTargetCount; uint m_uiStatsScreenSourceCount; + uint m_uiStatsWebBrowserCount; }; diff --git a/MTA10/mods/shared_logic/CClientTXD.cpp b/MTA10/mods/shared_logic/CClientTXD.cpp index 860ede6644a..b7129b3134e 100644 --- a/MTA10/mods/shared_logic/CClientTXD.cpp +++ b/MTA10/mods/shared_logic/CClientTXD.cpp @@ -34,21 +34,38 @@ CClientTXD::~CClientTXD ( void ) } -bool CClientTXD::LoadTXD ( const char* szFile, bool bFilteringEnabled ) +bool CClientTXD::LoadTXD ( const SString& strFile, bool bFilteringEnabled, bool bIsRawData ) { // Do load here to check for errors. - m_strFilename = szFile; m_bFilteringEnabled = bFilteringEnabled; - CBuffer buffer; - if ( !LoadFileData( buffer ) ) - return false; - return g_pGame->GetRenderWare()->ModelInfoTXDLoadTextures( &m_ReplacementTextures, buffer, m_bFilteringEnabled ); + m_bIsRawData = bIsRawData; + + if( !m_bIsRawData ) + { + m_strFilename = strFile; + CBuffer buffer; + if ( !LoadFileData( buffer ) ) + return false; + return g_pGame->GetRenderWare()->ModelInfoTXDLoadTextures( &m_ReplacementTextures, buffer, m_bFilteringEnabled ); + } + else + { + m_FileData = CBuffer( strFile, strFile.length() ); + if ( !g_pCore->GetNetwork()->CheckFile( "txd", "", m_FileData ) ) + return false; + + return g_pGame->GetRenderWare()->ModelInfoTXDLoadTextures( &m_ReplacementTextures, m_FileData, m_bFilteringEnabled ); + } } + bool CClientTXD::Import ( unsigned short usModelID ) { if ( usModelID >= CLOTHES_TEX_ID_FIRST && usModelID <= CLOTHES_TEX_ID_LAST ) { + if ( m_FileData.IsEmpty() && m_bIsRawData ) + return false; // Raw data has been freed already because texture was first used as non-clothes + // If using for clothes only, unload 'replacing model textures' stuff to save memory if ( !m_ReplacementTextures.textures.empty() && m_ReplacementTextures.usedInModelIds.empty() ) { @@ -61,6 +78,7 @@ bool CClientTXD::Import ( unsigned short usModelID ) if ( !LoadFileData( m_FileData ) ) return false; } + m_bUsingFileDataForClothes = true; g_pGame->GetRenderWare ()->ClothesAddReplacementTxd( m_FileData.GetData(), usModelID - CLOTHES_MODEL_ID_FIRST ); return true; } @@ -69,12 +87,28 @@ bool CClientTXD::Import ( unsigned short usModelID ) // Ensure loaded for replacing model textures if ( m_ReplacementTextures.textures.empty () ) { - CBuffer buffer; - if ( !LoadFileData( buffer ) ) - return false; - g_pGame->GetRenderWare()->ModelInfoTXDLoadTextures( &m_ReplacementTextures, buffer, m_bFilteringEnabled ); - if ( m_ReplacementTextures.textures.empty() ) - return false; + if( !m_bIsRawData ) + { + CBuffer buffer; + if ( !LoadFileData( buffer ) ) + return false; + g_pGame->GetRenderWare()->ModelInfoTXDLoadTextures( &m_ReplacementTextures, buffer, m_bFilteringEnabled ); + if ( m_ReplacementTextures.textures.empty() ) + return false; + } + else + { + g_pGame->GetRenderWare()->ModelInfoTXDLoadTextures( &m_ReplacementTextures, m_FileData, m_bFilteringEnabled ); + if ( m_ReplacementTextures.textures.empty() ) + return false; + } + } + + // If raw data and not used as clothes textures yet, then free raw data buffer to save RAM + if ( m_bIsRawData && !m_bUsingFileDataForClothes ) + { + // This means the texture can't be used for clothes now + m_FileData.Clear(); } // Have we got textures and haven't already imported into this model? @@ -124,5 +158,11 @@ bool CClientTXD::LoadFileData( CBuffer& buffer ) { buffer.LoadFromFile( m_strFilename ); g_pClientGame->GetResourceManager()->ValidateResourceFile( m_strFilename, buffer ); - return g_pCore->GetNetwork()->CheckFile( "txd", m_strFilename ); + return g_pCore->GetNetwork()->CheckFile( "txd", m_strFilename, buffer ); +} + +// Return true if data looks like TXD file contents +bool CClientTXD::IsTXDData ( const SString& strData ) +{ + return strData.length() > 32 && memcmp( strData, "\x16\x00\x00\x00", 4 ) == 0; } diff --git a/MTA10/mods/shared_logic/CClientTXD.h b/MTA10/mods/shared_logic/CClientTXD.h index 5ccdd3c8174..14135a285de 100644 --- a/MTA10/mods/shared_logic/CClientTXD.h +++ b/MTA10/mods/shared_logic/CClientTXD.h @@ -26,16 +26,19 @@ class CClientTXD : public CClientEntity void SetPosition ( const CVector& vecPosition ) {}; eClientEntityType GetType ( void ) const { return CCLIENTTXD; } - bool LoadTXD ( const char* szFile, bool bFilteringEnabled = true ); + bool LoadTXD ( const SString& strFile, bool bFilteringEnabled, bool bIsRawData ); bool Import ( unsigned short usModelID ); static bool IsImportableModel ( unsigned short usModelID ); + static bool IsTXDData ( const SString& strData ); protected: void Restream ( unsigned short usModel ); - bool LoadFileData ( CBuffer& buffer ); + bool LoadFileData ( CBuffer& buffer ); SString m_strFilename; bool m_bFilteringEnabled; + bool m_bIsRawData; + bool m_bUsingFileDataForClothes; CBuffer m_FileData; SReplacementTextures m_ReplacementTextures; }; diff --git a/MTA10/mods/shared_logic/CClientVehicle.cpp b/MTA10/mods/shared_logic/CClientVehicle.cpp index f474f20b916..d059bdedfac 100644 --- a/MTA10/mods/shared_logic/CClientVehicle.cpp +++ b/MTA10/mods/shared_logic/CClientVehicle.cpp @@ -1039,6 +1039,7 @@ void CClientVehicle::SetModelBlocking ( unsigned short usModel, unsigned char uc m_ucVariation2 = ucVariant2; // Set the new vehicle id and type + eClientVehicleType eOldVehicleType = m_eVehicleType; m_usModel = usModel; m_eVehicleType = CClientVehicleManager::GetVehicleType ( usModel ); m_bHasDamageModel = CClientVehicleManager::HasDamageModel ( m_eVehicleType ); @@ -1049,6 +1050,21 @@ void CClientVehicle::SetModelBlocking ( unsigned short usModel, unsigned char uc memset ( &m_ucWheelStates[0], 0, sizeof ( m_ucWheelStates ) ); } + // If this is a train unlink if we're going to be a non-train + if ( eOldVehicleType == CLIENTVEHICLE_TRAIN && m_eVehicleType != CLIENTVEHICLE_TRAIN) + { + if ( m_pNextLink != NULL ) + { + m_pNextLink->SetPreviousTrainCarriage ( NULL ); + m_pNextLink = NULL; + } + if ( m_pPreviousLink != NULL ) + { + m_pPreviousLink->SetNextTrainCarriage ( NULL ); + m_pPreviousLink = NULL; + } + } + // Check if we have landing gears and adjustable properties m_bHasLandingGear = DoCheckHasLandingGear (); m_bHasAdjustableProperty = CClientVehicleManager::HasAdjustableProperty ( m_usModel ); diff --git a/MTA10/mods/shared_logic/CClientWeapon.cpp b/MTA10/mods/shared_logic/CClientWeapon.cpp index fcf8bc5aafa..6fbd4f1b292 100644 --- a/MTA10/mods/shared_logic/CClientWeapon.cpp +++ b/MTA10/mods/shared_logic/CClientWeapon.cpp @@ -446,12 +446,7 @@ void CClientWeapon::FireInstantHit ( CVector vecOrigin, CVector vecTarget, bool m_pMarker2->SetPosition ( vecTarget ); #endif m_pWeapon->DoBulletImpact ( m_pObject, pEntity, &vecOrigin, &vecTarget, pColPoint, 0 ); - if ( pColEntity && pColEntity->GetEntityType () == ENTITY_TYPE_PED ) - { - ePedPieceTypes hitZone = ( ePedPieceTypes ) pColPoint->GetPieceTypeB (); - short sDamage = m_pWeaponInfo->GetDamagePerHit (); - m_pWeapon->GenerateDamageEvent ( dynamic_cast < CPed * > ( pColEntity ), m_pObject, m_Type, sDamage, hitZone, 0 ); - } + if ( !IsLocalEntity ( ) && m_pOwner ) { CClientPed * pPed = m_pOwner; @@ -680,7 +675,7 @@ void CClientWeapon::DoGunShells ( CVector vecOrigin, CVector vecDirection ) { if ( !m_weaponConfig.bDisableWeaponModel ) { - g_pGame->GetPointLights ()->AddLight ( PLTYPE_POINTLIGHT, vecOrigin, CVector (), 3.0f, 0.22f, 0.25f, 0, 0, 0, 0 ); + g_pGame->GetPointLights ()->AddLight ( PLTYPE_POINTLIGHT, vecOrigin, CVector (), 3.0f, SColorRGBA ( 220, 255, 0, 0 ), 0, 0, 0 ); // Note: Nozzle flare lags behind attached object if it is moving, but we can't set attached entity here as it will crash if not a ped g_pGame->GetFx ()->TriggerGunshot ( NULL, vecOrigin, vecDirection, true ); diff --git a/MTA10/mods/shared_logic/CClientWebBrowser.cpp b/MTA10/mods/shared_logic/CClientWebBrowser.cpp new file mode 100644 index 00000000000..c3fe02fb764 --- /dev/null +++ b/MTA10/mods/shared_logic/CClientWebBrowser.cpp @@ -0,0 +1,220 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/CClientWebBrowser.cpp +* PURPOSE: ClientEntity webbrowser tab class +* +*****************************************************************************/ + +#include "StdInc.h" +#include "CClientWebBrowser.h" + +CClientWebBrowser::CClientWebBrowser ( CClientManager* pManager, ElementID ID, CWebBrowserItem* pWebBrowserItem, bool bLocal, bool bTransparent ) + : ClassInit ( this ), CClientTexture ( pManager, ID, pWebBrowserItem ) +{ + m_pResource = nullptr; + SetTypeName ( "webbrowser" ); + + // Create the web view + m_pWebView = g_pCore->GetWebCore ()->CreateWebView ( pWebBrowserItem->m_uiSizeX, pWebBrowserItem->m_uiSizeY, bLocal, pWebBrowserItem, bTransparent ); + + // Set events interface + m_pWebView->SetWebBrowserEvents ( this ); + + // Initialise the webview after setting the events interface + m_pWebView->Initialise (); +} + +CClientWebBrowser::~CClientWebBrowser () +{ + g_pCore->GetWebCore()->DestroyWebView ( m_pWebView ); + m_pWebView = nullptr; + + // Unlink from tree + Unlink (); +} + +void CClientWebBrowser::Unlink () +{ + // Mark as being destroyed (DirectX surfaces won't be available anymore) + if ( m_pWebView ) + m_pWebView->SetBeingDestroyed ( true ); + + CClientRenderElement::Unlink (); +} + +bool CClientWebBrowser::IsLoading () +{ + return m_pWebView->IsLoading (); +} + +bool CClientWebBrowser::LoadURL ( const SString& strURL, bool bFilterEnabled ) +{ + return m_pWebView->LoadURL ( strURL, bFilterEnabled ); +} + +void CClientWebBrowser::GetTitle ( SString& outPageTitle ) +{ + m_pWebView->GetTitle ( outPageTitle ); +} + +void CClientWebBrowser::GetURL ( SString& outURL ) +{ + m_pWebView->GetURL ( outURL ); +} + +void CClientWebBrowser::SetRenderingPaused ( bool bPaused ) +{ + m_pWebView->SetRenderingPaused ( bPaused ); +} + +void CClientWebBrowser::Focus () +{ + m_pWebView->Focus (); +} + +bool CClientWebBrowser::ExecuteJavascript ( const SString& strJavascriptCode ) +{ + // Don't allow javascript code execution on remote websites + if ( !m_pWebView->IsLocal () ) + return false; + + m_pWebView->ExecuteJavascript ( strJavascriptCode ); + return true; +} + +void CClientWebBrowser::InjectMouseMove ( int iPosX, int iPosY ) +{ + m_pWebView->InjectMouseMove ( iPosX, iPosY ); +} + +void CClientWebBrowser::InjectMouseDown ( eWebBrowserMouseButton mouseButton ) +{ + m_pWebView->InjectMouseDown ( mouseButton ); +} + +void CClientWebBrowser::InjectMouseUp ( eWebBrowserMouseButton mouseButton ) +{ + m_pWebView->InjectMouseUp ( mouseButton ); +} + +void CClientWebBrowser::InjectMouseWheel ( int iScrollVert, int iScrollHorz ) +{ + m_pWebView->InjectMouseWheel ( iScrollVert, iScrollHorz ); +} + +bool CClientWebBrowser::IsLocal () +{ + return m_pWebView->IsLocal (); +} + +void CClientWebBrowser::SetTempURL ( const SString& strTempURL ) +{ + m_pWebView->SetTempURL ( strTempURL ); +} + +bool CClientWebBrowser::SetAudioVolume ( float fVolume ) +{ + return m_pWebView->SetAudioVolume ( fVolume ); +} + +//////////////////////////////////////////////////////////////////////////// +// // +// CWebBrowserEventsInterface implementation // +// // +//////////////////////////////////////////////////////////////////////////// +void CClientWebBrowser::Events_OnCreated () +{ + CLuaArguments Arguments; + CallEvent ( "onClientBrowserCreated", Arguments, false ); +} + +void CClientWebBrowser::Events_OnDocumentReady ( const SString& strURL ) +{ + CLuaArguments Arguments; + Arguments.PushString ( strURL ); + CallEvent ( "onClientBrowserDocumentReady", Arguments, false ); +} + +void CClientWebBrowser::Events_OnLoadingFailed ( const SString& strURL, int errorCode, const SString& errorDescription ) +{ + CLuaArguments Arguments; + Arguments.PushString ( strURL ); + Arguments.PushNumber ( errorCode ); + Arguments.PushString ( errorDescription ); + CallEvent ( "onClientBrowserLoadingFailed", Arguments, false ); +} + +void CClientWebBrowser::Events_OnNavigate ( const SString& strURL, bool bMainFrame ) +{ + CLuaArguments Arguments; + Arguments.PushString ( strURL ); + Arguments.PushBoolean ( bMainFrame ); + CallEvent ( "onClientBrowserNavigate", Arguments, false ); +} + +void CClientWebBrowser::Events_OnPopup ( const SString& strTargetURL, const SString& strOpenerURL ) +{ + CLuaArguments Arguments; + Arguments.PushString ( strTargetURL ); + Arguments.PushString ( strOpenerURL ); + CallEvent ( "onClientBrowserPopup", Arguments, false ); +} + +void CClientWebBrowser::Events_OnChangeCursor(unsigned char ucCursor) +{ + CLuaArguments Arguments; + Arguments.PushNumber ( ucCursor ); + CallEvent ( "onClientBrowserCursorChange", Arguments, false ); +} + +void CClientWebBrowser::Events_OnTriggerEvent ( const SString& strEventName, const std::vector& arguments, bool bIsServer ) +{ + CLuaArguments Arguments; + for ( std::vector::const_iterator iter = arguments.begin (); iter != arguments.end (); ++iter ) + { + Arguments.PushString ( *iter ); + } + + if ( bIsServer ) + { + CStaticFunctionDefinitions::TriggerServerEvent ( strEventName, *g_pClientGame->GetRootEntity (), Arguments ); + } + else + { + bool bWasCancelled; + CStaticFunctionDefinitions::TriggerEvent ( strEventName, *this, Arguments, bWasCancelled ); + } +} + +void CClientWebBrowser::Events_OnTooltip ( const SString& strTooltip ) +{ + CLuaArguments Arguments; + Arguments.PushString ( strTooltip ); + CallEvent ( "onClientBrowserTooltip", Arguments, false ); +} + +void CClientWebBrowser::Events_OnInputFocusChanged ( bool bGainedFocus ) +{ + CLuaArguments Arguments; + Arguments.PushBoolean ( bGainedFocus ); + CallEvent ( "onClientBrowserInputFocusChanged", Arguments, false ); +} + +bool CClientWebBrowser::Events_OnResourcePathCheck ( SString& strURL ) +{ + // ATTENTION: This method is called within a secondary thread so be sure to use only thread safe functions + + // If no resource is set, we are allowed to use the requested file + if ( !m_pResource ) + return true; + + CResource* pTempResource = m_pResource; // Make a copy to ignore a changed resource + if ( CResourceManager::ParseResourcePathInput ( strURL, pTempResource, strURL ) ) + return true; + + return false; +} + diff --git a/MTA10/mods/shared_logic/CClientWebBrowser.h b/MTA10/mods/shared_logic/CClientWebBrowser.h new file mode 100644 index 00000000000..702703f3a5e --- /dev/null +++ b/MTA10/mods/shared_logic/CClientWebBrowser.h @@ -0,0 +1,69 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/CClientWebBrowser.h +* PURPOSE: ClientEntity webbrowser tab class +* +*****************************************************************************/ + +#ifndef __CCLIENTWEBBROWSER_H +#define __CCLIENTWEBBROWSER_H + +#include +#include + +class CClientWebBrowser : public CClientTexture, public CWebBrowserEventsInterface +{ + DECLARE_CLASS(CClientWebBrowser, CClientTexture) +public: + CClientWebBrowser ( CClientManager* pManager, ElementID ID, CWebBrowserItem* pWebBrowserItem, bool bLocal, bool bTransparent ); + ~CClientWebBrowser (); + eClientEntityType GetType ( ) const { return CCLIENTBROWSER; } + virtual void Unlink () override; + + inline CWebBrowserItem* GetWebBrowserItem () { return (CWebBrowserItem*)m_pRenderItem; } + inline CWebViewInterface* GetWebView () { return m_pWebView; } + + bool IsLoading (); + bool LoadURL ( const SString& strURL, bool bFilterEnabled = true ); + void GetTitle ( SString& outPageTitle ); + void GetURL ( SString& outURL ); + void SetRenderingPaused ( bool bPaused ); + void Focus (); + + bool ExecuteJavascript ( const SString& strJavascriptCode ); + + void InjectMouseMove ( int iPosX, int iPosY ); + void InjectMouseDown ( eWebBrowserMouseButton mouseButton ); + void InjectMouseUp ( eWebBrowserMouseButton mouseButton ); + void InjectMouseWheel ( int iScrollVert, int iScrollHorz ); + + bool IsLocal (); + void SetTempURL ( const SString& strTempURL ); + + inline CResource* GetResource () { return m_pResource; } + inline void SetResource ( CResource* pResource ) { m_pResource = pResource; } + + bool SetAudioVolume ( float fVolume ); + + + // CWebBrowserEventsInterface implementation + void Events_OnCreated () override; + void Events_OnDocumentReady ( const SString& strURL ) override; + void Events_OnLoadingFailed ( const SString& strURL, int errorCode, const SString& errorDescription ) override; + void Events_OnNavigate ( const SString& strURL, bool bMainFrame ) override; + void Events_OnPopup ( const SString& strTargetURL, const SString& strOpenerURL ) override; + void Events_OnChangeCursor ( unsigned char ucCursor ) override; + void Events_OnTriggerEvent ( const SString& strEventName, const std::vector& arguments, bool bIsServer = false ) override; + void Events_OnTooltip ( const SString& strTooltip ) override; + void Events_OnInputFocusChanged ( bool bGainedFocus ) override; + bool Events_OnResourcePathCheck ( SString& strURL ) override; + +private: + CWebViewInterface* m_pWebView; + CResource* m_pResource; +}; + +#endif diff --git a/MTA10/mods/shared_logic/CScriptDebugging.cpp b/MTA10/mods/shared_logic/CScriptDebugging.cpp index 7753be01b50..bb54fb3e744 100644 --- a/MTA10/mods/shared_logic/CScriptDebugging.cpp +++ b/MTA10/mods/shared_logic/CScriptDebugging.cpp @@ -175,7 +175,7 @@ void CScriptDebugging::LogBadLevel ( lua_State* luaVM, unsigned int uiRequiredLe // Handle filename/line number in string -void CScriptDebugging::LogPCallError( lua_State* luaVM, const SString& strRes, const SString& strNiceFilename ) +void CScriptDebugging::LogPCallError( lua_State* luaVM, const SString& strRes, bool bInitialCall ) { std::vector < SString > vecSplit; strRes.Split( ":", vecSplit ); @@ -187,20 +187,18 @@ void CScriptDebugging::LogPCallError( lua_State* luaVM, const SString& strRes, c int iLine = atoi( vecSplit[ 1 ] ); SString strMsg = vecSplit[2].SubStr( 1 ); - LogError ( SLuaDebugInfo( strFile, iLine ), "%s", *strMsg ); + if ( iLine == 0 && bInitialCall ) + { + // Location hint for compiled scripts + LogError ( SLuaDebugInfo( strFile, iLine ), "(global scope) %s", *strMsg ); + } + else + LogError ( SLuaDebugInfo( strFile, iLine ), "%s", *strMsg ); } else { // File+line info not present - if ( !strNiceFilename.empty() && !strRes.ContainsI( ExtractFilename( strNiceFilename ) ) ) - { - // Add filename to error message, if not already present - LogError( luaVM, "%s (global scope) - %s", *strNiceFilename, *strRes ); - } - else - { - LogError( luaVM, "%s", strRes.c_str () ); - } + LogError( luaVM, "%s", strRes.c_str () ); } } diff --git a/MTA10/mods/shared_logic/CScriptDebugging.h b/MTA10/mods/shared_logic/CScriptDebugging.h index 5659c4cbf96..94f55d6bb79 100644 --- a/MTA10/mods/shared_logic/CScriptDebugging.h +++ b/MTA10/mods/shared_logic/CScriptDebugging.h @@ -41,7 +41,7 @@ class CScriptDebugging void LogCustom ( lua_State* luaVM, const char* szMessage ); void LogWarning ( const SLuaDebugInfo& luaDebugInfo, const char* szFormat, ... ); void LogError ( const SLuaDebugInfo& luaDebugInfo, const char* szFormat, ... ); - void LogPCallError ( lua_State* luaVM, const SString& strRes, const SString& strNiceFilename = "" ); + void LogPCallError ( lua_State* luaVM, const SString& strRes, bool bInitialCall = false ); bool SetLogfile ( const char* szFilename, unsigned int uiLevel ); diff --git a/MTA10/mods/shared_logic/lua/CLuaArgument.cpp b/MTA10/mods/shared_logic/lua/CLuaArgument.cpp index 278c9e96caf..5930d2d8ce6 100644 --- a/MTA10/mods/shared_logic/lua/CLuaArgument.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaArgument.cpp @@ -368,6 +368,16 @@ void CLuaArgument::ReadElementID ( ElementID ID ) } +void CLuaArgument::ReadTable ( CLuaArguments * table ) +{ + m_strString = ""; + DeleteTableData (); + m_pTableData = new CLuaArguments ( *table ); + m_bWeakTableRef = false; + m_iType = LUA_TTABLE; +} + + CClientEntity* CLuaArgument::GetElement ( void ) const { ElementID ID = TO_ELEMENTID ( m_pUserData ); diff --git a/MTA10/mods/shared_logic/lua/CLuaArgument.h b/MTA10/mods/shared_logic/lua/CLuaArgument.h index dbd07d7ef88..19a0e7c611e 100644 --- a/MTA10/mods/shared_logic/lua/CLuaArgument.h +++ b/MTA10/mods/shared_logic/lua/CLuaArgument.h @@ -50,6 +50,7 @@ class CLuaArgument void ReadElement ( CClientEntity* pElement ); void ReadScriptID ( uint uiScriptID ); void ReadElementID ( ElementID ID ); + void ReadTable ( class CLuaArguments * table ); void Push ( lua_State* luaVM, CFastHashMap < CLuaArguments*, int > * pKnownTables = NULL ) const; diff --git a/MTA10/mods/shared_logic/lua/CLuaArguments.cpp b/MTA10/mods/shared_logic/lua/CLuaArguments.cpp index ba58c6272a2..9628a3d3fc4 100644 --- a/MTA10/mods/shared_logic/lua/CLuaArguments.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaArguments.cpp @@ -378,6 +378,15 @@ CLuaArgument* CLuaArguments::PushArgument ( const CLuaArgument& Argument ) } +CLuaArgument* CLuaArguments::PushTable ( CLuaArguments * table ) +{ + CLuaArgument* pArgument = new CLuaArgument ( ); + pArgument->ReadTable ( table ); + m_Arguments.push_back ( pArgument ); + return pArgument; +} + + void CLuaArguments::DeleteArguments ( void ) { // Delete each item diff --git a/MTA10/mods/shared_logic/lua/CLuaArguments.h b/MTA10/mods/shared_logic/lua/CLuaArguments.h index 6351f0afcea..86d4393c030 100644 --- a/MTA10/mods/shared_logic/lua/CLuaArguments.h +++ b/MTA10/mods/shared_logic/lua/CLuaArguments.h @@ -67,6 +67,7 @@ class CLuaArguments CLuaArgument* PushElement ( CClientEntity* pElement ); CLuaArgument* PushArgument ( const CLuaArgument& argument ); CLuaArgument* PushResource ( CResource* pResource ); + CLuaArgument* PushTable ( CLuaArguments * table ); void DeleteArguments ( void ); diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Browser.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Browser.cpp new file mode 100644 index 00000000000..54febd11cb3 --- /dev/null +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Browser.cpp @@ -0,0 +1,412 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/lua/CLuaFunctionDefs.Browser.cpp +* PURPOSE: Lua function definitions class +* +*****************************************************************************/ + +#include "StdInc.h" + +int CLuaFunctionDefs::CreateBrowser ( lua_State* luaVM ) +{ +// texture createBrowser ( int width, int height, bool isLocal [, bool transparent = false] ) + CVector2D vecSize; bool bIsLocal; bool bTransparent; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadVector2D ( vecSize ); + argStream.ReadBool ( bIsLocal ); + argStream.ReadBool ( bTransparent, false ); + + if ( !argStream.HasErrors () ) + { + if ( !bIsLocal && !g_pCore->GetWebCore()->CanLoadRemotePages () ) + { + lua_pushboolean ( luaVM, false ); + return 1; + } + + CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM ); + if ( pLuaMain ) + { + CResource* pParentResource = pLuaMain->GetResource (); + + CClientWebBrowser* pBrowserTexture = g_pClientGame->GetManager ()->GetRenderElementManager ()->CreateWebBrowser ( (int)vecSize.fX, (int)vecSize.fY, bIsLocal, bTransparent ); + if ( pBrowserTexture ) + { + // Make it a child of the resource's file root ** CHECK Should parent be pFileResource, and element added to pParentResource's ElementGroup? ** + pBrowserTexture->SetParent ( pParentResource->GetResourceDynamicEntity () ); + + // Set our owner resource + pBrowserTexture->SetResource ( pParentResource ); + } + lua_pushelement ( luaVM, pBrowserTexture ); + return 1; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::RequestBrowserDomains ( lua_State* luaVM ) +{ +// bool requestBrowserDomains ( table domains ) + std::vector pages; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadStringTable ( pages ); + + if ( !argStream.HasErrors () ) + { + g_pCore->GetWebCore ()->RequestPages ( pages ); + // Todo: Add a callback or event to check if the pagerequest dialog was successfully done + lua_pushboolean ( luaVM, true ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::LoadBrowserURL ( lua_State* luaVM ) +{ +// bool loadBrowserURL(browser webBrowser, string url) + CClientWebBrowser* pWebBrowser; SString strURL; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadString ( strURL ); + + if ( !argStream.HasErrors () ) + { + // Are we dealing with a remote website? + if ( strURL.substr ( 0, 7 ) == "http://" || strURL.substr ( 0, 8 ) == "https://" ) + { + lua_pushboolean ( luaVM, pWebBrowser->LoadURL ( strURL, true ) ); + return 1; + } + + // Are we dealing with a local website? If so, parse resource path. Otherwise, return false and load nothing + // Todo: Add an ACL right which is necessary to load local websites or websites in general + CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM ); + if ( pLuaMain ) + { + SString strAbsPath; + CResource* pResource = pLuaMain->GetResource (); + if ( CResourceManager::ParseResourcePathInput ( strURL, pResource, strAbsPath ) && pWebBrowser->IsLocal () ) + { + pWebBrowser->SetTempURL ( strURL ); + lua_pushboolean ( luaVM, pWebBrowser->LoadURL ( "mtalocal://" + strURL, false ) ); + return 1; + } + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::IsBrowserLoading ( lua_State* luaVM ) +{ +// bool isBrowserLoading(browser webBrowser) + CClientWebBrowser* pWebBrowser; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + + if ( !argStream.HasErrors () ) + { + lua_pushboolean ( luaVM, pWebBrowser->IsLoading () ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushnil ( luaVM ); + return 1; +} + +int CLuaFunctionDefs::InjectBrowserMouseMove ( lua_State* luaVM ) +{ +// bool injectBrowserMouseMove(browser webBrowser, int x, int y) + CClientWebBrowser* pWebBrowser; CVector2D vecPosition; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadVector2D ( vecPosition ); + + if ( !argStream.HasErrors () ) + { + pWebBrowser->InjectMouseMove ( (int)vecPosition.fX, (int)vecPosition.fY ); + lua_pushboolean ( luaVM, true ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::InjectBrowserMouseDown ( lua_State* luaVM ) +{ +// bool injectBrowserMouseDown ( browser webBrowser, string mouseButton ) + CClientWebBrowser* pWebBrowser; eWebBrowserMouseButton mouseButton; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadEnumString ( mouseButton ); + + if ( !argStream.HasErrors () ) + { + pWebBrowser->InjectMouseDown ( mouseButton ); + lua_pushboolean ( luaVM, true ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::InjectBrowserMouseUp ( lua_State* luaVM ) +{ +// bool injectBrowserMouseUp ( browser webBrowser, string mouseButton ) + CClientWebBrowser* pWebBrowser; eWebBrowserMouseButton mouseButton; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadEnumString ( mouseButton ); + + if ( !argStream.HasErrors () ) + { + pWebBrowser->InjectMouseUp ( mouseButton ); + lua_pushboolean ( luaVM, true ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::InjectBrowserMouseWheel ( lua_State* luaVM ) +{ +// bool injectMouseWheel ( browser webBrowser, int scrollVertical, int scrollHorizontal ) + CClientWebBrowser* pWebBrowser; int iScrollVert; int iScrollHorz; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadNumber ( iScrollVert ); + argStream.ReadNumber ( iScrollHorz ); + + if ( !argStream.HasErrors() ) + { + pWebBrowser->InjectMouseWheel ( iScrollVert, iScrollHorz ); + lua_pushboolean ( luaVM, true ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::GetBrowserTitle ( lua_State* luaVM ) +{ +// string getBrowserPageTitle ( browser webBrowser ) + CClientWebBrowser* pWebBrowser; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + + if ( !argStream.HasErrors () ) + { + SString strPageTitle; + pWebBrowser->GetTitle ( strPageTitle ); + + lua_pushstring ( luaVM, strPageTitle ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::GetBrowserURL ( lua_State* luaVM ) +{ +// string getBrowserURL ( browser webBrowser ) + CClientWebBrowser* pWebBrowser; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + + if ( !argStream.HasErrors () ) + { + SString strURL; + pWebBrowser->GetURL ( strURL ); + + lua_pushstring ( luaVM, strURL ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::SetBrowserRenderingPaused ( lua_State* luaVM ) +{ +// bool setBrowserRenderingPaused ( browser webBrowser, bool paused ) + CClientWebBrowser* pWebBrowser; bool bPaused; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadBool ( bPaused ); + + if ( !argStream.HasErrors () ) + { + pWebBrowser->SetRenderingPaused ( bPaused ); + lua_pushboolean ( luaVM, true ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::ExecuteBrowserJavascript ( lua_State* luaVM ) +{ +// bool executeBrowserJavascript ( browser webBrowser, string jsCode ) + CClientWebBrowser* pWebBrowser; SString strJavascriptCode; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadString ( strJavascriptCode ); + + if ( !argStream.HasErrors () ) + { + lua_pushboolean ( luaVM, pWebBrowser->ExecuteJavascript ( strJavascriptCode ) ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::SetBrowserVolume ( lua_State* luaVM ) +{ +// bool setBrowserVolume ( float volume ) +// bool setBrowserVolume ( browser webBrowser, float volume ) + CClientWebBrowser* pWebBrowser; float fVolume; + + CScriptArgReader argStream ( luaVM ); + if ( argStream.NextIsNumber () ) + { + argStream.ReadNumber ( fVolume ); + lua_pushboolean ( luaVM, g_pCore->GetWebCore ()->SetGlobalAudioVolume ( fVolume ) ); + return 1; + } + + argStream.ReadUserData ( pWebBrowser ); + argStream.ReadNumber ( fVolume ); + + if ( !argStream.HasErrors () ) + { + lua_pushboolean ( luaVM, pWebBrowser->SetAudioVolume ( fVolume ) ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::IsBrowserDomainBlocked ( lua_State* luaVM ) +{ +// bool isBrowserDomainBlocked ( string url ) + SString strURL; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadString ( strURL ); + + if ( !argStream.HasErrors () ) + { + lua_pushboolean ( luaVM, g_pCore->GetWebCore ()->GetURLState ( strURL ) != eURLState::WEBPAGE_ALLOWED ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::FocusBrowser ( lua_State* luaVM ) +{ +// focusBrowser ( browser webBrowser ) + CClientWebBrowser* pWebBrowser; + + CScriptArgReader argStream ( luaVM ); + if ( argStream.NextIsNil () || argStream.NextIsNone () ) + { + g_pCore->GetWebCore ()->SetFocusedWebView ( NULL ); + lua_pushboolean ( luaVM, true ); + return 1; + } + + argStream.ReadUserData ( pWebBrowser ); + + if ( !argStream.HasErrors () ) + { + pWebBrowser->Focus (); + lua_pushboolean ( luaVM, true ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage () ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + +int CLuaFunctionDefs::IsBrowserFocused ( lua_State* luaVM ) +{ +// browser isBrowserFocused () + CClientWebBrowser* pWebBrowser; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pWebBrowser ); + + if ( !argStream.HasErrors () ) + { + CWebViewInterface* pWebView = g_pCore->GetWebCore ()->GetFocusedWebView (); + lua_pushboolean ( luaVM, pWebBrowser->GetWebView () == pWebView ); + return 1; + } + else + m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() ); + + lua_pushnil ( luaVM ); + return 1; +} diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Camera.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Camera.cpp index ac2e6c56bbe..0d9ca3527c5 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Camera.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Camera.cpp @@ -156,7 +156,7 @@ int CLuaFunctionDefs::SetCameraTarget ( lua_State* luaVM ) // bool setCameraTarget ( element target = nil ) or setCameraTarget ( float x, float y, float z ) CScriptArgReader argStream ( luaVM ); - if ( argStream.NextIsUserData () ) + if ( argStream.NextIsUserDataOfType () ) { CClientEntity* pTarget; argStream.ReadUserData ( pTarget ); diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Engine.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Engine.cpp index edb35401047..9b2c13bf6ce 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Engine.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Engine.cpp @@ -23,7 +23,7 @@ int CLuaFunctionDefs::EngineLoadCOL ( lua_State* luaVM ) { SString strFile = ""; CScriptArgReader argStream ( luaVM ); - // Grab the COL filename + // Grab the COL filename or data argStream.ReadString ( strFile ); if ( !argStream.HasErrors ( ) ) @@ -36,10 +36,10 @@ int CLuaFunctionDefs::EngineLoadCOL ( lua_State* luaVM ) CResource* pResource = pLuaMain->GetResource (); if ( pResource ) { - + bool bIsRawData = CClientColModel::IsCOLData( strFile ); SString strPath; // Is this a legal filepath? - if ( CResourceManager::ParseResourcePathInput( strFile, pResource, strPath ) ) + if ( bIsRawData || CResourceManager::ParseResourcePathInput( strFile, pResource, strPath ) ) { // Grab the resource root entity CClientEntity* pRoot = pResource->GetResourceCOLModelRoot (); @@ -48,7 +48,7 @@ int CLuaFunctionDefs::EngineLoadCOL ( lua_State* luaVM ) CClientColModel* pCol = new CClientColModel ( m_pManager, INVALID_ELEMENT_ID ); // Attempt loading the file - if ( pCol->LoadCol ( strPath ) ) + if ( pCol->LoadCol ( bIsRawData ? strFile : strPath, bIsRawData ) ) { // Success. Make it a child of the resource collision root pCol->SetParent ( pRoot ); @@ -61,11 +61,11 @@ int CLuaFunctionDefs::EngineLoadCOL ( lua_State* luaVM ) { // Delete it again. We failed delete pCol; - argStream.SetCustomError( strFile, "Error loading COL" ); + argStream.SetCustomError( bIsRawData ? "raw data" : strFile, "Error loading COL" ); } } else - argStream.SetCustomError( strFile, "Bad file path" ); + argStream.SetCustomError( bIsRawData ? "raw data" : strFile, "Bad file path" ); } } } @@ -82,7 +82,7 @@ int CLuaFunctionDefs::EngineLoadDFF ( lua_State* luaVM ) { SString strFile = ""; CScriptArgReader argStream ( luaVM ); - // Grab the DFF filename (model ID ignored after 1.3.1) + // Grab the DFF filename or data (model ID ignored after 1.3.1) argStream.ReadString ( strFile ); if ( !argStream.HasErrors ( ) ) @@ -95,9 +95,10 @@ int CLuaFunctionDefs::EngineLoadDFF ( lua_State* luaVM ) CResource* pResource = pLuaMain->GetResource (); if ( pResource ) { + bool bIsRawData = CClientDFF::IsDFFData( strFile ); SString strPath; // Is this a legal filepath? - if ( CResourceManager::ParseResourcePathInput( strFile, pResource, strPath ) ) + if ( bIsRawData || CResourceManager::ParseResourcePathInput( strFile, pResource, strPath ) ) { // Grab the resource root entity CClientEntity* pRoot = pResource->GetResourceDFFRoot (); @@ -106,7 +107,7 @@ int CLuaFunctionDefs::EngineLoadDFF ( lua_State* luaVM ) CClientDFF* pDFF = new CClientDFF ( m_pManager, INVALID_ELEMENT_ID ); // Try to load the DFF file - if ( pDFF->LoadDFF ( strPath ) ) + if ( pDFF->LoadDFF ( bIsRawData ? strFile : strPath, bIsRawData ) ) { // Success loading the file. Set parent to DFF root pDFF->SetParent ( pRoot ); @@ -119,11 +120,11 @@ int CLuaFunctionDefs::EngineLoadDFF ( lua_State* luaVM ) { // Delete it again delete pDFF; - argStream.SetCustomError( strFile, "Error loading DFF" ); + argStream.SetCustomError( bIsRawData ? "raw data" : strFile, "Error loading DFF" ); } } else - argStream.SetCustomError( strFile, "Bad file path" ); + argStream.SetCustomError( bIsRawData ? "raw data" : strFile, "Bad file path" ); } } } @@ -141,7 +142,7 @@ int CLuaFunctionDefs::EngineLoadTXD ( lua_State* luaVM ) SString strFile = ""; bool bFilteringEnabled = true; CScriptArgReader argStream ( luaVM ); - // Grab the TXD filename + // Grab the TXD filename or data argStream.ReadString ( strFile ); if ( argStream.NextIsBool() ) // Some scripts have a number here (in error) argStream.ReadBool ( bFilteringEnabled, true ); @@ -156,9 +157,10 @@ int CLuaFunctionDefs::EngineLoadTXD ( lua_State* luaVM ) CResource* pResource = pLuaMain->GetResource (); if ( pResource ) { + bool bIsRawData = CClientTXD::IsTXDData( strFile ); SString strPath; // Is this a legal filepath? - if ( CResourceManager::ParseResourcePathInput( strFile, pResource, strPath ) ) + if ( bIsRawData || CResourceManager::ParseResourcePathInput( strFile, pResource, strPath ) ) { // Grab the resource root entity CClientEntity* pRoot = pResource->GetResourceTXDRoot (); @@ -167,7 +169,7 @@ int CLuaFunctionDefs::EngineLoadTXD ( lua_State* luaVM ) CClientTXD* pTXD = new CClientTXD ( m_pManager, INVALID_ELEMENT_ID ); // Try to load the TXD file - if ( pTXD->LoadTXD ( strPath, bFilteringEnabled ) ) + if ( pTXD->LoadTXD ( bIsRawData ? strFile : strPath, bFilteringEnabled, bIsRawData ) ) { // Success loading the file. Set parent to TXD root pTXD->SetParent ( pRoot ); @@ -180,15 +182,15 @@ int CLuaFunctionDefs::EngineLoadTXD ( lua_State* luaVM ) { // Delete it again delete pTXD; - m_pScriptDebugging->LogCustom ( luaVM, SString ( "Load error @ '%s' [Unable to load '%s']", "engineLoadTXD", *strFile ) ); + argStream.SetCustomError( bIsRawData ? "raw data" : strFile, "Error loading TXD" ); } } else - m_pScriptDebugging->LogBadPointer ( luaVM, "string", 1 ); + argStream.SetCustomError( bIsRawData ? "raw data" : strFile, "Bad file path" ); } } } - else + if ( argStream.HasErrors() ) m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() ); // We failed diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Event.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Event.cpp index 76c0fb8300d..32f8458a494 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Event.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Event.cpp @@ -88,20 +88,20 @@ int CLuaFunctionDefs::AddEventHandler ( lua_State* luaVM ) // Check if the handle is in use if ( pEntity->GetEventManager()->HandleExists ( pLuaMain, strName, iLuaFunction ) ) { - m_pScriptDebugging->LogCustom ( luaVM, 255, 0, 0, "%s: '%s' with this function is already handled", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *strName ); - lua_pushboolean ( luaVM, false ); - return 1; + argStream.SetCustomError ( SString ( "'%s' with this function is already handled", *strName ) ); } - - // Do it - if ( CStaticFunctionDefinitions::AddEventHandler ( *pLuaMain, strName, *pEntity, iLuaFunction, bPropagated, eventPriority, fPriorityMod ) ) + else { - lua_pushboolean ( luaVM, true ); - return 1; + // Do it + if ( CStaticFunctionDefinitions::AddEventHandler ( *pLuaMain, strName, *pEntity, iLuaFunction, bPropagated, eventPriority, fPriorityMod ) ) + { + lua_pushboolean ( luaVM, true ); + return 1; + } } } } - else + if ( argStream.HasErrors () ) m_pScriptDebugging->LogCustom ( luaVM, argStream.GetFullErrorMessage() ); // Failed diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.PointLights.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.PointLights.cpp new file mode 100644 index 00000000000..7f2e244a82b --- /dev/null +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.PointLights.cpp @@ -0,0 +1,245 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: mods/shared_logic/lua/CLuaFunctionDefs.PointLights.cpp +* PURPOSE: Lua function definitions class +* DEVELOPERS: Alexander Romanov +* +*****************************************************************************/ + +#include "StdInc.h" + + +int CLuaFunctionDefs::CreateLight ( lua_State* luaVM ) +{ +// light createLight ( int lightType, float posX, float posY, float posX, [ float radius = 3, int r = 255, int g = 0, int b = 0, float dirX = 0, float dirY = 0, float dirZ = 0, bool createsShadow = false ] ) + int iMode; CVector vecPosition; float fRadius; SColor color; CVector vecDirection; bool bCreatesShadow; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadNumber ( iMode ); + argStream.ReadNumber ( vecPosition.fX ); + argStream.ReadNumber ( vecPosition.fY ); + argStream.ReadNumber ( vecPosition.fZ ); + argStream.ReadNumber ( fRadius, 3.0f ); + argStream.ReadNumber ( color.R, 255 ); + argStream.ReadNumber ( color.G, 0 ); + argStream.ReadNumber ( color.B, 0 ); + argStream.ReadNumber ( vecDirection.fX, 0 ); + argStream.ReadNumber ( vecDirection.fY, 0 ); + argStream.ReadNumber ( vecDirection.fZ, 0 ); + argStream.ReadBool ( bCreatesShadow, false ); + + if ( !argStream.HasErrors () ) + { + CLuaMain* pLuaMain = m_pLuaManager->GetVirtualMachine ( luaVM ); + CResource* pResource = pLuaMain ? pLuaMain->GetResource () : NULL; + if ( pResource ) + { + // Create it + CClientPointLights* pLight = CStaticFunctionDefinitions::CreateLight ( *pResource, iMode, vecPosition, fRadius, color, vecDirection ); + if ( pLight ) + { + CElementGroup * pGroup = pResource->GetElementGroup(); + if ( pGroup ) + { + pGroup->Add ( ( CClientEntity* ) pLight ); + } + lua_pushelement ( luaVM, pLight ); + return 1; + } + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + + +int CLuaFunctionDefs::GetLightType ( lua_State* luaVM ) +{ +// int getLightType ( light theLight ) + CClientPointLights* pLight; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pLight ); + + if ( !argStream.HasErrors () ) + { + int iMode; + if ( CStaticFunctionDefinitions::GetLightType ( pLight, iMode ) ) + { + lua_pushnumber ( luaVM, static_cast < lua_Number > ( iMode ) ); + return 1; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + + lua_pushboolean ( luaVM, false ); + return 1; +} + + +int CLuaFunctionDefs::GetLightRadius ( lua_State* luaVM ) +{ +// float getLightRadius ( light theLight ) + CClientPointLights* pLight; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pLight ); + + if ( !argStream.HasErrors () ) + { + float fRadius; + if ( CStaticFunctionDefinitions::GetLightRadius ( pLight, fRadius ) ) + { + lua_pushnumber ( luaVM, static_cast < lua_Number > ( fRadius ) ); + return 1; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + + lua_pushboolean ( luaVM, false ); + return 1; +} + + +int CLuaFunctionDefs::GetLightColor ( lua_State* luaVM ) +{ +// int, int, int getLightColor ( light theLight ) + CClientPointLights* pLight; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pLight ); + + if ( !argStream.HasErrors () ) + { + SColor color; + if ( CStaticFunctionDefinitions::GetLightColor ( pLight, color ) ) + { + lua_pushnumber ( luaVM, static_cast < lua_Number > ( color.R ) ); + lua_pushnumber ( luaVM, static_cast < lua_Number > ( color.G ) ); + lua_pushnumber ( luaVM, static_cast < lua_Number > ( color.B ) ); + return 3; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + + +int CLuaFunctionDefs::GetLightDirection ( lua_State* luaVM ) +{ +// float, float, float getLightDirection ( light theLight ) + CClientPointLights* pLight; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pLight ); + + if ( !argStream.HasErrors () ) + { + CVector vecDirection; + if ( CStaticFunctionDefinitions::GetLightDirection ( pLight, vecDirection ) ) + { + lua_pushnumber ( luaVM, static_cast < lua_Number > ( vecDirection.fX ) ); + lua_pushnumber ( luaVM, static_cast < lua_Number > ( vecDirection.fY ) ); + lua_pushnumber ( luaVM, static_cast < lua_Number > ( vecDirection.fZ ) ); + return 3; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + + +int CLuaFunctionDefs::SetLightRadius ( lua_State* luaVM ) +{ +// bool setLightRadius ( Light theLight, float radius ) + CClientPointLights* pLight; float fRadius; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pLight ); + argStream.ReadNumber ( fRadius ); + + if ( !argStream.HasErrors () ) + { + if ( CStaticFunctionDefinitions::SetLightRadius ( pLight, fRadius ) ) + { + lua_pushboolean ( luaVM, true ); + return 1; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + + +int CLuaFunctionDefs::SetLightColor ( lua_State* luaVM ) +{ +// bool setLightColor ( light theLight, float r, float g, float b ) + CClientPointLights* pLight; float fRed; float fGreen; float fBlue; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pLight ); + argStream.ReadNumber ( fRed ); + argStream.ReadNumber ( fGreen ); + argStream.ReadNumber ( fBlue ); + + if ( !argStream.HasErrors () ) + { + SColorRGBA color ( fRed, fGreen, fBlue, 0 ); + if ( CStaticFunctionDefinitions::SetLightColor ( pLight, color ) ) + { + lua_pushboolean ( luaVM, true ); + return 1; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + lua_pushboolean ( luaVM, false ); + return 1; +} + + +int CLuaFunctionDefs::SetLightDirection ( lua_State* luaVM ) +{ +// bool setLightDirection ( light theLight, float x, float y, float z ) + CClientPointLights* pLight; CVector vecDirection; + + CScriptArgReader argStream ( luaVM ); + argStream.ReadUserData ( pLight ); + argStream.ReadNumber ( vecDirection.fX ); + argStream.ReadNumber ( vecDirection.fY ); + argStream.ReadNumber ( vecDirection.fZ ); + + if ( !argStream.HasErrors () ) + { + if ( CStaticFunctionDefinitions::SetLightDirection ( pLight, vecDirection ) ) + { + lua_pushboolean ( luaVM, true ); + return 1; + } + } + else + m_pScriptDebugging->LogCustom ( luaVM, SString ( "Bad argument @ '%s' [%s]", lua_tostring ( luaVM, lua_upvalueindex ( 1 ) ), *argStream.GetErrorMessage () ) ); + + lua_pushboolean ( luaVM, false ); + return 1; +} \ No newline at end of file diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Util.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Util.cpp index fef2acfadf4..95e7c8ed2bb 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Util.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.Util.cpp @@ -875,7 +875,7 @@ int CLuaFunctionDefs::GetNetworkStats ( lua_State* luaVM ) lua_settable ( luaVM, -3 ); lua_pushstring ( luaVM, "encryptionStatus" ); - lua_pushnumber ( luaVM, stats.encryptionStatus ); + lua_pushnumber ( luaVM, 1 ); lua_settable ( luaVM, -3 ); return 1; diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.h b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.h index 7a0be067171..9359973b6cc 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.h +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionDefs.h @@ -434,6 +434,16 @@ class CLuaFunctionDefs // Fire functions LUA_DECLARE ( CreateFire ); + // PointLights functions + LUA_DECLARE ( CreateLight ); + LUA_DECLARE ( GetLightType ); + LUA_DECLARE ( GetLightRadius ); + LUA_DECLARE ( GetLightColor ); + LUA_DECLARE ( GetLightDirection ); + LUA_DECLARE ( SetLightRadius ); + LUA_DECLARE ( SetLightColor ); + LUA_DECLARE ( SetLightDirection ); + // Audio funcs LUA_DECLARE ( PlaySoundFrontEnd ); LUA_DECLARE ( SetAmbientSoundEnabled ); @@ -1006,6 +1016,24 @@ class CLuaFunctionDefs LUA_DECLARE ( BitExtract ); LUA_DECLARE ( BitReplace ); + // Webbrowser functions + LUA_DECLARE ( CreateBrowser ); + LUA_DECLARE ( RequestBrowserDomains ); + LUA_DECLARE ( LoadBrowserURL ); + LUA_DECLARE ( IsBrowserLoading ); + LUA_DECLARE ( InjectBrowserMouseMove ); + LUA_DECLARE ( InjectBrowserMouseDown ); + LUA_DECLARE ( InjectBrowserMouseUp ); + LUA_DECLARE ( InjectBrowserMouseWheel ); + LUA_DECLARE ( GetBrowserTitle ); + LUA_DECLARE ( GetBrowserURL ); + LUA_DECLARE ( SetBrowserRenderingPaused ); + LUA_DECLARE ( ExecuteBrowserJavascript ); + LUA_DECLARE ( SetBrowserVolume ); + LUA_DECLARE ( IsBrowserDomainBlocked ); + LUA_DECLARE ( FocusBrowser ); + LUA_DECLARE ( IsBrowserFocused ); + private: // Static references to objects static CLuaManager* m_pLuaManager; diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.cpp b/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.cpp index 2d09574abcb..2cc7f9a885c 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.cpp @@ -438,6 +438,12 @@ IMPLEMENT_ENUM_BEGIN( EComponentBase::EComponentBaseType ) ADD_ENUM( EComponentBaseType::PARENT, "parent" ) IMPLEMENT_ENUM_END( "component-base" ) +IMPLEMENT_ENUM_BEGIN(eWebBrowserMouseButton) + ADD_ENUM(BROWSER_MOUSEBUTTON_LEFT, "left") + ADD_ENUM(BROWSER_MOUSEBUTTON_MIDDLE, "middle") + ADD_ENUM(BROWSER_MOUSEBUTTON_RIGHT, "right") +IMPLEMENT_ENUM_END("webbrowser-mouse-button") + // // Get best guess at name of userdata type // diff --git a/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.h b/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.h index 202dd5b757c..042eabcf060 100644 --- a/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.h +++ b/MTA10/mods/shared_logic/lua/CLuaFunctionParseHelpers.h @@ -40,6 +40,7 @@ DECLARE_ENUM( eAudioLookupIndex ); DECLARE_ENUM( eAspectRatio ); DECLARE_ENUM( eRadioStreamIndex ); DECLARE_ENUM( EComponentBase::EComponentBaseType ); +DECLARE_ENUM( eWebBrowserMouseButton ); enum eDXHorizontalAlign { @@ -108,6 +109,7 @@ inline SString GetClassTypeName ( CClientMaterial* ) { return "material"; inline SString GetClassTypeName ( CClientTexture* ) { return "texture"; } inline SString GetClassTypeName ( CClientWeapon* ) { return "weapon"; } inline SString GetClassTypeName ( CClientEffect* ) { return "effect"; } +inline SString GetClassTypeName ( CClientPointLights* ) { return "light"; } inline SString GetClassTypeName ( CGUIButton* ) { return "gui-button"; } inline SString GetClassTypeName ( CGUICheckBox* ) { return "gui-checkbox"; } diff --git a/MTA10/mods/shared_logic/lua/CLuaMain.cpp b/MTA10/mods/shared_logic/lua/CLuaMain.cpp index fa7f098980f..769d856ec54 100644 --- a/MTA10/mods/shared_logic/lua/CLuaMain.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaMain.cpp @@ -610,7 +610,7 @@ void CLuaMain::AddMarkerClass( lua_State* luaVM ) lua_classfunction ( luaVM, "create", "createMarker" ); lua_classfunction ( luaVM, "getCount", "getMarkerCount" ); - lua_classfunction ( luaVM, "getType", "getMarkerType" ); + lua_classfunction ( luaVM, "getMarkerType", "getMarkerType" ); lua_classfunction ( luaVM, "getIcon", "getMarkerIcon" ); lua_classfunction ( luaVM, "getSize", "getMarkerSize" ); lua_classfunction ( luaVM, "getTarget", CLuaOOPDefs::GetMarkerTarget ); @@ -622,7 +622,7 @@ void CLuaMain::AddMarkerClass( lua_State* luaVM ) lua_classfunction ( luaVM, "setTarget", "setMarkerTarget" ); lua_classfunction ( luaVM, "setColor", "setMarkerColor" ); - lua_classvariable ( luaVM, "type", "setMarkerType", "getMarkerType" ); + lua_classvariable ( luaVM, "markerType", "setMarkerType", "getMarkerType" ); lua_classvariable ( luaVM, "icon", "setMarkerIcon", "getMarkerIcon" ); lua_classvariable ( luaVM, "size", "setMarkerSize", "getMarkerSize" ); @@ -903,6 +903,29 @@ void CLuaMain::AddWeaponClass ( lua_State* luaVM ) lua_registerclass ( luaVM, "Weapon", "Element" ); } +void CLuaMain::AddPointLightsClass ( lua_State* luaVM ) +{ + lua_newclass ( luaVM ); + + lua_classfunction ( luaVM, "create", "createLight" ); + + lua_classfunction ( luaVM, "getType", "getLightType" ); + lua_classfunction ( luaVM, "getRadius", "getLightRadius" ); + lua_classfunction ( luaVM, "getColor", "getLightColor" ); // color + lua_classfunction ( luaVM, "getDirection", "getLightDirection" ); + + lua_classfunction ( luaVM, "setRadius", "setLightRadius" ); + lua_classfunction ( luaVM, "setColor", "setLightColor" ); // color + lua_classfunction ( luaVM, "setDirection", "setLightDirection" ); + + lua_classvariable ( luaVM, "type", NULL, "getLightType" ); + lua_classvariable ( luaVM, "radius", "setLightRadius", "getLightRadius" ); + //lua_classvariable ( luaVM, "color", "setLightColor", "getLightColor" ); + lua_classvariable ( luaVM, "direction", "setLightDirection", "getLightDirection" ); + + lua_registerclass ( luaVM, "Light", "Element" ); +} + void CLuaMain::AddEffectClass ( lua_State* luaVM ) { @@ -1597,6 +1620,38 @@ void CLuaMain::AddDxRenderTargetClass ( lua_State* luaVM ) } +void CLuaMain::AddBrowserClass ( lua_State* luaVM ) +{ + lua_newclass ( luaVM ); + + lua_classfunction ( luaVM, "create", "createBrowser" ); + lua_classfunction ( luaVM, "loadURL", "loadBrowserURL" ); + lua_classfunction ( luaVM, "isLoading", "isBrowserLoading" ); + lua_classfunction ( luaVM, "injectMouseMove", "injectBrowserMouseMove" ); + lua_classfunction ( luaVM, "injectMouseDown", "injectBrowserMouseDown" ); + lua_classfunction ( luaVM, "injectMouseUp", "injectBrowserMouseUp" ); + lua_classfunction ( luaVM, "injectMouseWheel", "injectBrowserMouseWheel" ); + lua_classfunction ( luaVM, "getTitle", "getBrowserTitle" ); + lua_classfunction ( luaVM, "getURL", "getBrowserURL" ); + lua_classfunction ( luaVM, "setRenderingPaused", "setBrowserRenderingPaused" ); + lua_classfunction ( luaVM, "executeJavascript", "executeBrowserJavascript" ); + lua_classfunction ( luaVM, "setVolume", "setBrowserVolume" ); + lua_classfunction ( luaVM, "focus", "focusBrowser" ); + lua_classfunction ( luaVM, "isFocused", "isBrowserFocused" ); + + lua_classfunction ( luaVM, "requestDomains", "requestBrowserDomains" ); + lua_classfunction ( luaVM, "isDomainBlocked", "isBrowserDomainBlocked" ); + + lua_classvariable ( luaVM, "url", "loadBrowserURL", "getBrowserURL" ); + lua_classvariable ( luaVM, "loading", NULL, "isBrowserLoading "); + lua_classvariable ( luaVM, "title", NULL, "getBrowserTitle" ); + lua_classvariable ( luaVM, "renderingPaused", "setBrowserRenderingPaused", NULL ); + lua_classvariable ( luaVM, "volume", "setBrowserVolume", NULL ); + + lua_registerclass ( luaVM, "Browser", "DxTexture" ); +} + + void CLuaMain::AddVector4DClass ( lua_State* luaVM ) { lua_newclass ( luaVM ); @@ -1795,6 +1850,7 @@ void CLuaMain::InitClasses ( lua_State* luaVM ) AddSoundClass ( luaVM ); AddWeaponClass ( luaVM ); AddEffectClass ( luaVM ); + AddPointLightsClass ( luaVM ); AddGuiElementClass ( luaVM ); AddGuiWindowClass ( luaVM ); @@ -1830,6 +1886,7 @@ void CLuaMain::InitClasses ( lua_State* luaVM ) AddDxShaderClass ( luaVM ); AddDxScreenSourceClass ( luaVM ); AddDxRenderTargetClass ( luaVM ); + AddBrowserClass ( luaVM ); AddCameraClass ( luaVM ); } @@ -1984,7 +2041,7 @@ bool CLuaMain::LoadScriptFromBuffer ( const char* cpInBuffer, unsigned int uiInS if ( iret == LUA_ERRRUN || iret == LUA_ERRMEM ) { SString strRes = lua_tostring( m_luaVM, -1 ); - g_pClientGame->GetScriptDebugging()->LogPCallError( m_luaVM, strRes, strNiceFilename ); + g_pClientGame->GetScriptDebugging()->LogPCallError( m_luaVM, strRes, true ); } // Cleanup any return values if ( lua_gettop ( m_luaVM ) > luaSavedTop ) diff --git a/MTA10/mods/shared_logic/lua/CLuaMain.h b/MTA10/mods/shared_logic/lua/CLuaMain.h index 3045f536701..553a95a1980 100644 --- a/MTA10/mods/shared_logic/lua/CLuaMain.h +++ b/MTA10/mods/shared_logic/lua/CLuaMain.h @@ -93,6 +93,7 @@ class CLuaMain //: public CClient void AddSoundClass ( lua_State* luaVM ); void AddWeaponClass ( lua_State* luaVM ); void AddEffectClass ( lua_State* luaVM ); + void AddPointLightsClass ( lua_State* luaVM ); void AddGuiElementClass ( lua_State* luaVM ); void AddGuiFontClass ( lua_State* luaVM ); @@ -135,6 +136,7 @@ class CLuaMain //: public CClient void AddDxShaderClass ( lua_State* luaVM ); void AddDxScreenSourceClass ( lua_State* luaVM ); void AddDxRenderTargetClass ( lua_State* luaVM ); + void AddBrowserClass ( lua_State* luaVM ); void InitClasses ( lua_State* luaVM ); void InitVM ( void ); diff --git a/MTA10/mods/shared_logic/lua/CLuaManager.cpp b/MTA10/mods/shared_logic/lua/CLuaManager.cpp index e81dc82839b..7c0a53b9a67 100644 --- a/MTA10/mods/shared_logic/lua/CLuaManager.cpp +++ b/MTA10/mods/shared_logic/lua/CLuaManager.cpp @@ -599,6 +599,16 @@ void CLuaManager::LoadCFunctions ( void ) // Fire funcs CLuaCFunctions::AddFunction ( "createFire", CLuaFunctionDefs::CreateFire ); + // PointLights funcs + CLuaCFunctions::AddFunction ( "createLight", CLuaFunctionDefs::CreateLight ); + CLuaCFunctions::AddFunction ( "getLightType", CLuaFunctionDefs::GetLightType ); + CLuaCFunctions::AddFunction ( "getLightRadius", CLuaFunctionDefs::GetLightRadius ); + CLuaCFunctions::AddFunction ( "setLightRadius", CLuaFunctionDefs::SetLightRadius ); + CLuaCFunctions::AddFunction ( "getLightColor", CLuaFunctionDefs::GetLightColor ); + CLuaCFunctions::AddFunction ( "setLightColor", CLuaFunctionDefs::SetLightColor ); + CLuaCFunctions::AddFunction ( "getLightDirection", CLuaFunctionDefs::GetLightDirection ); + CLuaCFunctions::AddFunction ( "setLightDirection", CLuaFunctionDefs::SetLightDirection ); + // Engine funcs CLuaCFunctions::AddFunction ( "engineLoadTXD", CLuaFunctionDefs::EngineLoadTXD ); CLuaCFunctions::AddFunction ( "engineLoadCOL", CLuaFunctionDefs::EngineLoadCOL ); @@ -1181,6 +1191,24 @@ void CLuaManager::LoadCFunctions ( void ) CLuaCFunctions::AddFunction ( "bitExtract", CLuaFunctionDefs::BitExtract ); CLuaCFunctions::AddFunction ( "bitReplace", CLuaFunctionDefs::BitReplace ); + // Browser functions + CLuaCFunctions::AddFunction ( "createBrowser", CLuaFunctionDefs::CreateBrowser ); + CLuaCFunctions::AddFunction ( "requestBrowserDomains", CLuaFunctionDefs::RequestBrowserDomains ); + CLuaCFunctions::AddFunction ( "loadBrowserURL", CLuaFunctionDefs::LoadBrowserURL ); + CLuaCFunctions::AddFunction ( "isBrowserLoading", CLuaFunctionDefs::IsBrowserLoading ); + CLuaCFunctions::AddFunction ( "injectBrowserMouseMove", CLuaFunctionDefs::InjectBrowserMouseMove ); + CLuaCFunctions::AddFunction ( "injectBrowserMouseDown", CLuaFunctionDefs::InjectBrowserMouseDown ); + CLuaCFunctions::AddFunction ( "injectBrowserMouseUp", CLuaFunctionDefs::InjectBrowserMouseUp ); + CLuaCFunctions::AddFunction ( "injectBrowserMouseWheel", CLuaFunctionDefs::InjectBrowserMouseWheel ); + CLuaCFunctions::AddFunction ( "getBrowserTitle", CLuaFunctionDefs::GetBrowserTitle ); + CLuaCFunctions::AddFunction ( "getBrowserURL", CLuaFunctionDefs::GetBrowserURL ); + CLuaCFunctions::AddFunction ( "setBrowserRenderingPaused", CLuaFunctionDefs::SetBrowserRenderingPaused ); + CLuaCFunctions::AddFunction ( "executeBrowserJavascript", CLuaFunctionDefs::ExecuteBrowserJavascript ); + CLuaCFunctions::AddFunction ( "setBrowserVolume", CLuaFunctionDefs::SetBrowserVolume ); + CLuaCFunctions::AddFunction ( "isBrowserDomainBlocked", CLuaFunctionDefs::IsBrowserDomainBlocked ); + CLuaCFunctions::AddFunction ( "focusBrowser", CLuaFunctionDefs::FocusBrowser ); + CLuaCFunctions::AddFunction ( "isBrowserFocused", CLuaFunctionDefs::IsBrowserFocused ); + // Luadef definitions CLuaFileDefs::LoadFunctions (); CLuaFxDefs::LoadFunctions (); diff --git a/MTA10/mods/shared_logic/lua/LuaCommon.h b/MTA10/mods/shared_logic/lua/LuaCommon.h index 8a521fddba6..1beaad1263a 100644 --- a/MTA10/mods/shared_logic/lua/LuaCommon.h +++ b/MTA10/mods/shared_logic/lua/LuaCommon.h @@ -44,6 +44,7 @@ class CClientVehicle; class CClientWater; class CClientWeapon; class CClientRadarArea; +class CClientPointLights; class CLuaTimer; class CResource; class CXMLNode; diff --git a/MTA10/mods/shared_logic/luadefs/CLuaClassDefs.cpp b/MTA10/mods/shared_logic/luadefs/CLuaClassDefs.cpp index c5a74a981d4..a60c3b3f389 100644 --- a/MTA10/mods/shared_logic/luadefs/CLuaClassDefs.cpp +++ b/MTA10/mods/shared_logic/luadefs/CLuaClassDefs.cpp @@ -338,8 +338,10 @@ const char* CLuaClassDefs::GetEntityClass ( CClientEntity* pEntity ) case CCLIENTSHADER: return "DxShader"; case CCLIENTWEAPON: return "Weapon"; case CCLIENTEFFECT: return "Effect"; + case CCLIENTPOINTLIGHTS: return "Light"; case CCLIENTSCREENSOURCE: return "DxScreenSource"; case CCLIENTRENDERTARGET: return "DxRenderTarget"; + case CCLIENTBROWSER: return "Browser"; } return "Element"; } \ No newline at end of file diff --git a/MTA10/mods/shared_logic/luadefs/CLuaFileDefs.cpp b/MTA10/mods/shared_logic/luadefs/CLuaFileDefs.cpp index 92d46ae7cc4..023cfd91d22 100644 --- a/MTA10/mods/shared_logic/luadefs/CLuaFileDefs.cpp +++ b/MTA10/mods/shared_logic/luadefs/CLuaFileDefs.cpp @@ -372,8 +372,7 @@ int CLuaFileDefs::fileRead ( lua_State* luaVM ) { // Allocate a buffer to read the stuff into and read some shit into it char* pReadContent = new char [ulCount + 1]; - long lBytesRead = pFile->Read ( static_cast < unsigned long > ( ulCount ), - pReadContent ); + long lBytesRead = pFile->Read ( ulCount, pReadContent ); if ( lBytesRead != -1 ) { @@ -388,11 +387,17 @@ int CLuaFileDefs::fileRead ( lua_State* luaVM ) } // Delete our read content. Lua should've stored it - delete [] pReadContent; + delete[] pReadContent; // We're returning the result string return 1; } + else + { + // Reading zero bytes from a file results in an empty string + lua_pushstring ( luaVM, "" ); + return 1; + } } else m_pScriptDebugging->LogBadPointer ( luaVM, "file", 1 ); diff --git a/MTA10/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp b/MTA10/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp index 2bb49e483ba..67c4e6db9d7 100644 --- a/MTA10/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp +++ b/MTA10/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp @@ -936,6 +936,7 @@ void _declspec(naked) HOOK_CrashFix_Misc28 () test eax, eax jne cont + CRASH_AVERTED( 28 ) // Skip much code jmp RETURN_CrashFix_Misc28B @@ -979,12 +980,50 @@ void _declspec(naked) HOOK_CrashFix_Misc29 () jmp RETURN_CrashFix_Misc29 cont: + CRASH_AVERTED( 29 ) // Skip much code jmp RETURN_CrashFix_Misc29B } } +//////////////////////////////////////////////////////////////////////// +// Handle CAnimBlendAssociation::SetFinishCallback with invalid ecx +#define HOOKPOS_CrashFix_Misc30 0x4CEBE8 +#define HOOKSIZE_CrashFix_Misc30 7 +#define HOOKCHECK_CrashFix_Misc30 0xC7 +DWORD RETURN_CrashFix_Misc30 = 0x4CEBEF; +DWORD RETURN_CrashFix_Misc30B = 0x4CEBF5; +void _declspec(naked) HOOK_CrashFix_Misc30 () +{ +#if TEST_CRASH_FIXES + SIMULATE_ERROR_BEGIN( 10 ) + _asm + { + mov ecx, 0 + } + SIMULATE_ERROR_END +#endif + + _asm + { + // Check for incorrect pointer + cmp ecx, 0 + jz cont + + // Execute replaced code + mov dword ptr [ecx+30h], 1 + // Continue standard path + jmp RETURN_CrashFix_Misc30 + +cont: + CRASH_AVERTED( 30 ) + // Skip much code + jmp RETURN_CrashFix_Misc30B + } +} + + ////////////////////////////////////////////////////////////////////////////////////////// // // CClumpModelInfo::GetFrameFromId @@ -1385,6 +1424,7 @@ void CMultiplayerSA::InitHooks_CrashFixHacks ( void ) EZHookInstall ( CrashFix_Misc27 ); EZHookInstall ( CrashFix_Misc28 ); EZHookInstall ( CrashFix_Misc29 ); + EZHookInstallChecked ( CrashFix_Misc30 ); EZHookInstall ( CClumpModelInfo_GetFrameFromId ); EZHookInstallChecked ( CEntity_GetBoundRect ); EZHookInstallChecked ( CVehicle_AddUpgrade ); diff --git a/MTA10/multiplayer_sa/_Multiplayer SA 2008.vcxproj b/MTA10/multiplayer_sa/_Multiplayer SA 2008.vcxproj index c5b63c17d98..d7b2324514d 100644 --- a/MTA10/multiplayer_sa/_Multiplayer SA 2008.vcxproj +++ b/MTA10/multiplayer_sa/_Multiplayer SA 2008.vcxproj @@ -22,21 +22,21 @@ DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte @@ -75,7 +75,7 @@ multiplayer_sa - $(PlatformTarget)\$(Configuration)\ + $(SolutionDir)..\output\MTA San Andreas\mta\ false multiplayer_sa @@ -119,6 +119,7 @@ $(IntDir)$(TargetName).lib MachineX86 false + Console @@ -164,6 +165,7 @@ $(IntDir)$(TargetName).lib MachineX86 + Console @@ -201,7 +203,7 @@ true true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb true true @@ -209,6 +211,7 @@ $(IntDir)$(TargetName).lib MachineX86 + Console diff --git a/MTA10/sdk/core/CClientBase.h b/MTA10/sdk/core/CClientBase.h index 374b66bf11a..c01988843cb 100644 --- a/MTA10/sdk/core/CClientBase.h +++ b/MTA10/sdk/core/CClientBase.h @@ -26,6 +26,8 @@ class CClientBase virtual void PostFrameExecutionHandler ( void ) = 0; virtual void IdleHandler ( void ) = 0; + virtual bool WebsiteRequestResultHandler ( const std::vector& newPages ) = 0; + virtual bool ProcessCommand ( const char* szCommandLine ) = 0; //virtual bool ProcessInput ( CInputMessage* pInputMessage ) = 0 *TODO* diff --git a/MTA10/sdk/core/CCoreInterface.h b/MTA10/sdk/core/CCoreInterface.h index 1533fa88c83..5196316faeb 100644 --- a/MTA10/sdk/core/CCoreInterface.h +++ b/MTA10/sdk/core/CCoreInterface.h @@ -22,6 +22,7 @@ #include "CModManagerInterface.h" #include "CKeyBindsInterface.h" #include "CCVarsInterface.h" +#include "CWebCoreInterface.h" #include "xml/CXML.h" #include @@ -80,6 +81,7 @@ class CCoreInterface virtual CCVarsInterface* GetCVars ( void ) = 0; virtual CCommunityInterface* GetCommunity ( void ) = 0; virtual CLocalizationInterface* GetLocalization ( void ) = 0; + virtual CWebCoreInterface* GetWebCore ( void ) = 0; // Temporary functions for r1 diff --git a/MTA10/sdk/core/CKeyBindsInterface.h b/MTA10/sdk/core/CKeyBindsInterface.h index 69e2a0756de..b0c965d8cf4 100644 --- a/MTA10/sdk/core/CKeyBindsInterface.h +++ b/MTA10/sdk/core/CKeyBindsInterface.h @@ -93,13 +93,15 @@ class CKeyBindWithState: public CKeyBind class CCommandBind: public CKeyBindWithState { public: - inline CCommandBind ( void ) { szCommand = NULL; szArguments = NULL; szResource = NULL; } + inline CCommandBind ( void ) { szCommand = NULL; szArguments = NULL; szResource = NULL; bScriptCreated = false; ; bIsReplacingScriptKey = false; } inline ~CCommandBind ( void ) { delete [] szCommand; if ( szArguments ) delete [] szArguments; if ( szResource ) delete [] szResource; } eKeyBindType GetType ( void ) { return KEY_BIND_COMMAND; } char* szCommand; char* szArguments; char* szResource; - SString strDefaultKey; + bool bScriptCreated; // true if created by script + bool bIsReplacingScriptKey; // true if script set key is not being used + SString strOriginalScriptKey; // Original key set by script }; class CKeyFunctionBind: public CKeyBindWithState @@ -142,13 +144,16 @@ class CKeyBindsInterface virtual std::list < CKeyBind* > ::const_iterator IterEnd ( void ) = 0; // Command-bind funcs - virtual bool AddCommand ( const char* szKey, const char* szCommand, const char* szArguments = NULL, bool bState = true, const char* szResource = NULL, bool bAltKey = false ) = 0; + virtual bool AddCommand ( const char* szKey, const char* szCommand, const char* szArguments, bool bState, const char* szResource = NULL , bool bScriptCreated = false, const char* szOriginalScriptKey = NULL ) = 0; virtual bool AddCommand ( const SBindableKey* pKey, const char* szCommand, const char* szArguments = NULL, bool bState = true ) = 0; - virtual bool CommandExists ( const char* szKey, const char* szCommand, bool bCheckState = false, bool bState = true, const char* szArguments = NULL, const char* szResource = NULL ) = 0; + virtual bool CommandExists ( const char* szKey, const char* szCommand, bool bCheckState = false, bool bState = true, const char* szArguments = NULL, const char* szResource = NULL, bool bCheckScriptCreated = false, bool bScriptCreated = false ) = 0; virtual bool SetCommandActive ( const char* szKey, const char* szCommand, bool bState, const char* szArguments, const char* szResource, bool bActive, bool checkHitState ) = 0; virtual void SetAllCommandsActive ( const char* szResource, bool bActive, const char* szCommand = NULL, bool bState = true, const char* szArguments = NULL, bool checkHitState = false ) = 0; virtual CCommandBind* GetBindFromCommand ( const char* szCommand, const char* szArguments = NULL, bool bMatchCase = true, const char* szKey = NULL, bool bCheckHitState = false, bool bState = NULL ) = 0; virtual bool GetBoundCommands ( const char* szCommand, std::list < CCommandBind * > & commandsList ) = 0; + virtual void UserChangeCommandBoundKey ( CCommandBind* pBind, const SBindableKey* pNewBoundKey ) = 0; + virtual void UserRemoveCommandBoundKey ( CCommandBind* pBind ) = 0; + virtual CCommandBind* FindMatchingUpBind ( CCommandBind* pBind ) = 0; // Control-bind funcs virtual bool AddGTAControl ( const char* szKey, const char* szControl ) = 0; diff --git a/MTA10/sdk/core/CRenderItemManagerInterface.h b/MTA10/sdk/core/CRenderItemManagerInterface.h index d9ea49f904e..7b65fa483a4 100644 --- a/MTA10/sdk/core/CRenderItemManagerInterface.h +++ b/MTA10/sdk/core/CRenderItemManagerInterface.h @@ -29,6 +29,7 @@ class CShaderItem; class CShaderInstance; class CRenderTargetItem; class CScreenSourceItem; +class CWebBrowserItem; class CRenderItemManager; class CD3DDUMMY; class CEffectCloner; @@ -37,6 +38,7 @@ class CClientEntityBase; struct SShaderItemLayers; typedef CShaderItem CSHADERDUMMY; enum eAspectRatio; +class CWebViewInterface; #define RDEFAULT ((uint) -1) @@ -139,6 +141,7 @@ class CRenderItemManagerInterface virtual CShaderItem* CreateShader ( const SString& strFullFilePath, const SString& strRootPath, SString& strOutStatus, float fPriority, float fMaxDistance, bool bLayered, bool bDebug, int iTypeMask ) = 0; virtual CRenderTargetItem* CreateRenderTarget ( uint uiSizeX, uint uiSizeY, bool bWithAlphaChannel, bool bForce = false ) = 0; virtual CScreenSourceItem* CreateScreenSource ( uint uiSizeX, uint uiSizeY ) = 0; + virtual CWebBrowserItem* CreateWebBrowser ( uint uiSizeX, uint uiSizeY ) = 0; virtual bool SetRenderTarget ( CRenderTargetItem* pItem, bool bClear ) = 0; virtual void EnableSetRenderTargetOldVer ( bool bEnable ) = 0; virtual bool IsSetRenderTargetEnabledOldVer ( void ) = 0; @@ -218,6 +221,7 @@ enum eRenderItemClassTypes CLASS_CFileTextureItem, CLASS_CRenderTargetItem, CLASS_CScreenSourceItem, + CLASS_CWebBrowserItem, }; @@ -504,3 +508,23 @@ class CScreenSourceItem : public CTextureItem IDirect3DSurface9* m_pD3DRenderTargetSurface; uint m_uiRevision; }; + +//////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////// +// +// CWebBrowserItem - webbrowser texture +// +class CWebBrowserItem : public CTextureItem +{ + DECLARE_CLASS(CWebBrowserItem, CTextureItem) + CWebBrowserItem ( void ) : ClassInit ( this ) {} + virtual void PostConstruct ( CRenderItemManager* pRenderItemManager, uint uiSizeX, uint uiSizeY ); + virtual void PreDestruct ( void ); + virtual bool IsValid ( void ); + virtual void OnLostDevice ( void ); + virtual void OnResetDevice ( void ); + void CreateUnderlyingData ( void ); + void ReleaseUnderlyingData ( void ); + + IDirect3DSurface9* m_pD3DRenderTargetSurface; +}; diff --git a/MTA10/sdk/core/CScreenGrabberInterface.h b/MTA10/sdk/core/CScreenGrabberInterface.h index b619ed674ca..cab3136f90a 100644 --- a/MTA10/sdk/core/CScreenGrabberInterface.h +++ b/MTA10/sdk/core/CScreenGrabberInterface.h @@ -29,6 +29,7 @@ class CScreenGrabberInterface virtual void QueueScreenShot ( uint uiSizeX, uint uiSizeY, uint uiQuality, PFN_SCREENSHOT_CALLBACK pfnScreenShotCallback ) = 0; virtual void ClearScreenShotQueue ( void ) = 0; virtual bool GetBackBufferPixels ( uint uiSizeX, uint uiSizeY, CBuffer& buffer, SString& strOutError ) = 0; + virtual bool IsQueueEmpty ( void ) = 0; }; CScreenGrabberInterface* NewScreenGrabber ( void ); diff --git a/MTA10/sdk/core/CWebBrowserEventsInterface.h b/MTA10/sdk/core/CWebBrowserEventsInterface.h new file mode 100644 index 00000000000..ef12e5af520 --- /dev/null +++ b/MTA10/sdk/core/CWebBrowserEventsInterface.h @@ -0,0 +1,29 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: sdk/core/CWebBrowserEventsInterface.h +* PURPOSE: Webbrowser events interface class +* +*****************************************************************************/ + +#ifndef __CWEBBROWSEREVENTSINTERFACE_H +#define __CWEBBROWSEREVENTSINTERFACE_H + +class CWebBrowserEventsInterface +{ +public: + virtual void Events_OnCreated () = 0; + virtual void Events_OnDocumentReady ( const SString& strURL ) = 0; + virtual void Events_OnLoadingFailed ( const SString& strURL, int errorCode, const SString& errorDescription ) = 0; + virtual void Events_OnNavigate ( const SString& strURL, bool bMainFrame ) = 0; + virtual void Events_OnPopup ( const SString& strTargetURL, const SString& strOpenerURL ) = 0; + virtual void Events_OnChangeCursor ( unsigned char ucCursor ) = 0; + virtual void Events_OnTriggerEvent ( const SString& strEventName, const std::vector& arguments, bool bIsServer = false ) = 0; + virtual void Events_OnTooltip ( const SString& strTooltip ) = 0; + virtual void Events_OnInputFocusChanged ( bool bGainedFocus ) = 0; + virtual bool Events_OnResourcePathCheck ( SString& strURL ) = 0; +}; + +#endif diff --git a/MTA10/sdk/core/CWebCoreInterface.h b/MTA10/sdk/core/CWebCoreInterface.h new file mode 100644 index 00000000000..d05dd69a8f1 --- /dev/null +++ b/MTA10/sdk/core/CWebCoreInterface.h @@ -0,0 +1,83 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: sdk/core/CWebBrowserInterface.h +* PURPOSE: Webbrowser interface class +* +*****************************************************************************/ + +#ifndef __CWEBCOREINTERFACE_H +#define __CWEBCOREINTERFACE_H + +class CWebBrowserItem; +class CWebViewInterface; +class CWebView; + +enum eURLState +{ + WEBPAGE_NOT_LISTED, + WEBPAGE_ALLOWED, + WEBPAGE_DISALLOWED +}; + +enum eWebFilterType +{ + WEBFILTER_HARDCODED, + WEBFILTER_DYNAMIC, + WEBFILTER_USER, + WEBFILTER_REQUEST +}; + +enum eWebFilterState +{ + WEBFILTER_ALL, + WEBFILTER_ALLOWED, + WEBFILTER_DISALLOWED +}; + +enum eWebBrowserMouseButton +{ + BROWSER_MOUSEBUTTON_LEFT = 0, + BROWSER_MOUSEBUTTON_MIDDLE = 1, + BROWSER_MOUSEBUTTON_RIGHT = 2 +}; + +class CWebCoreInterface +{ +public: + virtual CWebViewInterface* CreateWebView ( unsigned int uiWidth, unsigned int uiHeight, bool bIsLocal, CWebBrowserItem* pWebBrowserRenderItem, bool bTransparent ) = 0; + virtual void DestroyWebView ( CWebViewInterface* pWebView ) = 0; + + virtual void AddEventToEventQueue( std::function func, CWebView* pWebView, const SString& name ) = 0; + virtual void RemoveWebViewEvents ( CWebView* pWebView ) = 0; + virtual void DoEventQueuePulse () = 0; + + virtual eURLState GetURLState ( const SString& strURL ) = 0; + virtual void ResetFilter ( bool bResetRequestsOnly ) = 0; + //virtual void AddAllowedPage ( const SString& strURL ) = 0; + virtual void RequestPages ( const std::vector& pages ) = 0; + virtual void AllowPendingPages ( bool bRemember ) = 0; + virtual void DenyPendingPages () = 0; + + virtual bool IsTestModeEnabled () = 0; + virtual void SetTestModeEnabled ( bool bEnabled ) = 0; + + virtual CWebViewInterface* GetFocusedWebView () = 0; + virtual void SetFocusedWebView (CWebView* pWebView) = 0; + virtual void ProcessInputMessage( UINT uMsg, WPARAM wParam, LPARAM lParam ) = 0; + virtual void ClearTextures () = 0; + + virtual bool CanLoadRemotePages () = 0; + + virtual void OnPreScreenshot () = 0; + virtual void OnPostScreenshot () = 0; + + virtual bool SetGlobalAudioVolume ( float fVolume ) = 0; + + virtual void WriteCustomList ( const SString& strListName, const std::vector& customList, bool bReset = true ) = 0; + virtual void GetFilterEntriesByType ( std::vector>& outEntries, eWebFilterType filterType, eWebFilterState state = eWebFilterState::WEBFILTER_ALL ) = 0; +}; + +#endif diff --git a/MTA10/sdk/core/CWebViewInterface.h b/MTA10/sdk/core/CWebViewInterface.h new file mode 100644 index 00000000000..73f9ab48dc3 --- /dev/null +++ b/MTA10/sdk/core/CWebViewInterface.h @@ -0,0 +1,43 @@ +/***************************************************************************** +* +* PROJECT: Multi Theft Auto v1.0 +* (Shared logic for modifications) +* LICENSE: See LICENSE in the top level directory +* FILE: sdk/core/CWebViewInterface.h +* PURPOSE: WebView interface class +* +*****************************************************************************/ + +#ifndef __CWEBVIEWINTERFACE_H +#define __CWEBVIEWINTERFACE_H + +class CWebBrowserEventsInterface; + +class CWebViewInterface +{ +public: + virtual void Initialise () = 0; + virtual void SetWebBrowserEvents( CWebBrowserEventsInterface* pInterface ) = 0; + virtual bool LoadURL ( const SString& strURL, bool bFilterEnabled = true ) = 0; + virtual bool IsLoading () = 0; + virtual void SetBeingDestroyed ( bool state ) = 0; + + virtual void GetURL ( SString& outURL ) = 0; + virtual void GetTitle ( SString& outTitle ) = 0; + virtual void SetRenderingPaused ( bool bPaused ) = 0; + virtual void Focus () = 0; + + virtual void ExecuteJavascript ( const SString& strJavascriptCode ) = 0; + + virtual void InjectMouseMove ( int iPosX, int iPosY ) = 0; + virtual void InjectMouseDown ( eWebBrowserMouseButton mouseButton ) = 0; + virtual void InjectMouseUp ( eWebBrowserMouseButton mouseButton ) = 0; + virtual void InjectMouseWheel ( int iScrollVert, int iScrollHorz ) = 0; + + virtual bool IsLocal () = 0; + virtual void SetTempURL ( const SString& strTempURL ) = 0; + + virtual bool SetAudioVolume ( float fVolume ) = 0; +}; + +#endif diff --git a/MTA10/sdk/game/CPointLights.h b/MTA10/sdk/game/CPointLights.h index 13bbf65ec56..8d5562ca11a 100644 --- a/MTA10/sdk/game/CPointLights.h +++ b/MTA10/sdk/game/CPointLights.h @@ -16,12 +16,14 @@ enum ePointLightType { PLTYPE_POINTLIGHT=0, + PLTYPE_SPOTLIGHT=1, + PLTYPE_DARKLIGHT=2, }; class CPointLights { public: - virtual void AddLight ( unsigned char ucType, CVector vec_2, CVector vec_3, float f_4, float f_5, float f_6, float f_7, unsigned char uc_8, bool b_9, CEntity * pEntity ) = 0; + virtual void AddLight ( int iMode, const CVector vecPosition, CVector vecDirection, float fRadius, SColor color, unsigned char uc_8, bool bCreatesShadow, CEntity * pAffected ) = 0; }; #endif \ No newline at end of file diff --git a/MTA10/sdk/game/CRenderWare.h b/MTA10/sdk/game/CRenderWare.h index 5766aab67af..aa056723543 100644 --- a/MTA10/sdk/game/CRenderWare.h +++ b/MTA10/sdk/game/CRenderWare.h @@ -75,7 +75,6 @@ class CRenderWare { virtual void DestroyTXD ( RwTexDictionary * pTXD ) = 0; virtual void DestroyTexture ( RwTexture * pTex ) = 0; virtual void ReplaceCollisions ( CColModel * pColModel, unsigned short usModelID ) = 0; - virtual bool PositionFrontSeat ( RpClump *pClump, unsigned short usModelID ) = 0; virtual unsigned int LoadAtomics ( RpClump * pClump, RpAtomicContainer * pAtomics ) = 0; virtual void ReplaceAllAtomicsInModel ( RpClump * pSrc, unsigned short usModelID ) = 0; virtual void ReplaceAllAtomicsInClump ( RpClump * pDst, RpAtomicContainer * pAtomics, unsigned int uiAtomics ) = 0; diff --git a/MTA10/sdk/net/CNet.h b/MTA10/sdk/net/CNet.h index 563d4917bbf..6dc34ad78f7 100644 --- a/MTA10/sdk/net/CNet.h +++ b/MTA10/sdk/net/CNet.h @@ -27,6 +27,7 @@ namespace EDownloadMode RESOURCE_INITIAL_FILES, RESOURCE_SINGULAR_FILES, CALL_REMOTE, + WEBBROWSER_LISTS, }; } using EDownloadMode::EDownloadModeType; @@ -63,7 +64,7 @@ class CNet }; virtual void ResetNetwork ( void ) = 0; - virtual bool StartNetwork ( const char* szServerHost, unsigned short usServerPort, const char* szServerPassword = NULL ) = 0; + virtual bool StartNetwork ( const char* szServerHost, unsigned short usServerPort, bool bPacketTag = false ) = 0; virtual void StopNetwork ( void ) = 0; virtual void SetFakeLag ( unsigned short usPacketLoss, unsigned short usMinExtraPing, unsigned short usExtraPingVariance, int iKBPSLimit ) = 0; @@ -118,7 +119,7 @@ class CNet virtual void ResetStub ( DWORD dwType, va_list ) = 0; virtual const char* GetCurrentServerId ( bool bPreviousVer ) = 0; - virtual bool CheckFile ( const char* szType, const char* szFilename ) = 0; + virtual bool CheckFile ( const char* szType, const char* szFilename, const CBuffer& buffer = CBuffer() ) = 0; virtual uint GetExtendedErrorCode ( void ) = 0; virtual void SetTimeoutTime ( uint uiTimeoutTime ) = 0; diff --git a/MTA10/sdk/net/net_common.h b/MTA10/sdk/net/net_common.h index 8ed5e3223b5..ee93c7a31e4 100644 --- a/MTA10/sdk/net/net_common.h +++ b/MTA10/sdk/net/net_common.h @@ -100,7 +100,6 @@ struct NetStatistics uint messagesInResendBuffer; bool isLimitedByCongestionControl; bool isLimitedByOutgoingBandwidthLimit; - int encryptionStatus; // Copy of raknet statistics NetRawStatistics raw; diff --git a/MTA10/sdk/utils/XFont.h b/MTA10/sdk/utils/XFont.h index 35dafdb7640..0c2ec5488e7 100644 --- a/MTA10/sdk/utils/XFont.h +++ b/MTA10/sdk/utils/XFont.h @@ -273,33 +273,33 @@ BOOL GetFontProperties(LPCTSTR lpszFilePath, FONT_PROPERTIES * lpFontPropsX) if (szTempAnsi[0] != 0) { - _ASSERTE(strlen(szTempAnsi) < sizeof(lpFontProps->csName)); + //_ASSERTE(strlen(szTempAnsi) < sizeof(lpFontProps->csName)); switch (ttRecord.uNameID) { case 0: if (lpFontProps->csCopyright[0] == 0) - strncpy(lpFontProps->csCopyright, szTempAnsi, - sizeof(lpFontProps->csCopyright)-1); + STRNCPY(lpFontProps->csCopyright, szTempAnsi, + sizeof(lpFontProps->csCopyright)); break; case 1: if (lpFontProps->csFamily[0] == 0) - strncpy(lpFontProps->csFamily, szTempAnsi, - sizeof(lpFontProps->csFamily)-1); + STRNCPY(lpFontProps->csFamily, szTempAnsi, + sizeof(lpFontProps->csFamily)); bRetVal = TRUE; break; case 4: if (lpFontProps->csName[0] == 0) - strncpy(lpFontProps->csName, szTempAnsi, - sizeof(lpFontProps->csName)-1); + STRNCPY(lpFontProps->csName, szTempAnsi, + sizeof(lpFontProps->csName)); break; case 7: if (lpFontProps->csTrademark[0] == 0) - strncpy(lpFontProps->csTrademark, szTempAnsi, - sizeof(lpFontProps->csTrademark)-1); + STRNCPY(lpFontProps->csTrademark, szTempAnsi, + sizeof(lpFontProps->csTrademark)); break; default: @@ -316,7 +316,7 @@ BOOL GetFontProperties(LPCTSTR lpszFilePath, FONT_PROPERTIES * lpFontPropsX) ::CloseHandle(hFile); if (lpFontProps->csName[0] == 0) - strcpy(lpFontProps->csName, lpFontProps->csFamily); + STRNCPY(lpFontProps->csName, lpFontProps->csFamily, sizeof( lpFontProps->csName )); memset(lpFontPropsX, 0, sizeof(FONT_PROPERTIES)); @@ -331,10 +331,10 @@ BOOL GetFontProperties(LPCTSTR lpszFilePath, FONT_PROPERTIES * lpFontPropsX) sizeof(lpFontPropsX->csFamily)/sizeof(TCHAR)-1); */ - strcpy(lpFontPropsX->csName, lpFontProps->csName); - strcpy(lpFontPropsX->csCopyright, lpFontProps->csCopyright); - strcpy(lpFontPropsX->csTrademark, lpFontProps->csTrademark); - strcpy(lpFontPropsX->csFamily, lpFontProps->csFamily); + STRNCPY(lpFontPropsX->csName, lpFontProps->csName, sizeof( lpFontPropsX->csName )); + STRNCPY(lpFontPropsX->csCopyright, lpFontProps->csCopyright, sizeof( lpFontPropsX->csCopyright )); + STRNCPY(lpFontPropsX->csTrademark, lpFontProps->csTrademark, sizeof( lpFontPropsX->csTrademark )); + STRNCPY(lpFontPropsX->csFamily, lpFontProps->csFamily, sizeof( lpFontPropsX->csFamily )); return bRetVal; } diff --git a/MTA10/version.h b/MTA10/version.h index b678017d553..3e7b2d6a1f5 100644 --- a/MTA10/version.h +++ b/MTA10/version.h @@ -12,7 +12,7 @@ // New version info #define MTASA_VERSION_MAJOR 1 -#define MTASA_VERSION_MINOR 4 +#define MTASA_VERSION_MINOR 5 #define MTASA_VERSION_MAINTENANCE 0 #define MTASA_VERSION_TYPE VERSION_TYPE_CUSTOM #define MTASA_VERSION_BUILD 0 @@ -75,8 +75,8 @@ #define _ASE_VERSION QUOTE_DEFINE(MTASA_VERSION_MAJOR) "." QUOTE_DEFINE(MTASA_VERSION_MINOR) #define _NETCODE_VERSION_BRANCH_ID 0x4 // Use 0x1 - 0xF to indicate an incompatible branch is being used (0x0 is reserved, 0x4 is trunk) -#define _CLIENT_NET_MODULE_VERSION 0x089 // (0x000 - 0xfff) Lvl9 wizards only -#define _NETCODE_VERSION 0x1D8 // (0x000 - 0xfff) Increment when net messages change (pre-release) +#define _CLIENT_NET_MODULE_VERSION 0x08C // (0x000 - 0xfff) Lvl9 wizards only +#define _NETCODE_VERSION 0x1DA // (0x000 - 0xfff) Increment when net messages change (pre-release) #define MTA_DM_BITSTREAM_VERSION 0x05E // (0x000 - 0xfff) Increment when net messages change (post-release). (Changing will also require additional backward compatibility code). // To avoid user confusion, make sure the ASE version matches only if communication is possible diff --git a/MTA10_Server/core/_ServerCore 2008.vcxproj b/MTA10_Server/core/_ServerCore 2008.vcxproj index 4eb681c1a88..b2933d1de06 100644 --- a/MTA10_Server/core/_ServerCore 2008.vcxproj +++ b/MTA10_Server/core/_ServerCore 2008.vcxproj @@ -34,41 +34,41 @@ DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte @@ -134,12 +134,12 @@ core - ..\..\output\MTA San Andreas\server\ + $(SolutionDir)..\output\MTA San Andreas\server\ false core - ..\..\output\MTA San Andreas\server\$(PlatformTarget)\ + $(SolutionDir)..\output\MTA San Andreas\server\$(PlatformTarget)\ false core @@ -339,7 +339,7 @@ true ../dependencies;../../vendor/detours/lib;%(AdditionalLibraryDirectories) true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Console true @@ -385,7 +385,7 @@ true ../dependencies;../../vendor/detours/lib;%(AdditionalLibraryDirectories) true - ../../symbols/$(Configuration)_$(PlatformTarget)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Console true diff --git a/MTA10_Server/dbconmy/_ServerDbconmy 2008.vcxproj b/MTA10_Server/dbconmy/_ServerDbconmy 2008.vcxproj index 0884dd572f1..65e90d1e931 100644 --- a/MTA10_Server/dbconmy/_ServerDbconmy 2008.vcxproj +++ b/MTA10_Server/dbconmy/_ServerDbconmy 2008.vcxproj @@ -34,36 +34,36 @@ DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte @@ -118,12 +118,12 @@ dbconmy - ../../output/MTA San Andreas/server/mods/deathmatch/ + $(SolutionDir)..\output\MTA San Andreas\server\mods\deathmatch\ false dbconmy - ../../output/MTA San Andreas/server/$(PlatformTarget)/ + $(SolutionDir)\..\output\MTA San Andreas\server\$(PlatformTarget)\ false dbconmy @@ -151,6 +151,7 @@ $(IntDir)$(TargetFileName).lib MachineX86 false + Console @@ -208,6 +209,7 @@ true $(IntDir)$(TargetFileName).lib MachineX86 + Console @@ -264,7 +266,7 @@ libmysql.lib;%(AdditionalDependencies) ../../vendor/mysql/lib/opt;%(AdditionalLibraryDirectories) true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb true true @@ -272,6 +274,7 @@ $(IntDir)$(TargetFileName).lib MachineX86 + Console @@ -299,7 +302,7 @@ libmysql.lib;%(AdditionalDependencies) ../../vendor/mysql/lib/$(PlatformTarget);%(AdditionalLibraryDirectories) true - ../../symbols/$(Configuration)_$(PlatformTarget)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb true true diff --git a/MTA10_Server/launcher/_launcher 2008.vcxproj b/MTA10_Server/launcher/_launcher 2008.vcxproj index 4f524c47258..d7e2e4641f3 100644 --- a/MTA10_Server/launcher/_launcher 2008.vcxproj +++ b/MTA10_Server/launcher/_launcher 2008.vcxproj @@ -35,36 +35,36 @@ Application - v120 + v120_xp MultiByte true Application - v120 + v120_xp MultiByte true Application - v120 + v120_xp MultiByte Application - v120 + v120_xp MultiByte true Application - v120 + v120_xp MultiByte true Application - v120 + v120_xp MultiByte @@ -129,12 +129,12 @@ MTA Server64 - $(SolutionDir)\..\output\MTA San Andreas\server\ + $(SolutionDir)..\output\MTA San Andreas\server\ false MTA Server - $(SolutionDir)\..\output\MTA San Andreas\server\ + $(SolutionDir)..\output\MTA San Andreas\server\ false MTA Server64 @@ -273,7 +273,7 @@ true true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Console true diff --git a/MTA10_Server/mods/deathmatch/_ServerDeathmatch 2008.vcxproj b/MTA10_Server/mods/deathmatch/_ServerDeathmatch 2008.vcxproj index f0c4c49ee69..817311c88e8 100644 --- a/MTA10_Server/mods/deathmatch/_ServerDeathmatch 2008.vcxproj +++ b/MTA10_Server/mods/deathmatch/_ServerDeathmatch 2008.vcxproj @@ -34,40 +34,40 @@ DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte true DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte true @@ -136,13 +136,13 @@ deathmatch_d - ../../../output/MTA San Andreas/server/mods/deathmatch/ + $(SolutionDir)..\output\MTA San Andreas\server\mods\deathmatch\ false true deathmatch - ../../../output/MTA San Andreas/server/$(PlatformTarget)/ + $(SolutionDir)..\output\MTA San Andreas\server\$(PlatformTarget)\ false true deathmatch @@ -157,11 +157,11 @@ - MaxSpeed - AnySuitable + Custom + Disabled true Speed - true + false .;./logic;../../../vendor;../../../vendor/sqlite;../../../vendor/zlib/;../../../vendor/pcre;../../../vendor/pme;../../../vendor/pthreads/include;../../../Shared/publicsdk/include;logic/common;../../../vendor/zlib;../../../vendor/json-c;../../sdk;../../../Shared/sdk;../../../vendor/sparsehash/current/src;../../../vendor/sparsehash/current/src/windows;../../../Shared/animation;../../../vendor/bochs;../../../vendor/bob_withers;../../../vendor/zip;../../../vendor/lua/src;../../../vendor/pcre/shipped_for_mta;../../../vendor/json-c/shipped_for_mta;../../../Shared/mods/deathmatch/logic;%(AdditionalIncludeDirectories) WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -174,6 +174,7 @@ ProgramDatabase 4996;4482;%(DisableSpecificWarnings) -Zm114 %(AdditionalOptions) + false NDEBUG;%(PreprocessorDefinitions) @@ -187,7 +188,6 @@ true logic/lib;../../../vendor/lua/$(PlatformTarget)/$(Configuration)Server;../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/ehs/$(PlatformTarget)/$(Configuration);../../../vendor/pme/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);../../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../../vendor/zlib/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) true - ../../../symbols/$(Configuration)_$(SafeParentName).pdb true true @@ -195,6 +195,7 @@ $(IntDir)$(TargetFileName).lib MachineX86 + Console @@ -291,6 +292,7 @@ $(IntDir)$(TargetFileName).lib MachineX86 false + Console @@ -349,11 +351,9 @@ - MaxSpeed - AnySuitable - true + Custom + Disabled Speed - true .;./logic;../../../vendor;../../../vendor/sqlite;../../../vendor/zlib/;../../../vendor/pcre;../../../vendor/pme;../../../vendor/pthreads/include;../../../Shared/publicsdk/include;logic/common;../../../vendor/zlib;../../../vendor/json-c;../../sdk;../../../Shared/sdk;../../../vendor/sparsehash/current/src;../../../vendor/sparsehash/current/src/windows;../../../Shared/animation;../../../vendor/bochs;../../../vendor/bob_withers;../../../vendor/zip;../../../vendor/lua/src;../../../vendor/pcre/shipped_for_mta;../../../vendor/json-c/shipped_for_mta;../../../Shared/mods/deathmatch/logic;%(AdditionalIncludeDirectories) WIN32;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true @@ -366,20 +366,19 @@ ProgramDatabase 4996;4482;%(DisableSpecificWarnings) -Zm114 %(AdditionalOptions) + false NDEBUG;%(PreprocessorDefinitions) 0x0809 - - true - + wsock32.lib;zlib.lib;ehs.lib;pthread.lib;pme.lib;json.lib;psapi.lib;%(AdditionalDependencies) true - logic/lib;../../../vendor/lua/$(PlatformTarget)/$(Configuration)Server;../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/ehs/$(PlatformTarget)/$(Configuration);../../../vendor/pme/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);../../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../../vendor/zlib/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\lua5.1s_dll;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\json;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\ehs;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pme;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pcre;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pthread;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\zlib;%(AdditionalLibraryDirectories) true - ../../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb true true @@ -387,7 +386,11 @@ $(IntDir)$(TargetFileName).lib MachineX86 + Console + + true + @@ -427,9 +430,9 @@ lua5.1s.lib;wsock32.lib;zlib.lib;ehs.lib;pthread.lib;pme.lib;pcre3.lib;json.lib;psapi.lib;%(AdditionalDependencies) true - ../../../vendor/lua/$(PlatformTarget)/$(Configuration)Server;../../../vendor/json-c/$(PlatformTarget)/$(Configuration);../../../vendor/ehs/$(PlatformTarget)/$(Configuration);../../../vendor/pme/$(PlatformTarget)/$(Configuration);../../../vendor/pcre/$(PlatformTarget)/$(Configuration);../../../vendor/pthreads/$(PlatformTarget)/$(Configuration);../../../vendor/zlib/$(PlatformTarget)/$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\lua5.1s_dll;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\json;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\ehs;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pme;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pcre;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\pthread;$(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\zlib;%(AdditionalLibraryDirectories) true - ../../../symbols/$(Configuration)_$(PlatformTarget)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb true true diff --git a/MTA10_Server/mods/deathmatch/acl.xml b/MTA10_Server/mods/deathmatch/acl.xml index 5bf6955ce85..8f65c0ad1c4 100644 --- a/MTA10_Server/mods/deathmatch/acl.xml +++ b/MTA10_Server/mods/deathmatch/acl.xml @@ -90,6 +90,7 @@ + @@ -193,6 +194,7 @@ + diff --git a/MTA10_Server/mods/deathmatch/editor.conf b/MTA10_Server/mods/deathmatch/editor.conf index 2cc7bd41b91..19c68d7abe4 100644 --- a/MTA10_Server/mods/deathmatch/editor.conf +++ b/MTA10_Server/mods/deathmatch/editor.conf @@ -40,9 +40,6 @@ Only relevant if is set. Values: 0 - disabled , 1 - enabled ; default value: 1. Optional parameter. --> 0 - - - - - 1 - 1 - - - - - 1 - - - - - - 1 - + + + + + + + + + + + + + + + + diff --git a/vendor/cef3/cefclient/cefclient.h b/vendor/cef3/cefclient/cefclient.h new file mode 100644 index 00000000000..da337a29a30 --- /dev/null +++ b/vendor/cef3/cefclient/cefclient.h @@ -0,0 +1,56 @@ +// Copyright (c) 2013 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. + +#ifndef CEF_TESTS_CEFCLIENT_CEFCLIENT_H_ +#define CEF_TESTS_CEFCLIENT_CEFCLIENT_H_ +#pragma once + +#include +#include "include/cef_base.h" +#include "cefclient/client_app.h" +#include "cefclient/client_handler.h" + +class CefApp; +class CefBrowser; +class CefCommandLine; + +// Returns the main browser window instance. +CefRefPtr AppGetBrowser(); + +// Returns the main application window handle. +ClientWindowHandle AppGetMainWindowHandle(); + +// Returns the application working directory. +std::string AppGetWorkingDirectory(); + +// Initialize the application command line. +void AppInitCommandLine(int argc, const char* const* argv); + +// Returns the application command line object. +CefRefPtr AppGetCommandLine(); + +// Returns the application settings based on command line arguments. +void AppGetSettings(CefSettings& settings); +void AppGetBrowserSettings(CefBrowserSettings& settings); + +// Returns true if off-screen rendering is enabled via the command line +// argument. +bool AppIsOffScreenRenderingEnabled(); + +// Quit the application message loop. +void AppQuitMessageLoop(); + +// Implementations for various tests. +void RunGetSourceTest(CefRefPtr browser); +void RunGetTextTest(CefRefPtr browser); +void RunRequestTest(CefRefPtr browser); +void RunPopupTest(CefRefPtr browser); +void RunPluginInfoTest(CefRefPtr browser); +void RunOtherTests(CefRefPtr browser); + +#if defined(OS_WIN) +void RunTransparentPopupTest(CefRefPtr browser); +#endif + +#endif // CEF_TESTS_CEFCLIENT_CEFCLIENT_H_ diff --git a/vendor/cef3/cefclient/cefclient.rc b/vendor/cef3/cefclient/cefclient.rc new file mode 100644 index 00000000000..6dc96f3d31a --- /dev/null +++ b/vendor/cef3/cefclient/cefclient.rc @@ -0,0 +1,171 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Binary +// + +IDS_BINDING BINARY "res\\binding.html" +IDS_DIALOGS BINARY "res\\dialogs.html" +IDS_LOCALSTORAGE BINARY "res\\localstorage.html" +IDS_LOGO BINARY "res\\logo.png" +IDS_OSRTEST BINARY "res\\osr_test.html" +IDS_OTHER_TESTS BINARY "res\\other_tests.html" +IDS_PERFORMANCE BINARY "res\\performance.html" +IDS_PERFORMANCE2 BINARY "res\\performance2.html" +IDS_TRANSPARENCY BINARY "res\\transparency.html" +IDS_WINDOW BINARY "res\\window.html" +IDS_XMLHTTPREQUEST BINARY "res\\xmlhttprequest.html" + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_CEFCLIENT ICON "res\cefclient.ico" +IDI_SMALL ICON "res\small.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDC_CEFCLIENT MENU +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Find...", ID_FIND + MENUITEM SEPARATOR + MENUITEM "E&xit", IDM_EXIT + END + POPUP "&Help" + BEGIN + MENUITEM "&About ...", IDM_ABOUT + END + POPUP "Tests" + BEGIN + MENUITEM "Get Source", ID_TESTS_GETSOURCE + MENUITEM "Get Text", ID_TESTS_GETTEXT + MENUITEM "Popup Window", ID_TESTS_POPUP + MENUITEM "Request", ID_TESTS_REQUEST + MENUITEM "Plugin Info", ID_TESTS_PLUGIN_INFO + MENUITEM "Zoom In", ID_TESTS_ZOOM_IN + MENUITEM "Zoom Out", ID_TESTS_ZOOM_OUT + MENUITEM "Zoom Reset", ID_TESTS_ZOOM_RESET + MENUITEM "Begin Tracing", ID_TESTS_TRACING_BEGIN + MENUITEM "End Tracing", ID_TESTS_TRACING_END + MENUITEM "Print", ID_TESTS_PRINT + MENUITEM "Other Tests", ID_TESTS_OTHER_TESTS + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Accelerator +// + +IDC_CEFCLIENT ACCELERATORS +BEGIN + "?", IDM_ABOUT, ASCII, ALT + "/", IDM_ABOUT, ASCII, ALT +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_ABOUTBOX DIALOG 22, 17, 230, 75 +STYLE DS_SETFONT | DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "About" +FONT 8, "System" +BEGIN + ICON IDI_CEFCLIENT,IDC_MYICON,14,9,16,16 + LTEXT "cefclient Version 1.0",IDC_STATIC,49,10,119,8,SS_NOPREFIX + LTEXT "Copyright (C) 2008",IDC_STATIC,49,20,119,8 + DEFPUSHBUTTON "OK",IDOK,195,6,30,11,WS_GROUP +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE +BEGIN + IDS_APP_TITLE "cefclient" + IDC_CEFCLIENT "CEFCLIENT" + IDS_OSR_WIDGET_CLASS "CEFCLIENT-OSR-WIDGET" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/vendor/cef3/cefclient/cefclient_osr_dragdrop_win.cpp b/vendor/cef3/cefclient/cefclient_osr_dragdrop_win.cpp new file mode 100644 index 00000000000..9d0125cf512 --- /dev/null +++ b/vendor/cef3/cefclient/cefclient_osr_dragdrop_win.cpp @@ -0,0 +1,652 @@ +// Copyright (c) 2014 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. + +#include "cefclient/cefclient_osr_dragdrop_win.h" + +#if defined(CEF_USE_ATL) + +#include +#include +#include + +#include +#include + +#include "include/wrapper/cef_helpers.h" +#include "cefclient/bytes_write_handler.h" +#include "cefclient/cefclient_osr_widget_win.h" +#include "cefclient/resource.h" + +namespace { + +DWORD DragOperationToDropEffect(CefRenderHandler::DragOperation allowed_ops) { + DWORD effect = DROPEFFECT_NONE; + if (allowed_ops & DRAG_OPERATION_COPY) + effect |= DROPEFFECT_COPY; + if (allowed_ops & DRAG_OPERATION_LINK) + effect |= DROPEFFECT_LINK; + if (allowed_ops & DRAG_OPERATION_MOVE) + effect |= DROPEFFECT_MOVE; + return effect; +} + +CefRenderHandler::DragOperationsMask DropEffectToDragOperation(DWORD effect) { + DWORD operation = DRAG_OPERATION_NONE; + if (effect & DROPEFFECT_COPY) + operation |= DRAG_OPERATION_COPY; + if (effect & DROPEFFECT_LINK) + operation |= DRAG_OPERATION_LINK; + if (effect & DROPEFFECT_MOVE) + operation |= DRAG_OPERATION_MOVE; + return static_cast(operation); +} + +CefMouseEvent ToMouseEvent(POINTL p, DWORD key_state, HWND hWnd) { + CefMouseEvent ev; + POINT screen_point = { p.x, p.y }; + ScreenToClient(hWnd, &screen_point); + ev.x = screen_point.x; + ev.y = screen_point.y; + ev.modifiers = OSRWindow::GetCefMouseModifiers(key_state); + return ev; +} + + +void GetStorageForBytes(STGMEDIUM* storage, const void* data, size_t bytes) { + HANDLE handle = GlobalAlloc(GPTR, static_cast(bytes)); + if (handle) { + memcpy(handle, data, bytes); + } + + storage->hGlobal = handle; + storage->tymed = TYMED_HGLOBAL; + storage->pUnkForRelease = NULL; +} + +template +void GetStorageForString(STGMEDIUM* stgmed, const std::basic_string& data) { + GetStorageForBytes(stgmed, data.c_str(), + (data.size() + 1) * sizeof(std::basic_string::value_type)); +} + +void GetStorageForFileDescriptor(STGMEDIUM* storage, + const std::wstring& file_name) { + DCHECK(!file_name.empty()); + HANDLE hdata = GlobalAlloc(GPTR, sizeof(FILEGROUPDESCRIPTOR)); + + FILEGROUPDESCRIPTOR* descriptor = + reinterpret_cast(hdata); + descriptor->cItems = 1; + descriptor->fgd[0].dwFlags = FD_LINKUI; + wcsncpy_s(descriptor->fgd[0].cFileName, MAX_PATH, file_name.c_str(), + std::min(file_name.size(), static_cast(MAX_PATH - 1u))); + + storage->tymed = TYMED_HGLOBAL; + storage->hGlobal = hdata; + storage->pUnkForRelease = NULL; +} + +// Helper method for converting from text/html to MS CF_HTML. +// Documentation for the CF_HTML format is available at +// http://msdn.microsoft.com/en-us/library/aa767917(VS.85).aspx +std::string HtmlToCFHtml(const std::string& html, const std::string& base_url) { + if (html.empty()) + return std::string(); + +#define MAX_DIGITS 10 +#define MAKE_NUMBER_FORMAT_1(digits) MAKE_NUMBER_FORMAT_2(digits) +#define MAKE_NUMBER_FORMAT_2(digits) "%0" #digits "u" +#define NUMBER_FORMAT MAKE_NUMBER_FORMAT_1(MAX_DIGITS) + + static const char* header = "Version:0.9\r\n" + "StartHTML:" NUMBER_FORMAT "\r\n" + "EndHTML:" NUMBER_FORMAT "\r\n" + "StartFragment:" NUMBER_FORMAT "\r\n" + "EndFragment:" NUMBER_FORMAT "\r\n"; + static const char* source_url_prefix = "SourceURL:"; + + static const char* start_markup = "\r\n\r\n"; + static const char* end_markup = "\r\n\r\n"; + + // Calculate offsets + size_t start_html_offset = strlen(header) - strlen(NUMBER_FORMAT) * 4 + + MAX_DIGITS * 4; + if (!base_url.empty()) { + start_html_offset += strlen(source_url_prefix) + base_url.length() + + 2; // Add 2 for \r\n. + } + size_t start_fragment_offset = start_html_offset + strlen(start_markup); + size_t end_fragment_offset = start_fragment_offset + html.length(); + size_t end_html_offset = end_fragment_offset + strlen(end_markup); + char raw_result[1024]; + _snprintf(raw_result, sizeof(1024), + header, + start_html_offset, + end_html_offset, + start_fragment_offset, + end_fragment_offset); + std::string result = raw_result; + if (!base_url.empty()) { + result.append(source_url_prefix); + result.append(base_url); + result.append("\r\n"); + } + result.append(start_markup); + result.append(html); + result.append(end_markup); + +#undef MAX_DIGITS +#undef MAKE_NUMBER_FORMAT_1 +#undef MAKE_NUMBER_FORMAT_2 +#undef NUMBER_FORMAT + + return result; +} + +void CFHtmlExtractMetadata(const std::string& cf_html, + std::string* base_url, + size_t* html_start, + size_t* fragment_start, + size_t* fragment_end) { + // Obtain base_url if present. + if (base_url) { + static std::string src_url_str("SourceURL:"); + size_t line_start = cf_html.find(src_url_str); + if (line_start != std::string::npos) { + size_t src_end = cf_html.find("\n", line_start); + size_t src_start = line_start + src_url_str.length(); + if (src_end != std::string::npos && src_start != std::string::npos) { + *base_url = cf_html.substr(src_start, src_end - src_start); + } + } + } + + // Find the markup between "" and "". + // If the comments cannot be found, like copying from OpenOffice Writer, + // we simply fall back to using StartFragment/EndFragment bytecount values + // to determine the fragment indexes. + std::string cf_html_lower = cf_html; + size_t markup_start = cf_html_lower.find("(atoi(cf_html.c_str() + + start_fragment_start + start_fragment_str.length())); + } + + static std::string end_fragment_str("EndFragment:"); + size_t end_fragment_start = cf_html.find(end_fragment_str); + if (end_fragment_start != std::string::npos) { + *fragment_end = static_cast(atoi(cf_html.c_str() + + end_fragment_start + end_fragment_str.length())); + } + } else { + *fragment_start = cf_html.find('>', tag_start) + 1; + size_t tag_end = cf_html.rfind(" + + + + + + + + + + diff --git a/vendor/cef3/cefclient/dialog_test.cpp b/vendor/cef3/cefclient/dialog_test.cpp new file mode 100644 index 00000000000..723c741729c --- /dev/null +++ b/vendor/cef3/cefclient/dialog_test.cpp @@ -0,0 +1,98 @@ +// Copyright (c) 2012 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. + +#include "cefclient/dialog_test.h" +#include "include/cef_browser.h" + +#include + +namespace dialog_test { + +namespace { + +const char kTestUrl[] = "http://tests/dialogs"; +const char kFileOpenMessageName[] = "DialogTest.FileOpen"; +const char kFileOpenMultipleMessageName[] = "DialogTest.FileOpenMultiple"; +const char kFileSaveMessageName[] = "DialogTest.FileSave"; + +// Callback executed when the file dialog is dismissed. +class DialogCallback : public CefRunFileDialogCallback { + public: + explicit DialogCallback( + CefRefPtr router_callback) + : router_callback_(router_callback) { + } + + virtual void OnFileDialogDismissed( + CefRefPtr browser_host, + const std::vector& file_paths) OVERRIDE { + // Send a message back to the render process with the list of file paths. + std::string response; + for (int i = 0; i < static_cast(file_paths.size()); ++i) { + if (!response.empty()) + response += "|"; // Use a delimiter disallowed in file paths. + response += file_paths[i]; + } + + router_callback_->Success(response); + router_callback_ = NULL; + } + + private: + CefRefPtr router_callback_; + + IMPLEMENT_REFCOUNTING(DialogCallback); +}; + +// Handle messages in the browser process. +class Handler : public CefMessageRouterBrowserSide::Handler { + public: + Handler() {} + + // Called due to cefQuery execution in dialogs.html. + virtual bool OnQuery(CefRefPtr browser, + CefRefPtr frame, + int64 query_id, + const CefString& request, + bool persistent, + CefRefPtr callback) OVERRIDE { + // Only handle messages from the test URL. + const std::string& url = frame->GetURL(); + if (url.find(kTestUrl) != 0) + return false; + + // Sample file type filter. + std::vector file_types; + file_types.push_back("text/*"); + file_types.push_back(".log"); + file_types.push_back(".patch"); + + CefRefPtr dialog_callback(new DialogCallback(callback)); + + const std::string& message_name = request; + if (message_name == kFileOpenMessageName) { + browser->GetHost()->RunFileDialog(FILE_DIALOG_OPEN, "My Open Dialog", + "test.txt", file_types, dialog_callback.get()); + } else if (message_name == kFileOpenMultipleMessageName) { + browser->GetHost()->RunFileDialog(FILE_DIALOG_OPEN_MULTIPLE, + "My Open Multiple Dialog", CefString(), file_types, + dialog_callback.get()); + } else if (message_name == kFileSaveMessageName) { + browser->GetHost()->RunFileDialog(FILE_DIALOG_SAVE, "My Save Dialog", + "test.txt", file_types, dialog_callback.get()); + } else { + NOTREACHED(); + } + + return true; + } +}; + +} // namespace + +void CreateMessageHandlers(ClientHandler::MessageHandlerSet& handlers) { + handlers.insert(new Handler()); +} + +} // namespace dialog_test diff --git a/vendor/cef3/cefclient/dialog_test.h b/vendor/cef3/cefclient/dialog_test.h new file mode 100644 index 00000000000..2f2f24520f7 --- /dev/null +++ b/vendor/cef3/cefclient/dialog_test.h @@ -0,0 +1,18 @@ +// Copyright (c) 2012 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. + +#ifndef CEF_TESTS_CEFCLIENT_DIALOG_TEST_H_ +#define CEF_TESTS_CEFCLIENT_DIALOG_TEST_H_ +#pragma once + +#include "cefclient/client_handler.h" + +namespace dialog_test { + +/// Handler creation. Called from ClientHandler. +void CreateMessageHandlers(ClientHandler::MessageHandlerSet& handlers); + +} // namespace dialog_test + +#endif // CEF_TESTS_CEFCLIENT_DIALOG_TEST_H_ diff --git a/vendor/cef3/cefclient/dragdrop_events.h b/vendor/cef3/cefclient/dragdrop_events.h new file mode 100644 index 00000000000..7d8a8f800a9 --- /dev/null +++ b/vendor/cef3/cefclient/dragdrop_events.h @@ -0,0 +1,24 @@ +// Copyright (c) 2014 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. + +#ifndef CEF_TESTS_CEFCLIENT_DRAGDROP_EVENTS_H_ +#define CEF_TESTS_CEFCLIENT_DRAGDROP_EVENTS_H_ +#pragma once +#include "include/cef_render_handler.h" +#include "cefclient/client_handler.h" + +class DragEvents { + public: + virtual CefBrowserHost::DragOperationsMask OnDragEnter( + CefRefPtr drag_data, + CefMouseEvent ev, + CefBrowserHost::DragOperationsMask effect) = 0; + virtual CefBrowserHost::DragOperationsMask OnDragOver(CefMouseEvent ev, + CefBrowserHost::DragOperationsMask effect) = 0; + virtual void OnDragLeave() = 0; + virtual CefBrowserHost::DragOperationsMask OnDrop(CefMouseEvent ev, + CefBrowserHost::DragOperationsMask effect) = 0; +}; + +#endif // CEF_TESTS_CEFCLIENT_DRAGDROP_EVENTS_H_ diff --git a/vendor/cef3/cefclient/osrenderer.cpp b/vendor/cef3/cefclient/osrenderer.cpp new file mode 100644 index 00000000000..c68eb67d169 --- /dev/null +++ b/vendor/cef3/cefclient/osrenderer.cpp @@ -0,0 +1,337 @@ +// Copyright (c) 2012 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. + +#include "cefclient/osrenderer.h" + +#if defined(OS_WIN) +#include +#include +#elif defined(OS_MACOSX) +#include +#elif defined(OS_LINUX) +#include +#include +#else +#error Platform is not supported. +#endif + +#include "include/wrapper/cef_helpers.h" + +#ifndef GL_BGR +#define GL_BGR 0x80E0 +#endif +#ifndef GL_BGRA +#define GL_BGRA 0x80E1 +#endif +#ifndef GL_UNSIGNED_INT_8_8_8_8_REV +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#endif + +// DCHECK on gl errors. +#ifndef NDEBUG +#define VERIFY_NO_ERROR { \ + int _gl_error = glGetError(); \ + DCHECK(_gl_error == GL_NO_ERROR) << \ + "glGetError returned " << _gl_error; \ + } +#else +#define VERIFY_NO_ERROR +#endif + +ClientOSRenderer::ClientOSRenderer(bool transparent, + bool show_update_rect) + : transparent_(transparent), + show_update_rect_(show_update_rect), + initialized_(false), + texture_id_(0), + view_width_(0), + view_height_(0), + spin_x_(0), + spin_y_(0) { +} + +ClientOSRenderer::~ClientOSRenderer() { + Cleanup(); +} + +void ClientOSRenderer::Initialize() { + if (initialized_) + return; + + glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST); VERIFY_NO_ERROR; + + glClearColor(0.0f, 0.0f, 0.0f, 1.0f); VERIFY_NO_ERROR; + + // Necessary for non-power-of-2 textures to render correctly. + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); VERIFY_NO_ERROR; + + // Create the texture. + glGenTextures(1, &texture_id_); VERIFY_NO_ERROR; + DCHECK_NE(texture_id_, 0U); VERIFY_NO_ERROR; + + glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, + GL_NEAREST); VERIFY_NO_ERROR; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, + GL_NEAREST); VERIFY_NO_ERROR; + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); VERIFY_NO_ERROR; + + initialized_ = true; +} + +void ClientOSRenderer::Cleanup() { + if (texture_id_ != 0) + glDeleteTextures(1, &texture_id_); +} + +void ClientOSRenderer::Render() { + if (view_width_ == 0 || view_height_ == 0) + return; + + DCHECK(initialized_); + + struct { + float tu, tv; + float x, y, z; + } static vertices[] = { + {0.0f, 1.0f, -1.0f, -1.0f, 0.0f}, + {1.0f, 1.0f, 1.0f, -1.0f, 0.0f}, + {1.0f, 0.0f, 1.0f, 1.0f, 0.0f}, + {0.0f, 0.0f, -1.0f, 1.0f, 0.0f} + }; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); VERIFY_NO_ERROR; + + glMatrixMode(GL_MODELVIEW); VERIFY_NO_ERROR; + glLoadIdentity(); VERIFY_NO_ERROR; + + // Match GL units to screen coordinates. + glViewport(0, 0, view_width_, view_height_); VERIFY_NO_ERROR; + glMatrixMode(GL_PROJECTION); VERIFY_NO_ERROR; + glLoadIdentity(); VERIFY_NO_ERROR; + + // Draw the background gradient. + glPushAttrib(GL_ALL_ATTRIB_BITS); VERIFY_NO_ERROR; + // Don't check for errors until glEnd(). + glBegin(GL_QUADS); + glColor4f(1.0, 0.0, 0.0, 1.0); // red + glVertex2f(-1.0, -1.0); + glVertex2f(1.0, -1.0); + glColor4f(0.0, 0.0, 1.0, 1.0); // blue + glVertex2f(1.0, 1.0); + glVertex2f(-1.0, 1.0); + glEnd(); VERIFY_NO_ERROR; + glPopAttrib(); VERIFY_NO_ERROR; + + // Rotate the view based on the mouse spin. + if (spin_x_ != 0) { + glRotatef(-spin_x_, 1.0f, 0.0f, 0.0f); VERIFY_NO_ERROR; + } + if (spin_y_ != 0) { + glRotatef(-spin_y_, 0.0f, 1.0f, 0.0f); VERIFY_NO_ERROR; + } + + if (transparent_) { + // Alpha blending style. Texture values have premultiplied alpha. + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); VERIFY_NO_ERROR; + + // Enable alpha blending. + glEnable(GL_BLEND); VERIFY_NO_ERROR; + } + + // Enable 2D textures. + glEnable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + + // Draw the facets with the texture. + DCHECK_NE(texture_id_, 0U); VERIFY_NO_ERROR; + glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR; + glInterleavedArrays(GL_T2F_V3F, 0, vertices); VERIFY_NO_ERROR; + glDrawArrays(GL_QUADS, 0, 4); VERIFY_NO_ERROR; + + // Disable 2D textures. + glDisable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + + if (transparent_) { + // Disable alpha blending. + glDisable(GL_BLEND); VERIFY_NO_ERROR; + } + + // Draw a rectangle around the update region. + if (show_update_rect_ && !update_rect_.IsEmpty()) { + int left = update_rect_.x; + int right = update_rect_.x + update_rect_.width; + int top = update_rect_.y; + int bottom = update_rect_.y + update_rect_.height; + +#if defined(OS_LINUX) + // Shrink the box so that top & right sides are drawn. + top += 1; + right -= 1; +#else + // Shrink the box so that left & bottom sides are drawn. + left += 1; + bottom -= 1; +#endif + + glPushAttrib(GL_ALL_ATTRIB_BITS); VERIFY_NO_ERROR + glMatrixMode(GL_PROJECTION); VERIFY_NO_ERROR; + glPushMatrix(); VERIFY_NO_ERROR; + glLoadIdentity(); VERIFY_NO_ERROR; + glOrtho(0, view_width_, view_height_, 0, 0, 1); VERIFY_NO_ERROR; + + glLineWidth(1); VERIFY_NO_ERROR; + glColor3f(1.0f, 0.0f, 0.0f); VERIFY_NO_ERROR; + // Don't check for errors until glEnd(). + glBegin(GL_LINE_STRIP); + glVertex2i(left, top); + glVertex2i(right, top); + glVertex2i(right, bottom); + glVertex2i(left, bottom); + glVertex2i(left, top); + glEnd(); VERIFY_NO_ERROR; + + glPopMatrix(); VERIFY_NO_ERROR; + glPopAttrib(); VERIFY_NO_ERROR; + } +} + +void ClientOSRenderer::OnPopupShow(CefRefPtr browser, + bool show) { + if (!show) { + // Clear the popup rectangle. + ClearPopupRects(); + } +} + +void ClientOSRenderer::OnPopupSize(CefRefPtr browser, + const CefRect& rect) { + if (rect.width <= 0 || rect.height <= 0) + return; + original_popup_rect_ = rect; + popup_rect_ = GetPopupRectInWebView(original_popup_rect_); +} + +CefRect ClientOSRenderer::GetPopupRectInWebView(const CefRect& original_rect) { + CefRect rc(original_rect); + // if x or y are negative, move them to 0. + if (rc.x < 0) + rc.x = 0; + if (rc.y < 0) + rc.y = 0; + // if popup goes outside the view, try to reposition origin + if (rc.x + rc.width > view_width_) + rc.x = view_width_ - rc.width; + if (rc.y + rc.height > view_height_) + rc.y = view_height_ - rc.height; + // if x or y became negative, move them to 0 again. + if (rc.x < 0) + rc.x = 0; + if (rc.y < 0) + rc.y = 0; + return rc; +} + +void ClientOSRenderer::ClearPopupRects() { + popup_rect_.Set(0, 0, 0, 0); + original_popup_rect_.Set(0, 0, 0, 0); +} + +void ClientOSRenderer::OnPaint(CefRefPtr browser, + CefRenderHandler::PaintElementType type, + const CefRenderHandler::RectList& dirtyRects, + const void* buffer, int width, int height) { + if (!initialized_) + Initialize(); + + if (transparent_) { + // Enable alpha blending. + glEnable(GL_BLEND); VERIFY_NO_ERROR; + } + + // Enable 2D textures. + glEnable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + + DCHECK_NE(texture_id_, 0U); + glBindTexture(GL_TEXTURE_2D, texture_id_); VERIFY_NO_ERROR; + + if (type == PET_VIEW) { + int old_width = view_width_; + int old_height = view_height_; + + view_width_ = width; + view_height_ = height; + + if (show_update_rect_) + update_rect_ = dirtyRects[0]; + + glPixelStorei(GL_UNPACK_ROW_LENGTH, view_width_); VERIFY_NO_ERROR; + + if (old_width != view_width_ || old_height != view_height_ || + (dirtyRects.size() == 1 && + dirtyRects[0] == CefRect(0, 0, view_width_, view_height_))) { + // Update/resize the whole texture. + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); VERIFY_NO_ERROR; + glTexImage2D( + GL_TEXTURE_2D, 0, GL_RGBA, view_width_, view_height_, 0, + GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer); VERIFY_NO_ERROR; + } else { + // Update just the dirty rectangles. + CefRenderHandler::RectList::const_iterator i = dirtyRects.begin(); + for (; i != dirtyRects.end(); ++i) { + const CefRect& rect = *i; + glPixelStorei(GL_UNPACK_SKIP_PIXELS, rect.x); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_ROWS, rect.y); VERIFY_NO_ERROR; + glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x, rect.y, rect.width, + rect.height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, + buffer); VERIFY_NO_ERROR; + } + } + } else if (type == PET_POPUP && popup_rect_.width > 0 && + popup_rect_.height > 0) { + int skip_pixels = 0, x = popup_rect_.x; + int skip_rows = 0, y = popup_rect_.y; + int w = width; + int h = height; + + // Adjust the popup to fit inside the view. + if (x < 0) { + skip_pixels = -x; + x = 0; + } + if (y < 0) { + skip_rows = -y; + y = 0; + } + if (x + w > view_width_) + w -= x + w - view_width_; + if (y + h > view_height_) + h -= y + h - view_height_; + + // Update the popup rectangle. + glPixelStorei(GL_UNPACK_ROW_LENGTH, width); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_PIXELS, skip_pixels); VERIFY_NO_ERROR; + glPixelStorei(GL_UNPACK_SKIP_ROWS, skip_rows); VERIFY_NO_ERROR; + glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, w, h, GL_BGRA, + GL_UNSIGNED_INT_8_8_8_8_REV, buffer); VERIFY_NO_ERROR; + } + + // Disable 2D textures. + glDisable(GL_TEXTURE_2D); VERIFY_NO_ERROR; + + if (transparent_) { + // Disable alpha blending. + glDisable(GL_BLEND); VERIFY_NO_ERROR; + } +} + +void ClientOSRenderer::SetSpin(float spinX, float spinY) { + spin_x_ = spinX; + spin_y_ = spinY; +} + +void ClientOSRenderer::IncrementSpin(float spinDX, float spinDY) { + spin_x_ -= spinDX; + spin_y_ -= spinDY; +} diff --git a/vendor/cef3/cefclient/osrenderer.h b/vendor/cef3/cefclient/osrenderer.h new file mode 100644 index 00000000000..0a866a4995b --- /dev/null +++ b/vendor/cef3/cefclient/osrenderer.h @@ -0,0 +1,67 @@ +// Copyright (c) 2012 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. + +#ifndef CEF_TESTS_CEFCLIENT_OSRENDERER_H_ +#define CEF_TESTS_CEFCLIENT_OSRENDERER_H_ +#pragma once + +#include "include/cef_browser.h" +#include "include/cef_render_handler.h" + +class ClientOSRenderer { + public: + ClientOSRenderer(bool transparent, + bool show_update_rect); + virtual ~ClientOSRenderer(); + + // Initialize the OpenGL environment. + void Initialize(); + + // Clean up the OpenGL environment. + void Cleanup(); + + // Render to the screen. + void Render(); + + // Forwarded from CefRenderHandler callbacks. + void OnPopupShow(CefRefPtr browser, + bool show); + void OnPopupSize(CefRefPtr browser, + const CefRect& rect); + void OnPaint(CefRefPtr browser, + CefRenderHandler::PaintElementType type, + const CefRenderHandler::RectList& dirtyRects, + const void* buffer, int width, int height); + + // Apply spin. + void SetSpin(float spinX, float spinY); + void IncrementSpin(float spinDX, float spinDY); + + bool IsTransparent() { return transparent_; } + + int GetViewWidth() { return view_width_; } + int GetViewHeight() { return view_height_; } + + const CefRect& popup_rect() const { return popup_rect_; } + const CefRect& original_popup_rect() const { return original_popup_rect_; } + + CefRect GetPopupRectInWebView(const CefRect& original_rect); + void ClearPopupRects(); + + private: + const bool transparent_; + const bool show_update_rect_; + bool initialized_; + unsigned int texture_id_; + int view_width_; + int view_height_; + CefRect popup_rect_; + CefRect original_popup_rect_; + float spin_x_; + float spin_y_; + CefRect update_rect_; +}; + +#endif // CEF_TESTS_CEFCLIENT_OSRENDERER_H_ + diff --git a/vendor/cef3/cefclient/performance_test.cpp b/vendor/cef3/cefclient/performance_test.cpp new file mode 100644 index 00000000000..3bcfb2e70f6 --- /dev/null +++ b/vendor/cef3/cefclient/performance_test.cpp @@ -0,0 +1,163 @@ +// Copyright (c) 2012 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. + +#include "cefclient/performance_test.h" + +#include +#include + +#include "include/wrapper/cef_stream_resource_handler.h" +#include "cefclient/performance_test_setup.h" + +namespace performance_test { + +// Use more interations for a Release build. +#ifdef NDEBUG +const int kDefaultIterations = 100000; +#else +const int kDefaultIterations = 10000; +#endif + +namespace { + +const char kGetPerfTests[] = "GetPerfTests"; +const char kRunPerfTest[] = "RunPerfTest"; +const char kPerfTestReturnValue[] = "PerfTestReturnValue"; + +class V8Handler : public CefV8Handler { + public: + V8Handler() { + } + + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) { + if (name == kRunPerfTest) { + if (arguments.size() == 1 && arguments[0]->IsString()) { + // Run the specified perf test. + bool found = false; + + std::string test = arguments[0]->GetStringValue(); + for (int i = 0; i < kPerfTestsCount; ++i) { + if (test == kPerfTests[i].name) { + // Execute the test. + int64 delta = kPerfTests[i].test(kPerfTests[i].iterations); + + retval = CefV8Value::CreateInt(delta); + found = true; + break; + } + } + + if (!found) { + std::string msg = "Unknown test: "; + msg.append(test); + exception = msg; + } + } else { + exception = "Invalid function parameters"; + } + } else if (name == kGetPerfTests) { + // Retrieve the list of perf tests. + retval = CefV8Value::CreateArray(kPerfTestsCount); + for (int i = 0; i < kPerfTestsCount; ++i) { + CefRefPtr val = CefV8Value::CreateArray(2); + val->SetValue(0, CefV8Value::CreateString(kPerfTests[i].name)); + val->SetValue(1, CefV8Value::CreateUInt(kPerfTests[i].iterations)); + retval->SetValue(i, val); + } + } else if (name == kPerfTestReturnValue) { + if (arguments.size() == 0) { + retval = CefV8Value::CreateInt(1); + } else if (arguments.size() == 1 && arguments[0]->IsInt()) { + int32 type = arguments[0]->GetIntValue(); + CefTime date; + switch (type) { + case 0: + retval = CefV8Value::CreateUndefined(); + break; + case 1: + retval = CefV8Value::CreateNull(); + break; + case 2: + retval = CefV8Value::CreateBool(true); + break; + case 3: + retval = CefV8Value::CreateInt(1); + break; + case 4: + retval = CefV8Value::CreateUInt(1); + break; + case 5: + retval = CefV8Value::CreateDouble(1.234); + break; + case 6: + date.Now(); + retval = CefV8Value::CreateDate(date); + break; + case 7: + retval = CefV8Value::CreateString("Hello, world!"); + break; + case 8: + retval = CefV8Value::CreateObject(NULL); + break; + case 9: + retval = CefV8Value::CreateArray(8); + break; + case 10: + // retval = CefV8Value::CreateFunction(...); + exception = "Not implemented"; + break; + default: + exception = "Not supported"; + } + } + } + + return true; + } + + private: + IMPLEMENT_REFCOUNTING(V8Handler); +}; + +// Handle bindings in the render process. +class RenderDelegate : public ClientApp::RenderDelegate { + public: + RenderDelegate() { + } + + virtual void OnContextCreated(CefRefPtr app, + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) OVERRIDE { + CefRefPtr object = context->GetGlobal(); + + CefRefPtr handler = new V8Handler(); + + // Bind test functions. + object->SetValue(kGetPerfTests, + CefV8Value::CreateFunction(kGetPerfTests, handler), + V8_PROPERTY_ATTRIBUTE_READONLY); + object->SetValue(kRunPerfTest, + CefV8Value::CreateFunction(kRunPerfTest, handler), + V8_PROPERTY_ATTRIBUTE_READONLY); + object->SetValue(kPerfTestReturnValue, + CefV8Value::CreateFunction(kPerfTestReturnValue, handler), + V8_PROPERTY_ATTRIBUTE_READONLY); + } + + private: + IMPLEMENT_REFCOUNTING(RenderDelegate); +}; + +} // namespace + +void CreateRenderDelegates(ClientApp::RenderDelegateSet& delegates) { + delegates.insert(new RenderDelegate); +} + +} // namespace performance_test diff --git a/vendor/cef3/cefclient/performance_test.h b/vendor/cef3/cefclient/performance_test.h new file mode 100644 index 00000000000..0b8ed90978b --- /dev/null +++ b/vendor/cef3/cefclient/performance_test.h @@ -0,0 +1,18 @@ +// Copyright (c) 2012 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. + +#ifndef CEF_TESTS_CEFCLIENT_PERFORMANCE_TEST_H_ +#define CEF_TESTS_CEFCLIENT_PERFORMANCE_TEST_H_ +#pragma once + +#include "cefclient/client_app.h" + +namespace performance_test { + +// Render delegate creation. Called from client_app_delegates.cpp. +void CreateRenderDelegates(ClientApp::RenderDelegateSet& delegates); + +} // namespace performance_test + +#endif // CEF_TESTS_CEFCLIENT_PERFORMANCE_TEST_H_ diff --git a/vendor/cef3/cefclient/performance_test_setup.h b/vendor/cef3/cefclient/performance_test_setup.h new file mode 100644 index 00000000000..cbe3e813e72 --- /dev/null +++ b/vendor/cef3/cefclient/performance_test_setup.h @@ -0,0 +1,102 @@ +// Copyright (c) 2012 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. + +#ifndef CEF_TESTS_CEFCLIENT_PERFORMANCE_TEST_SETUP_H_ +#define CEF_TESTS_CEFCLIENT_PERFORMANCE_TEST_SETUP_H_ +#pragma once + +#include "include/base/cef_macros.h" +#include "include/base/cef_logging.h" + +namespace performance_test { + +// Default number of iterations. +extern const int kDefaultIterations; + +// Test name. +#define PERF_TEST_NAME(name) PerfTest##name + +// Entry in test array. +#define PERF_TEST_ENTRY_EX(name, iterations) \ + { #name, PERF_TEST_NAME(name), iterations } +#define PERF_TEST_ENTRY(name) PERF_TEST_ENTRY_EX(name, kDefaultIterations) + +// Test function declaration. +#define PERF_TEST_RESULT int64 +#define PERF_TEST_PARAM_ITERATIONS iterations +#define PERF_TEST_PARAMS int PERF_TEST_PARAM_ITERATIONS +#define PERF_TEST_FUNC(name) \ + PERF_TEST_RESULT PERF_TEST_NAME(name)(PERF_TEST_PARAMS) + +// Typedef for test pointers. +typedef PERF_TEST_RESULT(PerfTest(PERF_TEST_PARAMS)); + +class CefTimer { + public: + CefTimer() : running_(false) { + } + + bool IsRunning() { return running_; } + + void Start() { + DCHECK(!running_); + running_ = true; + start_.Now(); + } + + void Stop() { + stop_.Now(); + DCHECK(running_); + running_ = false; + } + + int64 Delta() { + DCHECK(!running_); + return start_.Delta(stop_); + } + + private: + bool running_; + CefTime start_; + CefTime stop_; + + DISALLOW_COPY_AND_ASSIGN(CefTimer); +}; + +// Peform test iterations using a user-provided timing result variable. +#define PERF_ITERATIONS_START_EX() \ + { \ + CefTimer _timer; \ + _timer.Start(); \ + for (int _i = 0; _i < PERF_TEST_PARAM_ITERATIONS; ++_i) { + +#define PERF_ITERATIONS_END_EX(result) \ + } \ + _timer.Stop(); \ + result = _timer.Delta(); \ + } + +// Perform test iterations and return the timing result. +#define PERF_ITERATIONS_START() \ + int64 _result = 0; \ + PERF_ITERATIONS_START_EX() + +#define PERF_ITERATIONS_END() \ + PERF_ITERATIONS_END_EX(_result) \ + return _result; + +// Perf test entry structure. +struct PerfTestEntry { + const char* name; + PerfTest* test; + int iterations; +}; + +// Array of perf tests. +extern const PerfTestEntry kPerfTests[]; +extern const int kPerfTestsCount; + +} // namespace performance_test + +#endif // CEF_TESTS_CEFCLIENT_PERFORMANCE_TEST_H_ diff --git a/vendor/cef3/cefclient/performance_test_tests.cpp b/vendor/cef3/cefclient/performance_test_tests.cpp new file mode 100644 index 00000000000..bde896914e2 --- /dev/null +++ b/vendor/cef3/cefclient/performance_test_tests.cpp @@ -0,0 +1,328 @@ +// Copyright (c) 2012 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. + +#include "cefclient/performance_test.h" +#include "cefclient/performance_test_setup.h" +#include "include/cef_v8.h" + +namespace performance_test { + +namespace { + +// Test function implementations. + +PERF_TEST_FUNC(V8NullCreate) { + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateNull(); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8BoolCreate) { + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateBool(true); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8IntCreate) { + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateInt(-5); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8UIntCreate) { + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateUInt(10); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8DoubleCreate) { + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateDouble(12.432); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8DateCreate) { + static cef_time_t time = {2012, 1, 0, 1}; + + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateDate(time); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8StringCreate) { + CefString str = "test string"; + + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateString(str); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ArrayCreate) { + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateArray(1); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ArraySetValue) { + CefRefPtr val = CefV8Value::CreateBool(true); + CefRefPtr array = CefV8Value::CreateArray(1); + array->SetValue(0, val); + + PERF_ITERATIONS_START() + array->SetValue(0, val); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ArrayGetValue) { + CefRefPtr val = CefV8Value::CreateBool(true); + CefRefPtr array = CefV8Value::CreateArray(1); + array->SetValue(0, val); + + PERF_ITERATIONS_START() + CefRefPtr ret = array->GetValue(0); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8FunctionCreate) { + class Handler : public CefV8Handler { + public: + Handler() {} + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) OVERRIDE { return false; } + IMPLEMENT_REFCOUNTING(Handler); + }; + + CefString name = "name"; + CefRefPtr handler = new Handler(); + + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateFunction(name, handler); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8FunctionExecute) { + class Handler : public CefV8Handler { + public: + Handler() {} + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) OVERRIDE { return true; } + IMPLEMENT_REFCOUNTING(Handler); + }; + + CefString name = "name"; + CefRefPtr handler = new Handler(); + CefRefPtr func = CefV8Value::CreateFunction(name, handler); + CefRefPtr obj = CefV8Context::GetCurrentContext()->GetGlobal(); + CefV8ValueList args; + + PERF_ITERATIONS_START() + func->ExecuteFunction(obj, args); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8FunctionExecuteWithContext) { + class Handler : public CefV8Handler { + public: + Handler() {} + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) OVERRIDE { return true; } + IMPLEMENT_REFCOUNTING(Handler); + }; + + CefString name = "name"; + CefRefPtr handler = new Handler(); + CefRefPtr func = CefV8Value::CreateFunction(name, handler); + CefRefPtr context = CefV8Context::GetCurrentContext(); + CefRefPtr obj = context->GetGlobal(); + CefV8ValueList args; + + PERF_ITERATIONS_START() + func->ExecuteFunctionWithContext(context, obj, args); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ObjectCreate) { + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateObject(NULL); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ObjectCreateWithAccessor) { + class Accessor : public CefV8Accessor { + public: + Accessor() {} + virtual bool Get(const CefString& name, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) OVERRIDE { + return true; + } + virtual bool Set(const CefString& name, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) OVERRIDE { + return true; + } + IMPLEMENT_REFCOUNTING(Accessor); + }; + + CefRefPtr accessor = new Accessor(); + + PERF_ITERATIONS_START() + CefRefPtr value = CefV8Value::CreateObject(accessor); + PERF_ITERATIONS_END() +} + + +PERF_TEST_FUNC(V8ObjectSetValue) { + CefString name = "name"; + CefRefPtr val = CefV8Value::CreateBool(true); + CefRefPtr obj = CefV8Value::CreateObject(NULL); + obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); + + PERF_ITERATIONS_START() + obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ObjectGetValue) { + CefString name = "name"; + CefRefPtr val = CefV8Value::CreateBool(true); + CefRefPtr obj = CefV8Value::CreateObject(NULL); + obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); + + PERF_ITERATIONS_START() + CefRefPtr ret = obj->GetValue(name); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ObjectSetValueWithAccessor) { + class Accessor : public CefV8Accessor { + public: + Accessor() {} + virtual bool Get(const CefString& name, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) OVERRIDE { + return true; + } + virtual bool Set(const CefString& name, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) OVERRIDE { + val_ = value; + return true; + } + CefRefPtr val_; + IMPLEMENT_REFCOUNTING(Accessor); + }; + + CefRefPtr accessor = new Accessor(); + + CefString name = "name"; + CefRefPtr val = CefV8Value::CreateBool(true); + CefRefPtr obj = CefV8Value::CreateObject(accessor); + obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE); + obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); + + PERF_ITERATIONS_START() + obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ObjectGetValueWithAccessor) { + class Accessor : public CefV8Accessor { + public: + Accessor() : val_(CefV8Value::CreateBool(true)) {} + virtual bool Get(const CefString& name, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) OVERRIDE { + retval = val_; + return true; + } + virtual bool Set(const CefString& name, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) OVERRIDE { + return true; + } + CefRefPtr val_; + IMPLEMENT_REFCOUNTING(Accessor); + }; + + CefRefPtr accessor = new Accessor(); + + CefString name = "name"; + CefRefPtr val = CefV8Value::CreateBool(true); + CefRefPtr obj = CefV8Value::CreateObject(accessor); + obj->SetValue(name, V8_ACCESS_CONTROL_DEFAULT, V8_PROPERTY_ATTRIBUTE_NONE); + obj->SetValue(name, val, V8_PROPERTY_ATTRIBUTE_NONE); + + PERF_ITERATIONS_START() + CefRefPtr ret = obj->GetValue(name); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ContextEnterExit) { + CefRefPtr context = CefV8Context::GetCurrentContext(); + + PERF_ITERATIONS_START() + context->Enter(); + context->Exit(); + PERF_ITERATIONS_END() +} + +PERF_TEST_FUNC(V8ContextEval) { + CefRefPtr context = CefV8Context::GetCurrentContext(); + CefString jsCode = "var i = 0;"; + CefRefPtr retval; + CefRefPtr exception; + + PERF_ITERATIONS_START() + context->Eval(jsCode, retval, exception); + PERF_ITERATIONS_END() +} + +} // namespace + + +// Test function entries. + +const PerfTestEntry kPerfTests[] = { + PERF_TEST_ENTRY(V8NullCreate), + PERF_TEST_ENTRY(V8BoolCreate), + PERF_TEST_ENTRY(V8IntCreate), + PERF_TEST_ENTRY(V8UIntCreate), + PERF_TEST_ENTRY(V8DoubleCreate), + PERF_TEST_ENTRY(V8DateCreate), + PERF_TEST_ENTRY(V8StringCreate), + PERF_TEST_ENTRY(V8ArrayCreate), + PERF_TEST_ENTRY(V8ArraySetValue), + PERF_TEST_ENTRY(V8ArrayGetValue), + PERF_TEST_ENTRY(V8FunctionCreate), + PERF_TEST_ENTRY(V8FunctionExecute), + PERF_TEST_ENTRY(V8FunctionExecuteWithContext), + PERF_TEST_ENTRY(V8ObjectCreate), + PERF_TEST_ENTRY(V8ObjectCreateWithAccessor), + PERF_TEST_ENTRY(V8ObjectSetValue), + PERF_TEST_ENTRY(V8ObjectGetValue), + PERF_TEST_ENTRY(V8ObjectSetValueWithAccessor), + PERF_TEST_ENTRY(V8ObjectGetValueWithAccessor), + PERF_TEST_ENTRY(V8ContextEnterExit), + PERF_TEST_ENTRY(V8ContextEval), +}; + +const int kPerfTestsCount = (sizeof(kPerfTests) / sizeof(kPerfTests[0])); + +} // namespace performance_test diff --git a/vendor/cef3/cefclient/res/binding.html b/vendor/cef3/cefclient/res/binding.html new file mode 100644 index 00000000000..9ee0775ec2a --- /dev/null +++ b/vendor/cef3/cefclient/res/binding.html @@ -0,0 +1,28 @@ + + +Binding Test + + + + +
+Message: +
+
You should see the reverse of your message below: +
+
+ + diff --git a/vendor/cef3/cefclient/res/cefclient.ico b/vendor/cef3/cefclient/res/cefclient.ico new file mode 100644 index 00000000000..d551aa3aaf8 Binary files /dev/null and b/vendor/cef3/cefclient/res/cefclient.ico differ diff --git a/vendor/cef3/cefclient/res/dialogs.html b/vendor/cef3/cefclient/res/dialogs.html new file mode 100644 index 00000000000..becec40e5bd --- /dev/null +++ b/vendor/cef3/cefclient/res/dialogs.html @@ -0,0 +1,64 @@ + + +Dialog Test + + + +
+Click a button to show the associated dialog type. +
+
+
+
input type="file": +
+
+
+

+
+ + diff --git a/vendor/cef3/cefclient/res/localstorage.html b/vendor/cef3/cefclient/res/localstorage.html new file mode 100644 index 00000000000..87c6e68cb14 --- /dev/null +++ b/vendor/cef3/cefclient/res/localstorage.html @@ -0,0 +1,24 @@ + + + +Click the "Add Line" button to add a line or the "Clear" button to clear.
+This data will persist across sessions if a cache path was specified.
+ + +
+ + + diff --git a/vendor/cef3/cefclient/res/logo.png b/vendor/cef3/cefclient/res/logo.png new file mode 100644 index 00000000000..a2a15f44e97 Binary files /dev/null and b/vendor/cef3/cefclient/res/logo.png differ diff --git a/vendor/cef3/cefclient/res/osr_test.html b/vendor/cef3/cefclient/res/osr_test.html new file mode 100644 index 00000000000..a12223de978 --- /dev/null +++ b/vendor/cef3/cefclient/res/osr_test.html @@ -0,0 +1,109 @@ + + OSR Test + + + +

+ OSR Testing h1 - Focus and blur + + this page and will get this red black +

+
    +
  1. OnPaint should be called each time a page loads
  2. +
  3. Move mouse + to require an OnCursorChange call
  4. +
  5. Hover will color this with + red. Will trigger OnPaint once on enter and once on leave
  6. +
  7. Right clicking will show contextual menu and will request + GetScreenPoint
  8. +
  9. IsWindowRenderingDisabled should be true
  10. +
  11. WasResized should trigger full repaint if size changes. +
  12. +
  13. Invalidate should trigger OnPaint once
  14. +
  15. Click and write here with SendKeyEvent to trigger repaints: +
  16. +
  17. Click here with SendMouseClickEvent to navigate: +
  18. +
  19. Mouse over this element will + trigger show a tooltip
  20. +
+
+ Drag here +
+
+
+
+
+
+
+
+
+
+ + diff --git a/vendor/cef3/cefclient/res/other_tests.html b/vendor/cef3/cefclient/res/other_tests.html new file mode 100644 index 00000000000..83b261d14c4 --- /dev/null +++ b/vendor/cef3/cefclient/res/other_tests.html @@ -0,0 +1,32 @@ + + +Other Tests + + +

Various other internal and external tests.

+ + + diff --git a/vendor/cef3/cefclient/res/performance.html b/vendor/cef3/cefclient/res/performance.html new file mode 100644 index 00000000000..aa64d51d712 --- /dev/null +++ b/vendor/cef3/cefclient/res/performance.html @@ -0,0 +1,293 @@ + + + + Performance Tests + + + +

Performance Tests

+ Filter: +
+ +
+ + + + + + + + + + + + + +
NameIterations per RunAvg (ms)Min (ms)Max (ms)StdDev (ms)Runs (ms)
+
+ +
+ + Result 1: +
Result 2: +
+ +
+ + + + + + + + + + +
NameResult 1 Avg (ms)Result 2 Avg (ms)% Diff
+
+ + + + + diff --git a/vendor/cef3/cefclient/res/performance2.html b/vendor/cef3/cefclient/res/performance2.html new file mode 100644 index 00000000000..6664de7b2d3 --- /dev/null +++ b/vendor/cef3/cefclient/res/performance2.html @@ -0,0 +1,442 @@ + + + + Performance Tests (2) + + + +

Performance Tests (2)

+ +
+ + + + + + + + + + + + + + + + + + + +
Settings:
Iterations:
Samples:
Mode:Asynchronous + Synchronous +
+
+ + +
+ +
+ + + + + + + + + + + + + + + + + + + +
EnabledNameSamples x IterationsMin, msAvg, msMax, msAverage calls/secMeasuring InacurracyMemory, MBMemory delta, MBDescription
+
+ + + + + diff --git a/vendor/cef3/cefclient/res/small.ico b/vendor/cef3/cefclient/res/small.ico new file mode 100644 index 00000000000..d551aa3aaf8 Binary files /dev/null and b/vendor/cef3/cefclient/res/small.ico differ diff --git a/vendor/cef3/cefclient/res/transparency.html b/vendor/cef3/cefclient/res/transparency.html new file mode 100644 index 00000000000..a8dd3b46ed0 --- /dev/null +++ b/vendor/cef3/cefclient/res/transparency.html @@ -0,0 +1,63 @@ + + + +Transparency Examples + + + + +

Image Transparency

+Hover over an image to make it fully opaque.
+klematis +klematis + +

Block Transparency

+White 0% White 25% White 50% White 75% White 100% +
+Black 0% Black 25% Black 50% Black 75% Black 100% + + + diff --git a/vendor/cef3/cefclient/res/window.html b/vendor/cef3/cefclient/res/window.html new file mode 100644 index 00000000000..7d4fe66405f --- /dev/null +++ b/vendor/cef3/cefclient/res/window.html @@ -0,0 +1,48 @@ + + +Window Test + + + +
+Click a button to perform the associated window action. +
+
+
(minimizes and then restores the window as topmost) +
X: Y: Width: Height: +
+ + diff --git a/vendor/cef3/cefclient/res/xmlhttprequest.html b/vendor/cef3/cefclient/res/xmlhttprequest.html new file mode 100644 index 00000000000..051f814866f --- /dev/null +++ b/vendor/cef3/cefclient/res/xmlhttprequest.html @@ -0,0 +1,19 @@ + + + +
+URL: +
+
+
+ + diff --git a/vendor/cef3/cefclient/resource.h b/vendor/cef3/cefclient/resource.h new file mode 100644 index 00000000000..5bcfd2b7f89 --- /dev/null +++ b/vendor/cef3/cefclient/resource.h @@ -0,0 +1,69 @@ +// Copyright (c) 2013 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. + +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by cefclient.rc +// +#define BINARY 256 +#define IDC_MYICON 2 +#define IDD_CEFCLIENT_DIALOG 102 +#define IDS_APP_TITLE 103 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_CEFCLIENT 107 +#define IDI_SMALL 108 +#define IDC_CEFCLIENT 109 +#define IDS_OSR_WIDGET_CLASS 110 +#define IDR_MAINFRAME 128 +#define IDC_NAV_BACK 200 +#define IDC_NAV_FORWARD 201 +#define IDC_NAV_RELOAD 202 +#define IDC_NAV_STOP 203 +#define ID_WARN_CONSOLEMESSAGE 32000 +#define ID_WARN_DOWNLOADCOMPLETE 32001 +#define ID_WARN_DOWNLOADERROR 32002 +#define ID_QUIT 32500 +#define ID_FIND 32501 +#define ID_TESTS_GETSOURCE 32700 +#define ID_TESTS_GETTEXT 32701 +#define ID_TESTS_OTHER_TESTS 32702 +#define ID_TESTS_PLUGIN_INFO 32703 +#define ID_TESTS_POPUP 32704 +#define ID_TESTS_PRINT 32705 +#define ID_TESTS_REQUEST 32706 +#define ID_TESTS_TRACING_BEGIN 32707 +#define ID_TESTS_TRACING_END 32708 +#define ID_TESTS_ZOOM_IN 32709 +#define ID_TESTS_ZOOM_OUT 32710 +#define ID_TESTS_ZOOM_RESET 32711 +#define IDC_STATIC -1 +#define IDS_BINDING 1000 +#define IDS_DIALOGS 1001 +#define IDS_LOCALSTORAGE 1002 +#define IDS_LOGO 1003 +#define IDS_LOGOBALL 1004 +#define IDS_OSRTEST 1005 +#define IDS_OTHER_TESTS 1006 +#define IDS_PERFORMANCE 1007 +#define IDS_TRANSPARENCY 1008 +#define IDS_WINDOW 1009 +#define IDS_XMLHTTPREQUEST 1010 +#define IDS_PERFORMANCE2 1011 + +// Avoid files associated with MacOS +#define _X86_ + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_COMMAND_VALUE 32774 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 111 +#endif +#endif diff --git a/vendor/cef3/cefclient/resource_util.h b/vendor/cef3/cefclient/resource_util.h new file mode 100644 index 00000000000..d3883079275 --- /dev/null +++ b/vendor/cef3/cefclient/resource_util.h @@ -0,0 +1,23 @@ +// Copyright (c) 2013 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. + +#ifndef CEF_TESTS_CEFCLIENT_RESOURCE_UTIL_H_ +#define CEF_TESTS_CEFCLIENT_RESOURCE_UTIL_H_ +#pragma once + +#include +#include "include/cef_stream.h" + +#if defined(OS_POSIX) +// Returns the directory containing resource files. +bool GetResourceDir(std::string& dir); +#endif + +// Retrieve a resource as a string. +bool LoadBinaryResource(const char* resource_name, std::string& resource_data); + +// Retrieve a resource as a steam reader. +CefRefPtr GetBinaryResourceReader(const char* resource_name); + +#endif // CEF_TESTS_CEFCLIENT_RESOURCE_UTIL_H_ diff --git a/vendor/cef3/cefclient/resource_util_win.cpp b/vendor/cef3/cefclient/resource_util_win.cpp new file mode 100644 index 00000000000..8ec83131d9f --- /dev/null +++ b/vendor/cef3/cefclient/resource_util_win.cpp @@ -0,0 +1,91 @@ +// Copyright (c) 2013 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. + +#include "cefclient/resource_util.h" +#include "include/base/cef_logging.h" +#include "include/cef_stream.h" +#include "include/wrapper/cef_byte_read_handler.h" +#include "cefclient/resource.h" + +namespace { + +bool LoadBinaryResource(int binaryId, DWORD &dwSize, LPBYTE &pBytes) { + HINSTANCE hInst = GetModuleHandle(NULL); + HRSRC hRes = FindResource(hInst, MAKEINTRESOURCE(binaryId), + MAKEINTRESOURCE(256)); + if (hRes) { + HGLOBAL hGlob = LoadResource(hInst, hRes); + if (hGlob) { + dwSize = SizeofResource(hInst, hRes); + pBytes = (LPBYTE)LockResource(hGlob); + if (dwSize > 0 && pBytes) + return true; + } + } + + return false; +} + +int GetResourceId(const char* resource_name) { + // Map of resource labels to BINARY id values. + static struct _resource_map { + char* name; + int id; + } resource_map[] = { + {"binding.html", IDS_BINDING}, + {"dialogs.html", IDS_DIALOGS}, + {"localstorage.html", IDS_LOCALSTORAGE}, + {"logo.png", IDS_LOGO}, + {"osr_test.html", IDS_OSRTEST}, + {"other_tests.html", IDS_OTHER_TESTS}, + {"performance.html", IDS_PERFORMANCE}, + {"performance2.html", IDS_PERFORMANCE2}, + {"transparency.html", IDS_TRANSPARENCY}, + {"window.html", IDS_WINDOW}, + {"xmlhttprequest.html", IDS_XMLHTTPREQUEST}, + }; + + for (int i = 0; i < sizeof(resource_map)/sizeof(_resource_map); ++i) { + if (!strcmp(resource_map[i].name, resource_name)) + return resource_map[i].id; + } + + return 0; +} + +} // namespace + +bool LoadBinaryResource(const char* resource_name, std::string& resource_data) { + int resource_id = GetResourceId(resource_name); + if (resource_id == 0) + return false; + + DWORD dwSize; + LPBYTE pBytes; + + if (LoadBinaryResource(resource_id, dwSize, pBytes)) { + resource_data = std::string(reinterpret_cast(pBytes), dwSize); + return true; + } + + NOTREACHED(); // The resource should be found. + return false; +} + +CefRefPtr GetBinaryResourceReader(const char* resource_name) { + int resource_id = GetResourceId(resource_name); + if (resource_id == 0) + return NULL; + + DWORD dwSize; + LPBYTE pBytes; + + if (LoadBinaryResource(resource_id, dwSize, pBytes)) { + return CefStreamReader::CreateForHandler( + new CefByteReadHandler(pBytes, dwSize, NULL)); + } + + NOTREACHED(); // The resource should be found. + return NULL; +} diff --git a/vendor/cef3/cefclient/scheme_test.cpp b/vendor/cef3/cefclient/scheme_test.cpp new file mode 100644 index 00000000000..77324787594 --- /dev/null +++ b/vendor/cef3/cefclient/scheme_test.cpp @@ -0,0 +1,163 @@ +// Copyright (c) 2012 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. + +#include "cefclient/scheme_test.h" + +#include +#include + +#include "include/cef_browser.h" +#include "include/cef_callback.h" +#include "include/cef_frame.h" +#include "include/cef_resource_handler.h" +#include "include/cef_response.h" +#include "include/cef_request.h" +#include "include/cef_scheme.h" +#include "include/wrapper/cef_helpers.h" +#include "cefclient/resource_util.h" +#include "cefclient/string_util.h" + +#if defined(OS_WIN) +#include "cefclient/resource.h" +#endif + +namespace scheme_test { + +namespace { + +// Implementation of the schema handler for client:// requests. +class ClientSchemeHandler : public CefResourceHandler { + public: + ClientSchemeHandler() : offset_(0) {} + + virtual bool ProcessRequest(CefRefPtr request, + CefRefPtr callback) + OVERRIDE { + CEF_REQUIRE_IO_THREAD(); + + bool handled = false; + + std::string url = request->GetURL(); + if (strstr(url.c_str(), "handler.html") != NULL) { + // Build the response html + data_ = "Client Scheme Handler" + "" + "This contents of this page page are served by the " + "ClientSchemeHandler class handling the client:// protocol." + "
You should see an image:" + "
";
+
+      // Output a string representation of the request
+      std::string dump;
+      DumpRequestContents(request, dump);
+      data_.append(dump);
+
+      data_.append("

Try the test form:" + "
" + "" + "" + "" + "
"); + + handled = true; + + // Set the resulting mime type + mime_type_ = "text/html"; + } else if (strstr(url.c_str(), "logo.png") != NULL) { + // Load the response image + if (LoadBinaryResource("logo.png", data_)) { + handled = true; + // Set the resulting mime type + mime_type_ = "image/png"; + } + } + + if (handled) { + // Indicate the headers are available. + callback->Continue(); + return true; + } + + return false; + } + + virtual void GetResponseHeaders(CefRefPtr response, + int64& response_length, + CefString& redirectUrl) OVERRIDE { + CEF_REQUIRE_IO_THREAD(); + + DCHECK(!data_.empty()); + + response->SetMimeType(mime_type_); + response->SetStatus(200); + + // Set the resulting response length + response_length = data_.length(); + } + + virtual void Cancel() OVERRIDE { + CEF_REQUIRE_IO_THREAD(); + } + + virtual bool ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) + OVERRIDE { + CEF_REQUIRE_IO_THREAD(); + + bool has_data = false; + bytes_read = 0; + + if (offset_ < data_.length()) { + // Copy the next block of data into the buffer. + int transfer_size = + std::min(bytes_to_read, static_cast(data_.length() - offset_)); + memcpy(data_out, data_.c_str() + offset_, transfer_size); + offset_ += transfer_size; + + bytes_read = transfer_size; + has_data = true; + } + + return has_data; + } + + private: + std::string data_; + std::string mime_type_; + size_t offset_; + + IMPLEMENT_REFCOUNTING(ClientSchemeHandler); +}; + +// Implementation of the factory for for creating schema handlers. +class ClientSchemeHandlerFactory : public CefSchemeHandlerFactory { + public: + // Return a new scheme handler instance to handle the request. + virtual CefRefPtr Create(CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) + OVERRIDE { + CEF_REQUIRE_IO_THREAD(); + return new ClientSchemeHandler(); + } + + IMPLEMENT_REFCOUNTING(ClientSchemeHandlerFactory); +}; + +} // namespace + +void RegisterCustomSchemes(CefRefPtr registrar, + std::vector& cookiable_schemes) { + registrar->AddCustomScheme("client", true, false, false); +} + +void InitTest() { + CefRegisterSchemeHandlerFactory("client", "tests", + new ClientSchemeHandlerFactory()); +} + +} // namespace scheme_test diff --git a/vendor/cef3/cefclient/scheme_test.h b/vendor/cef3/cefclient/scheme_test.h new file mode 100644 index 00000000000..36f67083540 --- /dev/null +++ b/vendor/cef3/cefclient/scheme_test.h @@ -0,0 +1,26 @@ +// Copyright (c) 2009 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. + +#ifndef CEF_TESTS_CEFCLIENT_SCHEME_TEST_H_ +#define CEF_TESTS_CEFCLIENT_SCHEME_TEST_H_ +#pragma once + +#include +#include "include/cef_base.h" + +class CefBrowser; +class CefSchemeRegistrar; + +namespace scheme_test { + +// Register the scheme. +void RegisterCustomSchemes(CefRefPtr registrar, + std::vector& cookiable_schemes); + +// Create the scheme handler. +void InitTest(); + +} // namespace scheme_test + +#endif // CEF_TESTS_CEFCLIENT_SCHEME_TEST_H_ diff --git a/vendor/cef3/cefclient/string_util.cpp b/vendor/cef3/cefclient/string_util.cpp new file mode 100644 index 00000000000..ebeca5c034b --- /dev/null +++ b/vendor/cef3/cefclient/string_util.cpp @@ -0,0 +1,74 @@ +// Copyright (c) 2010 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. + +#include "cefclient/string_util.h" +#include +#include +#include "include/cef_request.h" + +void DumpRequestContents(CefRefPtr request, std::string& str) { + std::stringstream ss; + + ss << "URL: " << std::string(request->GetURL()); + ss << "\nMethod: " << std::string(request->GetMethod()); + + CefRequest::HeaderMap headerMap; + request->GetHeaderMap(headerMap); + if (headerMap.size() > 0) { + ss << "\nHeaders:"; + CefRequest::HeaderMap::const_iterator it = headerMap.begin(); + for (; it != headerMap.end(); ++it) { + ss << "\n\t" << std::string((*it).first) << ": " << + std::string((*it).second); + } + } + + CefRefPtr postData = request->GetPostData(); + if (postData.get()) { + CefPostData::ElementVector elements; + postData->GetElements(elements); + if (elements.size() > 0) { + ss << "\nPost Data:"; + CefRefPtr element; + CefPostData::ElementVector::const_iterator it = elements.begin(); + for (; it != elements.end(); ++it) { + element = (*it); + if (element->GetType() == PDE_TYPE_BYTES) { + // the element is composed of bytes + ss << "\n\tBytes: "; + if (element->GetBytesCount() == 0) { + ss << "(empty)"; + } else { + // retrieve the data. + size_t size = element->GetBytesCount(); + char* bytes = new char[size]; + element->GetBytes(size, bytes); + ss << std::string(bytes, size); + delete [] bytes; + } + } else if (element->GetType() == PDE_TYPE_FILE) { + ss << "\n\tFile: " << std::string(element->GetFile()); + } + } + } + } + + str = ss.str(); +} + +std::string StringReplace(const std::string& str, const std::string& from, + const std::string& to) { + std::string result = str; + std::string::size_type pos = 0; + std::string::size_type from_len = from.length(); + std::string::size_type to_len = to.length(); + do { + pos = result.find(from, pos); + if (pos != std::string::npos) { + result.replace(pos, from_len, to); + pos += to_len; + } + } while (pos != std::string::npos); + return result; +} diff --git a/vendor/cef3/cefclient/string_util.h b/vendor/cef3/cefclient/string_util.h new file mode 100644 index 00000000000..c43e6f210fc --- /dev/null +++ b/vendor/cef3/cefclient/string_util.h @@ -0,0 +1,21 @@ +// Copyright (c) 2010 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. + +#ifndef CEF_TESTS_CEFCLIENT_STRING_UTIL_H_ +#define CEF_TESTS_CEFCLIENT_STRING_UTIL_H_ +#pragma once + +#include +#include "include/cef_base.h" + +class CefRequest; + +// Dump the contents of the request into a string. +void DumpRequestContents(CefRefPtr request, std::string& str); + +// Replace all instances of |from| with |to| in |str|. +std::string StringReplace(const std::string& str, const std::string& from, + const std::string& to); + +#endif // CEF_TESTS_CEFCLIENT_STRING_UTIL_H_ diff --git a/vendor/cef3/cefclient/window_test.cpp b/vendor/cef3/cefclient/window_test.cpp new file mode 100644 index 00000000000..2a86842bfe9 --- /dev/null +++ b/vendor/cef3/cefclient/window_test.cpp @@ -0,0 +1,102 @@ +// Copyright (c) 2013 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. + +#include "cefclient/window_test.h" + +#include +#include +#include +#include + +#include "include/wrapper/cef_stream_resource_handler.h" + +namespace window_test { + +namespace { + +const char kTestUrl[] = "http://tests/window"; +const char kMessagePositionName[] = "WindowTest.Position"; +const char kMessageMinimizeName[] = "WindowTest.Minimize"; +const char kMessageMaximizeName[] = "WindowTest.Maximize"; +const char kMessageRestoreName[] = "WindowTest.Restore"; + +// Handle messages in the browser process. +class Handler : public CefMessageRouterBrowserSide::Handler { + public: + Handler() {} + + // Called due to cefBroadcast execution in window.html. + virtual bool OnQuery(CefRefPtr browser, + CefRefPtr frame, + int64 query_id, + const CefString& request, + bool persistent, + CefRefPtr callback) OVERRIDE { + // Only handle messages from the test URL. + const std::string& url = frame->GetURL(); + if (url.find(kTestUrl) != 0) + return false; + + const std::string& message_name = request; + if (message_name.find(kMessagePositionName) == 0) { + // Parse the comma-delimited list of integer values. + std::vector vec; + const std::string& vals = + message_name.substr(sizeof(kMessagePositionName)); + std::stringstream ss(vals); + int i; + while (ss >> i) { + vec.push_back(i); + if (ss.peek() == ',') + ss.ignore(); + } + + if (vec.size() == 4) { + SetPos(browser->GetHost()->GetWindowHandle(), + vec[0], vec[1], vec[2], vec[3]); + } + } else if (message_name == kMessageMinimizeName) { + Minimize(browser->GetHost()->GetWindowHandle()); + } else if (message_name == kMessageMaximizeName) { + Maximize(browser->GetHost()->GetWindowHandle()); + } else if (message_name == kMessageRestoreName) { + Restore(browser->GetHost()->GetWindowHandle()); + } else { + NOTREACHED(); + } + + callback->Success(""); + return true; + } +}; + +} // namespace + +void CreateMessageHandlers(ClientHandler::MessageHandlerSet& handlers) { + handlers.insert(new Handler()); +} + +void ModifyBounds(const CefRect& display, CefRect& window) { + window.x += display.x; + window.y += display.y; + + if (window.x < display.x) + window.x = display.x; + if (window.y < display.y) + window.y = display.y; + if (window.width < 100) + window.width = 100; + else if (window.width >= display.width) + window.width = display.width; + if (window.height < 100) + window.height = 100; + else if (window.height >= display.height) + window.height = display.height; + if (window.x + window.width >= display.x + display.width) + window.x = display.x + display.width - window.width; + if (window.y + window.height >= display.y + display.height) + window.y = display.y + display.height - window.height; +} + +} // namespace window_test diff --git a/vendor/cef3/cefclient/window_test.h b/vendor/cef3/cefclient/window_test.h new file mode 100644 index 00000000000..3a99a21f1c5 --- /dev/null +++ b/vendor/cef3/cefclient/window_test.h @@ -0,0 +1,28 @@ +// Copyright (c) 2013 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. + +#ifndef CEF_TESTS_CEFCLIENT_WINDOW_TEST_H_ +#define CEF_TESTS_CEFCLIENT_WINDOW_TEST_H_ +#pragma once + +#include "cefclient/client_handler.h" + +namespace window_test { + +/// Handler creation. Called from ClientHandler. +void CreateMessageHandlers(ClientHandler::MessageHandlerSet& handlers); + +// Fit |window| inside |display|. Coordinates are relative to the upper-left +// corner of the display. +void ModifyBounds(const CefRect& display, CefRect& window); + +// Platform implementations. +void SetPos(CefWindowHandle handle, int x, int y, int width, int height); +void Minimize(CefWindowHandle handle); +void Maximize(CefWindowHandle handle); +void Restore(CefWindowHandle handle); + +} // namespace window_test + +#endif // CEF_TESTS_CEFCLIENT_WINDOW_TEST_H_ diff --git a/vendor/cef3/cefclient/window_test_win.cpp b/vendor/cef3/cefclient/window_test_win.cpp new file mode 100644 index 00000000000..f905e4312d3 --- /dev/null +++ b/vendor/cef3/cefclient/window_test_win.cpp @@ -0,0 +1,78 @@ +// Copyright (c) 2013 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. + +#include "cefclient/window_test.h" + +namespace window_test { + +namespace { + +// Toggles the current display state. +void Toggle(CefWindowHandle handle, UINT nCmdShow) { + HWND root_wnd = ::GetAncestor(handle, GA_ROOT); + + // Retrieve current window placement information. + WINDOWPLACEMENT placement; + ::GetWindowPlacement(root_wnd, &placement); + + if (placement.showCmd == nCmdShow) + ::ShowWindow(root_wnd, SW_RESTORE); + else + ::ShowWindow(root_wnd, nCmdShow); +} + +} // namespace + +void SetPos(CefWindowHandle handle, int x, int y, int width, int height) { + HWND root_wnd = ::GetAncestor(handle, GA_ROOT); + + // Retrieve current window placement information. + WINDOWPLACEMENT placement; + ::GetWindowPlacement(root_wnd, &placement); + + // Retrieve information about the display that contains the window. + HMONITOR monitor = MonitorFromRect(&placement.rcNormalPosition, + MONITOR_DEFAULTTONEAREST); + MONITORINFO info; + info.cbSize = sizeof(info); + GetMonitorInfo(monitor, &info); + + // Make sure the window is inside the display. + CefRect display_rect( + info.rcWork.left, + info.rcWork.top, + info.rcWork.right - info.rcWork.left, + info.rcWork.bottom - info.rcWork.top); + CefRect window_rect(x, y, width, height); + ModifyBounds(display_rect, window_rect); + + if (placement.showCmd == SW_MINIMIZE || placement.showCmd == SW_MAXIMIZE) { + // The window is currently minimized or maximized. Restore it to the desired + // position. + placement.rcNormalPosition.left = window_rect.x; + placement.rcNormalPosition.right = window_rect.x + window_rect.width; + placement.rcNormalPosition.top = window_rect.y; + placement.rcNormalPosition.bottom = window_rect.y + window_rect.height; + ::SetWindowPlacement(root_wnd, &placement); + ::ShowWindow(root_wnd, SW_RESTORE); + } else { + // Set the window position. + ::SetWindowPos(root_wnd, NULL, window_rect.x, window_rect.y, + window_rect.width, window_rect.height, SWP_NOZORDER); + } +} + +void Minimize(CefWindowHandle handle) { + Toggle(handle, SW_MINIMIZE); +} + +void Maximize(CefWindowHandle handle) { + Toggle(handle, SW_MAXIMIZE); +} + +void Restore(CefWindowHandle handle) { + ::ShowWindow(::GetAncestor(handle, GA_ROOT), SW_RESTORE); +} + +} // namespace window_test diff --git a/vendor/cef3/cefclient2005.sln b/vendor/cef3/cefclient2005.sln new file mode 100644 index 00000000000..bc106dc7f53 --- /dev/null +++ b/vendor/cef3/cefclient2005.sln @@ -0,0 +1,51 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cefclient", "cefclient.vcproj", "{6617FED9-C5D4-4907-BF55-A90062A6683F}" + ProjectSection(ProjectDependencies) = postProject + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cefsimple", "cefsimple.vcproj", "{5390D142-473F-49A0-BC5E-5F6C609EEDB6}" + ProjectSection(ProjectDependencies) = postProject + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_dll_wrapper", "libcef_dll_wrapper.vcproj", "{A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|Win32 = Debug|Win32 + Release|x64 = Release|x64 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|x64.ActiveCfg = Debug|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|x64.Build.0 = Debug|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|Win32.ActiveCfg = Debug|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|Win32.Build.0 = Debug|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|x64.ActiveCfg = Release|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|x64.Build.0 = Release|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|Win32.ActiveCfg = Release|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|Win32.Build.0 = Release|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|x64.ActiveCfg = Debug|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|x64.Build.0 = Debug|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|Win32.ActiveCfg = Debug|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|Win32.Build.0 = Debug|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|x64.ActiveCfg = Release|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|x64.Build.0 = Release|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.ActiveCfg = Release|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.Build.0 = Release|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|x64.ActiveCfg = Debug|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|x64.Build.0 = Debug|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|Win32.ActiveCfg = Debug|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|Win32.Build.0 = Debug|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|x64.ActiveCfg = Release|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|x64.Build.0 = Release|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|Win32.ActiveCfg = Release|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vendor/cef3/cefclient2008.sln b/vendor/cef3/cefclient2008.sln new file mode 100644 index 00000000000..030a04dde83 --- /dev/null +++ b/vendor/cef3/cefclient2008.sln @@ -0,0 +1,51 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cefclient", "cefclient.vcproj", "{6617FED9-C5D4-4907-BF55-A90062A6683F}" + ProjectSection(ProjectDependencies) = postProject + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cefsimple", "cefsimple.vcproj", "{5390D142-473F-49A0-BC5E-5F6C609EEDB6}" + ProjectSection(ProjectDependencies) = postProject + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_dll_wrapper", "libcef_dll_wrapper.vcproj", "{A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|Win32 = Debug|Win32 + Release|x64 = Release|x64 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|x64.ActiveCfg = Debug|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|x64.Build.0 = Debug|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|Win32.ActiveCfg = Debug|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|Win32.Build.0 = Debug|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|x64.ActiveCfg = Release|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|x64.Build.0 = Release|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|Win32.ActiveCfg = Release|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|Win32.Build.0 = Release|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|x64.ActiveCfg = Debug|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|x64.Build.0 = Debug|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|Win32.ActiveCfg = Debug|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|Win32.Build.0 = Debug|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|x64.ActiveCfg = Release|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|x64.Build.0 = Release|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.ActiveCfg = Release|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.Build.0 = Release|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|x64.ActiveCfg = Debug|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|x64.Build.0 = Debug|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|Win32.ActiveCfg = Debug|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|Win32.Build.0 = Debug|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|x64.ActiveCfg = Release|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|x64.Build.0 = Release|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|Win32.ActiveCfg = Release|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vendor/cef3/cefclient2010.sln b/vendor/cef3/cefclient2010.sln new file mode 100644 index 00000000000..91f24a06fd1 --- /dev/null +++ b/vendor/cef3/cefclient2010.sln @@ -0,0 +1,51 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cefclient", "cefclient.vcxproj", "{6617FED9-C5D4-4907-BF55-A90062A6683F}" + ProjectSection(ProjectDependencies) = postProject + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cefsimple", "cefsimple.vcxproj", "{5390D142-473F-49A0-BC5E-5F6C609EEDB6}" + ProjectSection(ProjectDependencies) = postProject + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} = {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcef_dll_wrapper", "libcef_dll_wrapper.vcxproj", "{A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|Win32 = Debug|Win32 + Release|x64 = Release|x64 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|x64.ActiveCfg = Debug|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|x64.Build.0 = Debug|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|Win32.ActiveCfg = Debug|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Debug|Win32.Build.0 = Debug|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|x64.ActiveCfg = Release|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|x64.Build.0 = Release|x64 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|Win32.ActiveCfg = Release|Win32 + {5390D142-473F-49A0-BC5E-5F6C609EEDB6}.Release|Win32.Build.0 = Release|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|x64.ActiveCfg = Debug|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|x64.Build.0 = Debug|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|Win32.ActiveCfg = Debug|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Debug|Win32.Build.0 = Debug|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|x64.ActiveCfg = Release|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|x64.Build.0 = Release|x64 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.ActiveCfg = Release|Win32 + {6617FED9-C5D4-4907-BF55-A90062A6683F}.Release|Win32.Build.0 = Release|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|x64.ActiveCfg = Debug|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|x64.Build.0 = Debug|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|Win32.ActiveCfg = Debug|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Debug|Win32.Build.0 = Debug|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|x64.ActiveCfg = Release|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|x64.Build.0 = Release|x64 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|Win32.ActiveCfg = Release|Win32 + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/vendor/cef3/cefsimple.vcproj b/vendor/cef3/cefsimple.vcproj new file mode 100644 index 00000000000..2a0c034e2d5 --- /dev/null +++ b/vendor/cef3/cefsimple.vcproj @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/vendor/cef3/cefsimple.vcxproj b/vendor/cef3/cefsimple.vcxproj new file mode 100644 index 00000000000..0a75a921a1d --- /dev/null +++ b/vendor/cef3/cefsimple.vcxproj @@ -0,0 +1,434 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + {5390D142-473F-49A0-BC5E-5F6C609EEDB6} + Win32Proj + cefsimple + true + + + + Unicode + Application + + + + + + + + + true + $(ExecutablePath);$(MSBuildProjectDirectory)\.\bin\;$(MSBuildProjectDirectory)\.\bin\ + out\$(Configuration)\ + $(OutDir)obj\$(ProjectName)\ + false + false + true + true + $(ProjectName) + $(OutDir)\$(ProjectName)$(TargetExt) + + + + $(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + /MP /we4389 %(AdditionalOptions) + EnableFastChecks + true + ProgramDatabase + 4127;4351;4355;4503;4611;4100;4121;4189;4244;4481;4505;4510;4512;4610;4996;4702;%(DisableSpecificWarnings) + false + true + false + Disabled + _DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions) + MultiThreadedDebug + false + true + Level4 + + + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /ignore:4221 %(AdditionalOptions) + MachineX86 + + + wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib;comctl32.lib;shlwapi.lib;rpcrt4.lib;$(Configuration)\libcef.lib + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;$(Configuration);%(AdditionalLibraryDirectories) + /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions) + dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;%(DelayLoadDLLs) + false + true + $(OutDir)lib\$(TargetName).lib + $(OutDir)$(TargetName).map + 5.01 + $(OutDir)$(ProjectName)$(TargetExt) + false + Windows + MachineX86 + + + cefsimple/cefsimple.exe.manifest;cefsimple/compatibility.manifest + + + %(Filename).dlldata.c + true + %(Filename).h + %(Filename)_i.c + $(IntDir) + %(Filename)_p.c + %(Filename).tlb + + + ../../..;$(OutDir)obj/global_intermediate;$(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + 0x0409 + _DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions) + + + + + $(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + /MP /we4389 %(AdditionalOptions) + EnableFastChecks + true + ProgramDatabase + 4127;4351;4355;4503;4611;4100;4121;4189;4244;4481;4505;4510;4512;4610;4996;4702;%(DisableSpecificWarnings) + false + true + false + Disabled + _DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions) + MultiThreadedDebug + false + true + Level4 + + + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;%(AdditionalLibraryDirectories) + /ignore:4221 %(AdditionalOptions) + MachineX64 + + + wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib;comctl32.lib;shlwapi.lib;rpcrt4.lib;$(Configuration)\libcef.lib + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;$(Configuration);%(AdditionalLibraryDirectories) + /dynamicbase /ignore:4199 /ignore:4221 /nxcompat %(AdditionalOptions) + dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;%(DelayLoadDLLs) + false + true + olepro32.lib + $(OutDir)lib\$(TargetName).lib + $(OutDir)$(TargetName).map + 5.02 + $(OutDir)$(ProjectName)$(TargetExt) + false + Windows + MachineX64 + + + cefsimple/cefsimple.exe.manifest;cefsimple/compatibility.manifest + + + %(Filename).dlldata.c + true + %(Filename).h + %(Filename)_i.c + $(IntDir) + %(Filename)_p.c + %(Filename).tlb + + + ../../..;$(OutDir)obj/global_intermediate;$(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + 0x0409 + _DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions) + + + + + $(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + /MP /we4389 /d2Zi+ /Zc:inline /Oy- %(AdditionalOptions) + true + ProgramDatabase + 4127;4351;4355;4503;4611;4100;4121;4189;4244;4481;4505;4510;4512;4610;4996;4702;%(DisableSpecificWarnings) + false + true + AnySuitable + false + false + MaxSpeed + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions) + MultiThreaded + false + true + true + Level4 + + + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /ignore:4221 %(AdditionalOptions) + MachineX86 + + + wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib;comctl32.lib;shlwapi.lib;rpcrt4.lib;$(Configuration)\libcef.lib + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;$(Configuration);%(AdditionalLibraryDirectories) + /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions) + dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;%(DelayLoadDLLs) + true + false + true + $(OutDir)lib\$(TargetName).lib + $(OutDir)$(TargetName).map + 5.01 + true + $(OutDir)$(ProjectName)$(TargetExt) + true + Windows + MachineX86 + + + cefsimple/cefsimple.exe.manifest;cefsimple/compatibility.manifest + + + %(Filename).dlldata.c + true + %(Filename).h + %(Filename)_i.c + $(IntDir) + %(Filename)_p.c + %(Filename).tlb + + + ../../..;$(OutDir)obj/global_intermediate;$(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + 0x0409 + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + + + + + $(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + /MP /we4389 /d2Zi+ /Zc:inline /Oy- %(AdditionalOptions) + true + ProgramDatabase + 4127;4351;4355;4503;4611;4100;4121;4189;4244;4481;4505;4510;4512;4610;4996;4702;%(DisableSpecificWarnings) + false + true + AnySuitable + false + false + MaxSpeed + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions) + MultiThreaded + false + true + true + Level4 + + + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;%(AdditionalLibraryDirectories) + /ignore:4221 %(AdditionalOptions) + MachineX64 + + + wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib;comctl32.lib;shlwapi.lib;rpcrt4.lib;$(Configuration)\libcef.lib + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x64;$(Configuration);%(AdditionalLibraryDirectories) + /dynamicbase /ignore:4199 /ignore:4221 /nxcompat %(AdditionalOptions) + dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;%(DelayLoadDLLs) + true + false + true + olepro32.lib + $(OutDir)lib\$(TargetName).lib + $(OutDir)$(TargetName).map + 5.02 + true + $(OutDir)$(ProjectName)$(TargetExt) + true + Windows + MachineX64 + + + cefsimple/cefsimple.exe.manifest;cefsimple/compatibility.manifest + + + %(Filename).dlldata.c + true + %(Filename).h + %(Filename)_i.c + $(IntDir) + %(Filename)_p.c + %(Filename).tlb + + + ../../..;$(OutDir)obj/global_intermediate;$(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + 0x0409 + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Document + call call xcopy /efy "Resources\*" "$(OutDir)" if %errorlevel% neq 0 exit /b %errorlevel% call call xcopy /efy "$(Configuration)\*.exe" "$(OutDir)" if %errorlevel% neq 0 exit /b %errorlevel% call call xcopy /efy "$(Configuration)\*.dll" "$(OutDir)" if %errorlevel% neq 0 exit /b %errorlevel% + copy_resources, and also copy_executables, and also copy_libraries + $(OutDir)\copy_resources.stamp;$(OutDir)\copy_executables.stamp;$(OutDir)\copy_libraries.stamp + + + + + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + false + + + + + diff --git a/vendor/cef3/cefsimple.vcxproj.filters b/vendor/cef3/cefsimple.vcxproj.filters new file mode 100644 index 00000000000..dd55ce184c1 --- /dev/null +++ b/vendor/cef3/cefsimple.vcxproj.filters @@ -0,0 +1,950 @@ + + + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {1177910C-2DCE-8F2F-24FB-580080DDACDC} + + + {16A7AE48-7112-6B21-A89A-39014A9628C6} + + + {1177910C-2DCE-8F2F-24FB-580080DDACDC} + + + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base\internal + + + include\base\internal + + + include\base\internal + + + include\base\internal + + + include\base\internal + + + include + + + include + + + include + + + include + + + include + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + cefsimple + + + cefsimple + + + cefsimple + + + cefsimple + + + include\base\internal + + + include\base\internal + + + include + + + include\internal + + + include\internal + + + cefsimple + + + cefsimple + + + cefsimple + + + cefsimple + + + cefsimple + + + cefsimple\res + + + cefsimple\res + + + + diff --git a/vendor/cef3/cefsimple/CMakeLists.txt b/vendor/cef3/cefsimple/CMakeLists.txt new file mode 100644 index 00000000000..e179022e3d6 --- /dev/null +++ b/vendor/cef3/cefsimple/CMakeLists.txt @@ -0,0 +1,199 @@ +# Copyright (c) 2014 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. + +# +# Source files. +# + +# cefsimple sources. +set(CEFSIMPLE_SRCS + simple_app.cpp + simple_app.h + simple_handler.cpp + simple_handler.h + ) +set(CEFSIMPLE_SRCS_LINUX + cefsimple_linux.cpp + simple_handler_linux.cpp + ) +set(CEFSIMPLE_SRCS_MACOSX + cefsimple_mac.mm + simple_handler_mac.mm + ) +set(CEFSIMPLE_SRCS_WINDOWS + cefsimple.exe.manifest + cefsimple.rc + cefsimple_win.cpp + resource.h + simple_handler_win.cpp + ) +APPEND_PLATFORM_SOURCES(CEFSIMPLE_SRCS) +source_group(cefsimple FILES ${CEFSIMPLE_SRCS}) + +set(CEFSIMPLE_RES_SRCS_WINDOWS + res/cefsimple.ico + res/small.ico + ) +APPEND_PLATFORM_SOURCES(CEFSIMPLE_RES_SRCS) +source_group(cefsimple\\\\res FILES ${CEFSIMPLE_RES_SRCS}) + +set(CEFSIMPLE_SRCS + ${CEFSIMPLE_SRCS} + ${CEFSIMPLE_RES_SRCS} + ) + +# cefsimple helper sources. +set(CEFSIMPLE_HELPER_SRCS_MACOSX + process_helper_mac.cpp + ) +APPEND_PLATFORM_SOURCES(CEFSIMPLE_HELPER_SRCS) +source_group(cefsimple FILES ${CEFSIMPLE_HELPER_SRCS}) + +# cefsimple resources. +set(CEFSIMPLE_RESOURCES_MAC_SRCS_MACOSX + mac/Info.plist + mac/cefsimple.icns + ) +APPEND_PLATFORM_SOURCES(CEFSIMPLE_RESOURCES_MAC_SRCS) +source_group(cefsimple\\\\mac FILES ${CEFSIMPLE_RESOURCES_MAC_SRCS}) + +set(CEFSIMPLE_RESOURCES_MAC_ENGLISH_LPROJ_SRCS_MACOSX + mac/English.lproj/InfoPlist.strings + mac/English.lproj/MainMenu.xib + ) +APPEND_PLATFORM_SOURCES(CEFSIMPLE_RESOURCES_MAC_ENGLISH_LPROJ_SRCS) +source_group(cefsimple\\\\mac\\\\English.lproj FILES ${CEFSIMPLE_RESOURCES_MAC_ENGLISH_LPROJ_SRCS}) + +set(CEFSIMPLE_RESOURCES_SRCS + ${CEFSIMPLE_RESOURCES_MAC_SRCS} + ${CEFSIMPLE_RESOURCES_MAC_ENGLISH_LPROJ_SRCS} + ) + + +# +# Shared configuration. +# + +# Target executable names. +set(CEF_TARGET "cefsimple") +if(OS_MACOSX) + set(CEF_HELPER_TARGET "cefsimple Helper") +endif() + +# Logical target used to link the libcef library. +ADD_LOGICAL_TARGET("libcef_lib" "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}") + +# Determine the target output directory. +SET_CEF_TARGET_OUT_DIR() + + +# +# Linux configuration. +# + +if(OS_LINUX) + # Executable target. + add_executable(${CEF_TARGET} ${CEFSIMPLE_SRCS}) + add_dependencies(${CEF_TARGET} libcef_dll_wrapper) + target_link_libraries(${CEF_TARGET} libcef_lib libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + + # Set rpath so that libraries can be placed next to the executable. + set_target_properties(${CEF_TARGET} PROPERTIES INSTALL_RPATH "$ORIGIN") + set_target_properties(${CEF_TARGET} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE) + set_target_properties(${CEF_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CEF_TARGET_OUT_DIR}) + + # Copy binary and resource files to the target output directory. + COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}") + COPY_FILES("${CEF_TARGET}" "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${CEF_TARGET_OUT_DIR}") + + # Set SUID permissions on the chrome-sandbox target. + SET_LINUX_SUID_PERMISSIONS("${CEF_TARGET}" "${CEF_TARGET_OUT_DIR}/chrome-sandbox") +endif() + + +# +# Mac OS X configuration. +# + +if(OS_MACOSX) + # Output paths for the app bundles. + set(CEF_APP "${CEF_TARGET_OUT_DIR}/${CEF_TARGET}.app") + set(CEF_HELPER_APP "${CEF_TARGET_OUT_DIR}/${CEF_HELPER_TARGET}.app") + + # Variable referenced from Info.plist files. + set(PRODUCT_NAME "${CEF_TARGET}") + + # Helper executable target. + add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_HELPER_SRCS}) + add_dependencies(${CEF_HELPER_TARGET} libcef_dll_wrapper) + target_link_libraries(${CEF_HELPER_TARGET} libcef_lib libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + set_target_properties(${CEF_HELPER_TARGET} PROPERTIES + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist + ) + + # Fix the framework link in the helper executable. + FIX_MACOSX_HELPER_FRAMEWORK_LINK(${CEF_HELPER_TARGET} ${CEF_HELPER_APP}) + + # Main executable target. + add_executable(${CEF_TARGET} MACOSX_BUNDLE ${CEFSIMPLE_RESOURCES_SRCS} ${CEFSIMPLE_SRCS}) + add_dependencies(${CEF_TARGET} libcef_dll_wrapper "${CEF_HELPER_TARGET}") + target_link_libraries(${CEF_TARGET} libcef_lib libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + set_target_properties(${CEF_TARGET} PROPERTIES + RESOURCE "${CEFSIMPLE_RESOURCES_SRCS}" + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/Info.plist + ) + + # Copy files into the main app bundle. + add_custom_command( + TARGET ${CEF_TARGET} + POST_BUILD + # Copy the helper app bundle into the Frameworks directory. + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CEF_HELPER_APP}" + "${CEF_APP}/Contents/Frameworks/${CEF_HELPER_TARGET}.app" + # Copy the CEF framework into the Frameworks directory. + COMMAND ${CMAKE_COMMAND} -E copy_directory + "${CEF_BINARY_DIR}/Chromium Embedded Framework.framework" + "${CEF_APP}/Contents/Frameworks/Chromium Embedded Framework.framework" + VERBATIM + ) + + # Fix the framework link in the main executable. + FIX_MACOSX_MAIN_FRAMEWORK_LINK(${CEF_TARGET} ${CEF_APP}) + + # Make the other helper app bundles. + MAKE_MACOSX_HELPERS(${CEF_TARGET} ${CEF_APP}) + + if(NOT ${CMAKE_GENERATOR} STREQUAL "Xcode") + # Manually process and copy over resource files. + # The Xcode generator handles this via the set_target_properties RESOURCE directive. + set(PREFIXES "mac/") # Remove these prefixes from input file paths. + COPY_MACOSX_RESOURCES("${CEFSIMPLE_RESOURCES_SRCS}" "${PREFIXES}" "${CEF_TARGET}" "${CMAKE_CURRENT_SOURCE_DIR}" "${CEF_APP}") + endif() +endif() + + +# +# Windows configuration. +# + +if(OS_WINDOWS) + # Executable target. + add_executable(${CEF_TARGET} WIN32 ${CEFSIMPLE_SRCS}) + add_dependencies(${CEF_TARGET} libcef_dll_wrapper) + target_link_libraries(${CEF_TARGET} libcef_lib libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + + if(USE_SANDBOX) + # Logical target used to link the cef_sandbox library. + ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") + target_link_libraries(${CEF_TARGET} cef_sandbox_lib ${CEF_SANDBOX_STANDARD_LIBS}) + endif() + + # Add the custom manifest files to the executable. + ADD_WINDOWS_MANIFEST("${CEF_TARGET}") + + # Copy binary and resource files to the target output directory. + COPY_FILES("${CEF_TARGET}" "${CEF_BINARY_FILES}" "${CEF_BINARY_DIR}" "${CEF_TARGET_OUT_DIR}") + COPY_FILES("${CEF_TARGET}" "${CEF_RESOURCE_FILES}" "${CEF_RESOURCE_DIR}" "${CEF_TARGET_OUT_DIR}") +endif() diff --git a/vendor/cef3/cefsimple/README-TRANSFER.txt b/vendor/cef3/cefsimple/README-TRANSFER.txt new file mode 100644 index 00000000000..cec48215572 --- /dev/null +++ b/vendor/cef3/cefsimple/README-TRANSFER.txt @@ -0,0 +1,6 @@ +Files in this directory have been copied from other locations in the Chromium +source tree. They have been modified only to the extent necessary to work in +the CEF Binary Distribution directory structure. Below is a listing of the +original file locations. + +../build/win/compatibility.manifest diff --git a/vendor/cef3/cefsimple/cefsimple.exe.manifest b/vendor/cef3/cefsimple/cefsimple.exe.manifest new file mode 100644 index 00000000000..d36f084b659 --- /dev/null +++ b/vendor/cef3/cefsimple/cefsimple.exe.manifest @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/cef3/cefsimple/cefsimple.rc b/vendor/cef3/cefsimple/cefsimple.rc new file mode 100644 index 00000000000..c4f3f2973a1 --- /dev/null +++ b/vendor/cef3/cefsimple/cefsimple.rc @@ -0,0 +1,79 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +#undef APSTUDIO_HIDDEN_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_CEFSIMPLE ICON "res\cefsimple.ico" +IDI_SMALL ICON "res\small.ico" + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""windows.h""\r\n" + "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/vendor/cef3/cefsimple/cefsimple_win.cpp b/vendor/cef3/cefsimple/cefsimple_win.cpp new file mode 100644 index 00000000000..84a082a9068 --- /dev/null +++ b/vendor/cef3/cefsimple/cefsimple_win.cpp @@ -0,0 +1,75 @@ +// Copyright (c) 2013 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. + +#include + +#include "cefsimple/simple_app.h" +#include "include/cef_sandbox_win.h" + + +// When generating projects with CMake the CEF_USE_SANDBOX value will be defined +// automatically if using the required compiler version. Pass -DUSE_SANDBOX=OFF +// to the CMake command-line to disable use of the sandbox. +// Uncomment this line to manually enable sandbox support. +// #define CEF_USE_SANDBOX 1 + +#if defined(CEF_USE_SANDBOX) +// The cef_sandbox.lib static library is currently built with VS2013. It may not +// link successfully with other VS versions. +#pragma comment(lib, "cef_sandbox.lib") +#endif + + +// Entry point function for all processes. +int APIENTRY wWinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPTSTR lpCmdLine, + int nCmdShow) { + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + void* sandbox_info = NULL; + +#if defined(CEF_USE_SANDBOX) + // Manage the life span of the sandbox information object. This is necessary + // for sandbox support on Windows. See cef_sandbox_win.h for complete details. + CefScopedSandboxInfo scoped_sandbox; + sandbox_info = scoped_sandbox.sandbox_info(); +#endif + + // Provide CEF with command-line arguments. + CefMainArgs main_args(hInstance); + + // SimpleApp implements application-level callbacks. It will create the first + // browser instance in OnContextInitialized() after CEF has initialized. + CefRefPtr app(new SimpleApp); + + // CEF applications have multiple sub-processes (render, plugin, GPU, etc) + // that share the same executable. This function checks the command-line and, + // if this is a sub-process, executes the appropriate logic. + int exit_code = CefExecuteProcess(main_args, app.get(), sandbox_info); + if (exit_code >= 0) { + // The sub-process has completed so return here. + return exit_code; + } + + // Specify CEF global settings here. + CefSettings settings; + +#if !defined(CEF_USE_SANDBOX) + settings.no_sandbox = true; +#endif + + // Initialize CEF. + CefInitialize(main_args, settings, app.get(), sandbox_info); + + // Run the CEF message loop. This will block until CefQuitMessageLoop() is + // called. + CefRunMessageLoop(); + + // Shut down CEF. + CefShutdown(); + + return 0; +} diff --git a/vendor/cef3/cefsimple/compatibility.manifest b/vendor/cef3/cefsimple/compatibility.manifest new file mode 100644 index 00000000000..f7bc13e593b --- /dev/null +++ b/vendor/cef3/cefsimple/compatibility.manifest @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/vendor/cef3/cefsimple/res/cefsimple.ico b/vendor/cef3/cefsimple/res/cefsimple.ico new file mode 100644 index 00000000000..d551aa3aaf8 Binary files /dev/null and b/vendor/cef3/cefsimple/res/cefsimple.ico differ diff --git a/vendor/cef3/cefsimple/res/small.ico b/vendor/cef3/cefsimple/res/small.ico new file mode 100644 index 00000000000..d551aa3aaf8 Binary files /dev/null and b/vendor/cef3/cefsimple/res/small.ico differ diff --git a/vendor/cef3/cefsimple/resource.h b/vendor/cef3/cefsimple/resource.h new file mode 100644 index 00000000000..19093ded400 --- /dev/null +++ b/vendor/cef3/cefsimple/resource.h @@ -0,0 +1,26 @@ +// Copyright (c) 2013 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. + +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by cefsimple.rc +// + +#define IDI_CEFSIMPLE 100 +#define IDI_SMALL 101 + +// Avoid files associated with MacOS +#define _X86_ + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 32700 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/vendor/cef3/cefsimple/simple_app.cpp b/vendor/cef3/cefsimple/simple_app.cpp new file mode 100644 index 00000000000..f09ee8ab771 --- /dev/null +++ b/vendor/cef3/cefsimple/simple_app.cpp @@ -0,0 +1,48 @@ +// Copyright (c) 2013 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. + +#include "cefsimple/simple_app.h" + +#include + +#include "cefsimple/simple_handler.h" +#include "include/cef_browser.h" +#include "include/cef_command_line.h" +#include "include/wrapper/cef_helpers.h" + +SimpleApp::SimpleApp() { +} + +void SimpleApp::OnContextInitialized() { + CEF_REQUIRE_UI_THREAD(); + + // Information used when creating the native window. + CefWindowInfo window_info; + +#if defined(OS_WIN) + // On Windows we need to specify certain flags that will be passed to + // CreateWindowEx(). + window_info.SetAsPopup(NULL, "cefsimple"); +#endif + + // SimpleHandler implements browser-level callbacks. + CefRefPtr handler(new SimpleHandler()); + + // Specify CEF browser settings here. + CefBrowserSettings browser_settings; + + std::string url; + + // Check if a "--url=" value was provided via the command-line. If so, use + // that instead of the default URL. + CefRefPtr command_line = + CefCommandLine::GetGlobalCommandLine(); + url = command_line->GetSwitchValue("url"); + if (url.empty()) + url = "http://www.google.com"; + + // Create the first browser window. + CefBrowserHost::CreateBrowser(window_info, handler.get(), url, + browser_settings, NULL); +} diff --git a/vendor/cef3/cefsimple/simple_app.h b/vendor/cef3/cefsimple/simple_app.h new file mode 100644 index 00000000000..1e454a428be --- /dev/null +++ b/vendor/cef3/cefsimple/simple_app.h @@ -0,0 +1,27 @@ +// Copyright (c) 2013 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. + +#ifndef CEF_TESTS_CEFSIMPLE_SIMPLE_APP_H_ +#define CEF_TESTS_CEFSIMPLE_SIMPLE_APP_H_ + +#include "include/cef_app.h" + +class SimpleApp : public CefApp, + public CefBrowserProcessHandler { + public: + SimpleApp(); + + // CefApp methods: + virtual CefRefPtr GetBrowserProcessHandler() + OVERRIDE { return this; } + + // CefBrowserProcessHandler methods: + virtual void OnContextInitialized() OVERRIDE; + + private: + // Include the default reference counting implementation. + IMPLEMENT_REFCOUNTING(SimpleApp); +}; + +#endif // CEF_TESTS_CEFSIMPLE_SIMPLE_APP_H_ diff --git a/vendor/cef3/cefsimple/simple_handler.cpp b/vendor/cef3/cefsimple/simple_handler.cpp new file mode 100644 index 00000000000..0d71f0e20ab --- /dev/null +++ b/vendor/cef3/cefsimple/simple_handler.cpp @@ -0,0 +1,111 @@ +// Copyright (c) 2013 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. + +#include "cefsimple/simple_handler.h" + +#include +#include + +#include "include/base/cef_bind.h" +#include "include/cef_app.h" +#include "include/wrapper/cef_closure_task.h" +#include "include/wrapper/cef_helpers.h" + +namespace { + +SimpleHandler* g_instance = NULL; + +} // namespace + +SimpleHandler::SimpleHandler() + : is_closing_(false) { + DCHECK(!g_instance); + g_instance = this; +} + +SimpleHandler::~SimpleHandler() { + g_instance = NULL; +} + +// static +SimpleHandler* SimpleHandler::GetInstance() { + return g_instance; +} + +void SimpleHandler::OnAfterCreated(CefRefPtr browser) { + CEF_REQUIRE_UI_THREAD(); + + // Add to the list of existing browsers. + browser_list_.push_back(browser); +} + +bool SimpleHandler::DoClose(CefRefPtr browser) { + CEF_REQUIRE_UI_THREAD(); + + // Closing the main window requires special handling. See the DoClose() + // documentation in the CEF header for a detailed destription of this + // process. + if (browser_list_.size() == 1) { + // Set a flag to indicate that the window close should be allowed. + is_closing_ = true; + } + + // Allow the close. For windowed browsers this will result in the OS close + // event being sent. + return false; +} + +void SimpleHandler::OnBeforeClose(CefRefPtr browser) { + CEF_REQUIRE_UI_THREAD(); + + // Remove from the list of existing browsers. + BrowserList::iterator bit = browser_list_.begin(); + for (; bit != browser_list_.end(); ++bit) { + if ((*bit)->IsSame(browser)) { + browser_list_.erase(bit); + break; + } + } + + if (browser_list_.empty()) { + // All browser windows have closed. Quit the application message loop. + CefQuitMessageLoop(); + } +} + +void SimpleHandler::OnLoadError(CefRefPtr browser, + CefRefPtr frame, + ErrorCode errorCode, + const CefString& errorText, + const CefString& failedUrl) { + CEF_REQUIRE_UI_THREAD(); + + // Don't display an error for downloaded files. + if (errorCode == ERR_ABORTED) + return; + + // Display a load error message. + std::stringstream ss; + ss << "" + "

Failed to load URL " << std::string(failedUrl) << + " with error " << std::string(errorText) << " (" << errorCode << + ").

"; + frame->LoadString(ss.str(), failedUrl); +} + +void SimpleHandler::CloseAllBrowsers(bool force_close) { + if (!CefCurrentlyOn(TID_UI)) { + // Execute on the UI thread. + CefPostTask(TID_UI, + base::Bind(&SimpleHandler::CloseAllBrowsers, this, force_close)); + return; + } + + if (browser_list_.empty()) + return; + + BrowserList::const_iterator it = browser_list_.begin(); + for (; it != browser_list_.end(); ++it) + (*it)->GetHost()->CloseBrowser(force_close); +} diff --git a/vendor/cef3/cefsimple/simple_handler.h b/vendor/cef3/cefsimple/simple_handler.h new file mode 100644 index 00000000000..1f272ff1fe3 --- /dev/null +++ b/vendor/cef3/cefsimple/simple_handler.h @@ -0,0 +1,66 @@ +// Copyright (c) 2013 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. + +#ifndef CEF_TESTS_CEFSIMPLE_SIMPLE_HANDLER_H_ +#define CEF_TESTS_CEFSIMPLE_SIMPLE_HANDLER_H_ + +#include "include/cef_client.h" + +#include + +class SimpleHandler : public CefClient, + public CefDisplayHandler, + public CefLifeSpanHandler, + public CefLoadHandler { + public: + SimpleHandler(); + ~SimpleHandler(); + + // Provide access to the single global instance of this object. + static SimpleHandler* GetInstance(); + + // CefClient methods: + virtual CefRefPtr GetDisplayHandler() OVERRIDE { + return this; + } + virtual CefRefPtr GetLifeSpanHandler() OVERRIDE { + return this; + } + virtual CefRefPtr GetLoadHandler() OVERRIDE { + return this; + } + + // CefDisplayHandler methods: + virtual void OnTitleChange(CefRefPtr browser, + const CefString& title) OVERRIDE; + + // CefLifeSpanHandler methods: + virtual void OnAfterCreated(CefRefPtr browser) OVERRIDE; + virtual bool DoClose(CefRefPtr browser) OVERRIDE; + virtual void OnBeforeClose(CefRefPtr browser) OVERRIDE; + + // CefLoadHandler methods: + virtual void OnLoadError(CefRefPtr browser, + CefRefPtr frame, + ErrorCode errorCode, + const CefString& errorText, + const CefString& failedUrl) OVERRIDE; + + // Request that all existing browser windows close. + void CloseAllBrowsers(bool force_close); + + bool IsClosing() const { return is_closing_; } + + private: + // List of existing browser windows. Only accessed on the CEF UI thread. + typedef std::list > BrowserList; + BrowserList browser_list_; + + bool is_closing_; + + // Include the default reference counting implementation. + IMPLEMENT_REFCOUNTING(SimpleHandler); +}; + +#endif // CEF_TESTS_CEFSIMPLE_SIMPLE_HANDLER_H_ diff --git a/vendor/cef3/cefsimple/simple_handler_win.cpp b/vendor/cef3/cefsimple/simple_handler_win.cpp new file mode 100644 index 00000000000..32fc1c00886 --- /dev/null +++ b/vendor/cef3/cefsimple/simple_handler_win.cpp @@ -0,0 +1,19 @@ +// Copyright (c) 2013 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. + +#include "cefsimple/simple_handler.h" + +#include +#include + +#include "include/cef_browser.h" +#include "include/wrapper/cef_helpers.h" + +void SimpleHandler::OnTitleChange(CefRefPtr browser, + const CefString& title) { + CEF_REQUIRE_UI_THREAD(); + + CefWindowHandle hwnd = browser->GetHost()->GetWindowHandle(); + SetWindowText(hwnd, std::wstring(title).c_str()); +} diff --git a/vendor/cef3/include/base/cef_atomic_ref_count.h b/vendor/cef3/include/base/cef_atomic_ref_count.h new file mode 100644 index 00000000000..cd9b648bef9 --- /dev/null +++ b/vendor/cef3/include/base/cef_atomic_ref_count.h @@ -0,0 +1,126 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This is a low level implementation of atomic semantics for reference +// counting. Please use cef_ref_counted.h directly instead. +// +// The Chromium implementation includes annotations to avoid some false +// positives when using data race detection tools. Annotations are not +// currently supported by the CEF implementation. + +#ifndef CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_ +#define CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_ +#pragma once + +#if defined(BASE_ATOMIC_REF_COUNT_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/atomic_ref_count.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_atomicops.h" + +// Annotations are not currently supported. +#define ANNOTATE_HAPPENS_BEFORE(obj) /* empty */ +#define ANNOTATE_HAPPENS_AFTER(obj) /* empty */ + +namespace base { + +typedef subtle::Atomic32 AtomicRefCount; + +// Increment a reference count by "increment", which must exceed 0. +inline void AtomicRefCountIncN(volatile AtomicRefCount *ptr, + AtomicRefCount increment) { + subtle::NoBarrier_AtomicIncrement(ptr, increment); +} + +// Decrement a reference count by "decrement", which must exceed 0, +// and return whether the result is non-zero. +// Insert barriers to ensure that state written before the reference count +// became zero will be visible to a thread that has just made the count zero. +inline bool AtomicRefCountDecN(volatile AtomicRefCount *ptr, + AtomicRefCount decrement) { + ANNOTATE_HAPPENS_BEFORE(ptr); + bool res = (subtle::Barrier_AtomicIncrement(ptr, -decrement) != 0); + if (!res) { + ANNOTATE_HAPPENS_AFTER(ptr); + } + return res; +} + +// Increment a reference count by 1. +inline void AtomicRefCountInc(volatile AtomicRefCount *ptr) { + base::AtomicRefCountIncN(ptr, 1); +} + +// Decrement a reference count by 1 and return whether the result is non-zero. +// Insert barriers to ensure that state written before the reference count +// became zero will be visible to a thread that has just made the count zero. +inline bool AtomicRefCountDec(volatile AtomicRefCount *ptr) { + return base::AtomicRefCountDecN(ptr, 1); +} + +// Return whether the reference count is one. If the reference count is used +// in the conventional way, a refrerence count of 1 implies that the current +// thread owns the reference and no other thread shares it. This call performs +// the test for a reference count of one, and performs the memory barrier +// needed for the owning thread to act on the object, knowing that it has +// exclusive access to the object. +inline bool AtomicRefCountIsOne(volatile AtomicRefCount *ptr) { + bool res = (subtle::Acquire_Load(ptr) == 1); + if (res) { + ANNOTATE_HAPPENS_AFTER(ptr); + } + return res; +} + +// Return whether the reference count is zero. With conventional object +// referencing counting, the object will be destroyed, so the reference count +// should never be zero. Hence this is generally used for a debug check. +inline bool AtomicRefCountIsZero(volatile AtomicRefCount *ptr) { + bool res = (subtle::Acquire_Load(ptr) == 0); + if (res) { + ANNOTATE_HAPPENS_AFTER(ptr); + } + return res; +} + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_ATOMIC_REF_COUNT_H_ diff --git a/vendor/cef3/include/base/cef_atomicops.h b/vendor/cef3/include/base/cef_atomicops.h new file mode 100644 index 00000000000..cd83115c07c --- /dev/null +++ b/vendor/cef3/include/base/cef_atomicops.h @@ -0,0 +1,198 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// For atomic operations on reference counts, see cef_atomic_ref_count.h. + +// The routines exported by this module are subtle. If you use them, even if +// you get the code right, it will depend on careful reasoning about atomicity +// and memory ordering; it will be less readable, and harder to maintain. If +// you plan to use these routines, you should have a good reason, such as solid +// evidence that performance would otherwise suffer, or there being no +// alternative. You should assume only properties explicitly guaranteed by the +// specifications in this file. You are almost certainly _not_ writing code +// just for the x86; if you assume x86 semantics, x86 hardware bugs and +// implementations on other archtectures will cause your code to break. If you +// do not know what you are doing, avoid these routines, and use a Mutex. +// +// It is incorrect to make direct assignments to/from an atomic variable. +// You should use one of the Load or Store routines. The NoBarrier +// versions are provided when no barriers are needed: +// NoBarrier_Store() +// NoBarrier_Load() +// Although there are currently no compiler enforcement, you are encouraged +// to use these. +// + +#ifndef CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_ +#define CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_ +#pragma once + +#if defined(BASE_ATOMICOPS_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/atomicops.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include + +#include "include/base/cef_build.h" + +#if defined(OS_WIN) && defined(ARCH_CPU_64_BITS) +// windows.h #defines this (only on x64). This causes problems because the +// public API also uses MemoryBarrier at the public name for this fence. So, on +// X64, undef it, and call its documented +// (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) +// implementation directly. +#undef MemoryBarrier +#endif + +namespace base { +namespace subtle { + +typedef int32_t Atomic32; +#ifdef ARCH_CPU_64_BITS +// We need to be able to go between Atomic64 and AtomicWord implicitly. This +// means Atomic64 and AtomicWord should be the same type on 64-bit. +#if defined(__ILP32__) || defined(OS_NACL) +// NaCl's intptr_t is not actually 64-bits on 64-bit! +// http://code.google.com/p/nativeclient/issues/detail?id=1162 +typedef int64_t Atomic64; +#else +typedef intptr_t Atomic64; +#endif +#endif + +// Use AtomicWord for a machine-sized pointer. It will use the Atomic32 or +// Atomic64 routines below, depending on your architecture. +typedef intptr_t AtomicWord; + +// Atomically execute: +// result = *ptr; +// if (*ptr == old_value) +// *ptr = new_value; +// return result; +// +// I.e., replace "*ptr" with "new_value" if "*ptr" used to be "old_value". +// Always return the old value of "*ptr" +// +// This routine implies no memory barriers. +Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value); + +// Atomically store new_value into *ptr, returning the previous value held in +// *ptr. This routine implies no memory barriers. +Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, Atomic32 new_value); + +// Atomically increment *ptr by "increment". Returns the new value of +// *ptr with the increment applied. This routine implies no memory barriers. +Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, Atomic32 increment); + +Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, + Atomic32 increment); + +// These following lower-level operations are typically useful only to people +// implementing higher-level synchronization operations like spinlocks, +// mutexes, and condition-variables. They combine CompareAndSwap(), a load, or +// a store with appropriate memory-ordering instructions. "Acquire" operations +// ensure that no later memory access can be reordered ahead of the operation. +// "Release" operations ensure that no previous memory access can be reordered +// after the operation. "Barrier" operations have both "Acquire" and "Release" +// semantics. A MemoryBarrier() has "Barrier" semantics, but does no memory +// access. +Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value); +Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value); + +void MemoryBarrier(); +void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value); +void Acquire_Store(volatile Atomic32* ptr, Atomic32 value); +void Release_Store(volatile Atomic32* ptr, Atomic32 value); + +Atomic32 NoBarrier_Load(volatile const Atomic32* ptr); +Atomic32 Acquire_Load(volatile const Atomic32* ptr); +Atomic32 Release_Load(volatile const Atomic32* ptr); + +// 64-bit atomic operations (only available on 64-bit processors). +#ifdef ARCH_CPU_64_BITS +Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value); +Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, Atomic64 new_value); +Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment); +Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, Atomic64 increment); + +Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value); +Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value); +void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value); +void Acquire_Store(volatile Atomic64* ptr, Atomic64 value); +void Release_Store(volatile Atomic64* ptr, Atomic64 value); +Atomic64 NoBarrier_Load(volatile const Atomic64* ptr); +Atomic64 Acquire_Load(volatile const Atomic64* ptr); +Atomic64 Release_Load(volatile const Atomic64* ptr); +#endif // ARCH_CPU_64_BITS + +} // namespace subtle +} // namespace base + +// Include our platform specific implementation. +#if defined(OS_WIN) && defined(COMPILER_MSVC) && defined(ARCH_CPU_X86_FAMILY) +#include "include/base/internal/cef_atomicops_x86_msvc.h" +#elif defined(OS_MACOSX) +#include "include/base/internal/cef_atomicops_mac.h" +#elif defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) +#include "include/base/internal/cef_atomicops_x86_gcc.h" +#else +#error "Atomic operations are not supported on your platform" +#endif + +// On some platforms we need additional declarations to make +// AtomicWord compatible with our other Atomic* types. +#if defined(OS_MACOSX) || defined(OS_OPENBSD) +#include "include/base/internal/cef_atomicops_atomicword_compat.h" +#endif + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_ATOMICOPS_H_ diff --git a/vendor/cef3/include/base/cef_basictypes.h b/vendor/cef3/include/base/cef_basictypes.h new file mode 100644 index 00000000000..af3431127d1 --- /dev/null +++ b/vendor/cef3/include/base/cef_basictypes.h @@ -0,0 +1,86 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_BASICTYPES_H_ +#define CEF_INCLUDE_BASE_CEF_BASICTYPES_H_ +#pragma once + +#if defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/basictypes.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include // For UINT_MAX +#include // For size_t + +#include "include/base/cef_build.h" + +// The NSPR system headers define 64-bit as |long| when possible, except on +// Mac OS X. In order to not have typedef mismatches, we do the same on LP64. +// +// On Mac OS X, |long long| is used for 64-bit types for compatibility with +// format macros even in the LP64 model. +#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +typedef long int64; // NOLINT(runtime/int) +typedef unsigned long uint64; // NOLINT(runtime/int) +#else +typedef long long int64; // NOLINT(runtime/int) +typedef unsigned long long uint64; // NOLINT(runtime/int) +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _INT32 +#define _INT32 +typedef int int32; +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _UINT32 +#define _UINT32 +typedef unsigned int uint32; +#endif + +// UTF-16 character type +#ifndef char16 +#if defined(WIN32) +typedef wchar_t char16; +#else +typedef unsigned short char16; +#endif +#endif + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BASICTYPES_H_ diff --git a/vendor/cef3/include/base/cef_bind.h b/vendor/cef3/include/base/cef_bind.h new file mode 100644 index 00000000000..c3f56f3379e --- /dev/null +++ b/vendor/cef3/include/base/cef_bind.h @@ -0,0 +1,548 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_BIND_H_ +#define CEF_INCLUDE_BASE_CEF_BIND_H_ +#pragma once + +#if defined(BASE_BIND_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/bind.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/internal/cef_bind_internal.h" +#include "include/base/internal/cef_callback_internal.h" + +// ----------------------------------------------------------------------------- +// Usage documentation +// ----------------------------------------------------------------------------- +// +// See base/cef_callback.h for documentation. +// +// +// ----------------------------------------------------------------------------- +// Implementation notes +// ----------------------------------------------------------------------------- +// +// If you're reading the implementation, before proceeding further, you should +// read the top comment of base/bind_internal.h for a definition of common +// terms and concepts. +// +// RETURN TYPES +// +// Though Bind()'s result is meant to be stored in a Callback<> type, it +// cannot actually return the exact type without requiring a large amount +// of extra template specializations. The problem is that in order to +// discern the correct specialization of Callback<>, Bind would need to +// unwrap the function signature to determine the signature's arity, and +// whether or not it is a method. +// +// Each unique combination of (arity, function_type, num_prebound) where +// function_type is one of {function, method, const_method} would require +// one specialization. We eventually have to do a similar number of +// specializations anyways in the implementation (see the Invoker<>, +// classes). However, it is avoidable in Bind if we return the result +// via an indirection like we do below. +// +// TODO(ajwong): We might be able to avoid this now, but need to test. +// +// It is possible to move most of the COMPILE_ASSERT asserts into BindState<>, +// but it feels a little nicer to have the asserts here so people do not +// need to crack open bind_internal.h. On the other hand, it makes Bind() +// harder to read. + +namespace base { + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void()> + ::UnboundRunType> +Bind(Functor functor) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + typedef internal::BindState BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor))); +} + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void(typename internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag::value || + !internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + typedef internal::BindState::StorageType)> BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor), p1)); +} + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void(typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag::value || + !internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + typedef internal::BindState::StorageType, + typename internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor), p1, p2)); +} + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void(typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag::value || + !internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + typedef internal::BindState::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor), p1, p2, p3)); +} + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void(typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag::value || + !internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + typedef internal::BindState::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4)); +} + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void(typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag::value || + !internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + typedef internal::BindState::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5)); +} + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void(typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag::value || + !internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + typedef internal::BindState::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6)); +} + +template +base::Callback< + typename internal::BindState< + typename internal::FunctorTraits::RunnableType, + typename internal::FunctorTraits::RunType, + void(typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> + ::UnboundRunType> +Bind(Functor functor, const P1& p1, const P2& p2, const P3& p3, const P4& p4, + const P5& p5, const P6& p6, const P7& p7) { + // Typedefs for how to store and run the functor. + typedef typename internal::FunctorTraits::RunnableType RunnableType; + typedef typename internal::FunctorTraits::RunType RunType; + + // Use RunnableType::RunType instead of RunType above because our + // checks should below for bound references need to know what the actual + // functor is going to interpret the argument as. + typedef internal::FunctionTraits + BoundFunctorTraits; + + // Do not allow binding a non-const reference parameter. Non-const reference + // parameters are disallowed by the Google style guide. Also, binding a + // non-const reference parameter can make for subtle bugs because the + // invoked function will receive a reference to the stored copy of the + // argument and not the original. + COMPILE_ASSERT( + !(is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value || + is_non_const_reference::value ), + do_not_bind_functions_with_nonconst_ref); + + // For methods, we need to be careful for parameter 1. We do not require + // a scoped_refptr because BindState<> itself takes care of AddRef() for + // methods. We also disallow binding of an array as the method's target + // object. + COMPILE_ASSERT( + internal::HasIsMethodTag::value || + !internal::NeedsScopedRefptrButGetsRawPtr::value, + p1_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::HasIsMethodTag::value || + !is_array::value, + first_bound_argument_to_method_cannot_be_array); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p2_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p3_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p4_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p5_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p6_is_refcounted_type_and_needs_scoped_refptr); + COMPILE_ASSERT(!internal::NeedsScopedRefptrButGetsRawPtr::value, + p7_is_refcounted_type_and_needs_scoped_refptr); + typedef internal::BindState::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType, + typename internal::CallbackParamTraits::StorageType)> BindState; + + + return Callback( + new BindState(internal::MakeRunnable(functor), p1, p2, p3, p4, p5, p6, + p7)); +} + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BIND_H_ diff --git a/vendor/cef3/include/base/cef_bind_helpers.h b/vendor/cef3/include/base/cef_bind_helpers.h new file mode 100644 index 00000000000..8edac5c03ae --- /dev/null +++ b/vendor/cef3/include/base/cef_bind_helpers.h @@ -0,0 +1,586 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This defines a set of argument wrappers and related factory methods that +// can be used specify the refcounting and reference semantics of arguments +// that are bound by the Bind() function in base/bind.h. +// +// It also defines a set of simple functions and utilities that people want +// when using Callback<> and Bind(). +// +// +// ARGUMENT BINDING WRAPPERS +// +// The wrapper functions are base::Unretained(), base::Owned(), base::Passed(), +// base::ConstRef(), and base::IgnoreResult(). +// +// Unretained() allows Bind() to bind a non-refcounted class, and to disable +// refcounting on arguments that are refcounted objects. +// +// Owned() transfers ownership of an object to the Callback resulting from +// bind; the object will be deleted when the Callback is deleted. +// +// Passed() is for transferring movable-but-not-copyable types (eg. scoped_ptr) +// through a Callback. Logically, this signifies a destructive transfer of +// the state of the argument into the target function. Invoking +// Callback::Run() twice on a Callback that was created with a Passed() +// argument will CHECK() because the first invocation would have already +// transferred ownership to the target function. +// +// ConstRef() allows binding a constant reference to an argument rather +// than a copy. +// +// IgnoreResult() is used to adapt a function or Callback with a return type to +// one with a void return. This is most useful if you have a function with, +// say, a pesky ignorable bool return that you want to use with PostTask or +// something else that expect a Callback with a void return. +// +// EXAMPLE OF Unretained(): +// +// class Foo { +// public: +// void func() { cout << "Foo:f" << endl; } +// }; +// +// // In some function somewhere. +// Foo foo; +// Closure foo_callback = +// Bind(&Foo::func, Unretained(&foo)); +// foo_callback.Run(); // Prints "Foo:f". +// +// Without the Unretained() wrapper on |&foo|, the above call would fail +// to compile because Foo does not support the AddRef() and Release() methods. +// +// +// EXAMPLE OF Owned(): +// +// void foo(int* arg) { cout << *arg << endl } +// +// int* pn = new int(1); +// Closure foo_callback = Bind(&foo, Owned(pn)); +// +// foo_callback.Run(); // Prints "1" +// foo_callback.Run(); // Prints "1" +// *n = 2; +// foo_callback.Run(); // Prints "2" +// +// foo_callback.Reset(); // |pn| is deleted. Also will happen when +// // |foo_callback| goes out of scope. +// +// Without Owned(), someone would have to know to delete |pn| when the last +// reference to the Callback is deleted. +// +// +// EXAMPLE OF ConstRef(): +// +// void foo(int arg) { cout << arg << endl } +// +// int n = 1; +// Closure no_ref = Bind(&foo, n); +// Closure has_ref = Bind(&foo, ConstRef(n)); +// +// no_ref.Run(); // Prints "1" +// has_ref.Run(); // Prints "1" +// +// n = 2; +// no_ref.Run(); // Prints "1" +// has_ref.Run(); // Prints "2" +// +// Note that because ConstRef() takes a reference on |n|, |n| must outlive all +// its bound callbacks. +// +// +// EXAMPLE OF IgnoreResult(): +// +// int DoSomething(int arg) { cout << arg << endl; } +// +// // Assign to a Callback with a void return type. +// Callback cb = Bind(IgnoreResult(&DoSomething)); +// cb->Run(1); // Prints "1". +// +// // Prints "1" on |ml|. +// ml->PostTask(FROM_HERE, Bind(IgnoreResult(&DoSomething), 1); +// +// +// EXAMPLE OF Passed(): +// +// void TakesOwnership(scoped_ptr arg) { } +// scoped_ptr CreateFoo() { return scoped_ptr(new Foo()); } +// +// scoped_ptr f(new Foo()); +// +// // |cb| is given ownership of Foo(). |f| is now NULL. +// // You can use f.Pass() in place of &f, but it's more verbose. +// Closure cb = Bind(&TakesOwnership, Passed(&f)); +// +// // Run was never called so |cb| still owns Foo() and deletes +// // it on Reset(). +// cb.Reset(); +// +// // |cb| is given a new Foo created by CreateFoo(). +// cb = Bind(&TakesOwnership, Passed(CreateFoo())); +// +// // |arg| in TakesOwnership() is given ownership of Foo(). |cb| +// // no longer owns Foo() and, if reset, would not delete Foo(). +// cb.Run(); // Foo() is now transferred to |arg| and deleted. +// cb.Run(); // This CHECK()s since Foo() already been used once. +// +// Passed() is particularly useful with PostTask() when you are transferring +// ownership of an argument into a task, but don't necessarily know if the +// task will always be executed. This can happen if the task is cancellable +// or if it is posted to a MessageLoopProxy. +// +// +// SIMPLE FUNCTIONS AND UTILITIES. +// +// DoNothing() - Useful for creating a Closure that does nothing when called. +// DeletePointer() - Useful for creating a Closure that will delete a +// pointer when invoked. Only use this when necessary. +// In most cases MessageLoop::DeleteSoon() is a better +// fit. + +#ifndef CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ +#define CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ +#pragma once + +#if defined(BASE_BIND_HELPERS_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/bind_helpers.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_callback.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_weak_ptr.h" + +namespace base { +namespace internal { + +// Use the Substitution Failure Is Not An Error (SFINAE) trick to inspect T +// for the existence of AddRef() and Release() functions of the correct +// signature. +// +// http://en.wikipedia.org/wiki/Substitution_failure_is_not_an_error +// http://stackoverflow.com/questions/257288/is-it-possible-to-write-a-c-template-to-check-for-a-functions-existence +// http://stackoverflow.com/questions/4358584/sfinae-approach-comparison +// http://stackoverflow.com/questions/1966362/sfinae-to-check-for-inherited-member-functions +// +// The last link in particular show the method used below. +// +// For SFINAE to work with inherited methods, we need to pull some extra tricks +// with multiple inheritance. In the more standard formulation, the overloads +// of Check would be: +// +// template +// Yes NotTheCheckWeWant(Helper<&C::TargetFunc>*); +// +// template +// No NotTheCheckWeWant(...); +// +// static const bool value = sizeof(NotTheCheckWeWant(0)) == sizeof(Yes); +// +// The problem here is that template resolution will not match +// C::TargetFunc if TargetFunc does not exist directly in C. That is, if +// TargetFunc in inherited from an ancestor, &C::TargetFunc will not match, +// |value| will be false. This formulation only checks for whether or +// not TargetFunc exist directly in the class being introspected. +// +// To get around this, we play a dirty trick with multiple inheritance. +// First, We create a class BaseMixin that declares each function that we +// want to probe for. Then we create a class Base that inherits from both T +// (the class we wish to probe) and BaseMixin. Note that the function +// signature in BaseMixin does not need to match the signature of the function +// we are probing for; thus it's easiest to just use void(void). +// +// Now, if TargetFunc exists somewhere in T, then &Base::TargetFunc has an +// ambiguous resolution between BaseMixin and T. This lets us write the +// following: +// +// template +// No GoodCheck(Helper<&C::TargetFunc>*); +// +// template +// Yes GoodCheck(...); +// +// static const bool value = sizeof(GoodCheck(0)) == sizeof(Yes); +// +// Notice here that the variadic version of GoodCheck() returns Yes here +// instead of No like the previous one. Also notice that we calculate |value| +// by specializing GoodCheck() on Base instead of T. +// +// We've reversed the roles of the variadic, and Helper overloads. +// GoodCheck(Helper<&C::TargetFunc>*), when C = Base, fails to be a valid +// substitution if T::TargetFunc exists. Thus GoodCheck(0) will resolve +// to the variadic version if T has TargetFunc. If T::TargetFunc does not +// exist, then &C::TargetFunc is not ambiguous, and the overload resolution +// will prefer GoodCheck(Helper<&C::TargetFunc>*). +// +// This method of SFINAE will correctly probe for inherited names, but it cannot +// typecheck those names. It's still a good enough sanity check though. +// +// Works on gcc-4.2, gcc-4.4, and Visual Studio 2008. +// +// TODO(ajwong): Move to ref_counted.h or template_util.h when we've vetted +// this works well. +// +// TODO(ajwong): Make this check for Release() as well. +// See http://crbug.com/82038. +template +class SupportsAddRefAndRelease { + typedef char Yes[1]; + typedef char No[2]; + + struct BaseMixin { + void AddRef(); + }; + +// MSVC warns when you try to use Base if T has a private destructor, the +// common pattern for refcounted types. It does this even though no attempt to +// instantiate Base is made. We disable the warning for this definition. +#if defined(OS_WIN) +#pragma warning(push) +#pragma warning(disable:4624) +#endif + struct Base : public T, public BaseMixin { + }; +#if defined(OS_WIN) +#pragma warning(pop) +#endif + + template struct Helper {}; + + template + static No& Check(Helper<&C::AddRef>*); + + template + static Yes& Check(...); + + public: + static const bool value = sizeof(Check(0)) == sizeof(Yes); +}; + +// Helpers to assert that arguments of a recounted type are bound with a +// scoped_refptr. +template +struct UnsafeBindtoRefCountedArgHelper : false_type { +}; + +template +struct UnsafeBindtoRefCountedArgHelper + : integral_constant::value> { +}; + +template +struct UnsafeBindtoRefCountedArg : false_type { +}; + +template +struct UnsafeBindtoRefCountedArg + : UnsafeBindtoRefCountedArgHelper::value, T> { +}; + +template +class HasIsMethodTag { + typedef char Yes[1]; + typedef char No[2]; + + template + static Yes& Check(typename U::IsMethod*); + + template + static No& Check(...); + + public: + static const bool value = sizeof(Check(0)) == sizeof(Yes); +}; + +template +class UnretainedWrapper { + public: + explicit UnretainedWrapper(T* o) : ptr_(o) {} + T* get() const { return ptr_; } + private: + T* ptr_; +}; + +template +class ConstRefWrapper { + public: + explicit ConstRefWrapper(const T& o) : ptr_(&o) {} + const T& get() const { return *ptr_; } + private: + const T* ptr_; +}; + +template +struct IgnoreResultHelper { + explicit IgnoreResultHelper(T functor) : functor_(functor) {} + + T functor_; +}; + +template +struct IgnoreResultHelper > { + explicit IgnoreResultHelper(const Callback& functor) : functor_(functor) {} + + const Callback& functor_; +}; + +// An alternate implementation is to avoid the destructive copy, and instead +// specialize ParamTraits<> for OwnedWrapper<> to change the StorageType to +// a class that is essentially a scoped_ptr<>. +// +// The current implementation has the benefit though of leaving ParamTraits<> +// fully in callback_internal.h as well as avoiding type conversions during +// storage. +template +class OwnedWrapper { + public: + explicit OwnedWrapper(T* o) : ptr_(o) {} + ~OwnedWrapper() { delete ptr_; } + T* get() const { return ptr_; } + OwnedWrapper(const OwnedWrapper& other) { + ptr_ = other.ptr_; + other.ptr_ = NULL; + } + + private: + mutable T* ptr_; +}; + +// PassedWrapper is a copyable adapter for a scoper that ignores const. +// +// It is needed to get around the fact that Bind() takes a const reference to +// all its arguments. Because Bind() takes a const reference to avoid +// unnecessary copies, it is incompatible with movable-but-not-copyable +// types; doing a destructive "move" of the type into Bind() would violate +// the const correctness. +// +// This conundrum cannot be solved without either C++11 rvalue references or +// a O(2^n) blowup of Bind() templates to handle each combination of regular +// types and movable-but-not-copyable types. Thus we introduce a wrapper type +// that is copyable to transmit the correct type information down into +// BindState<>. Ignoring const in this type makes sense because it is only +// created when we are explicitly trying to do a destructive move. +// +// Two notes: +// 1) PassedWrapper supports any type that has a "Pass()" function. +// This is intentional. The whitelisting of which specific types we +// support is maintained by CallbackParamTraits<>. +// 2) is_valid_ is distinct from NULL because it is valid to bind a "NULL" +// scoper to a Callback and allow the Callback to execute once. +template +class PassedWrapper { + public: + explicit PassedWrapper(T scoper) : is_valid_(true), scoper_(scoper.Pass()) {} + PassedWrapper(const PassedWrapper& other) + : is_valid_(other.is_valid_), scoper_(other.scoper_.Pass()) { + } + T Pass() const { + CHECK(is_valid_); + is_valid_ = false; + return scoper_.Pass(); + } + + private: + mutable bool is_valid_; + mutable T scoper_; +}; + +// Unwrap the stored parameters for the wrappers above. +template +struct UnwrapTraits { + typedef const T& ForwardType; + static ForwardType Unwrap(const T& o) { return o; } +}; + +template +struct UnwrapTraits > { + typedef T* ForwardType; + static ForwardType Unwrap(UnretainedWrapper unretained) { + return unretained.get(); + } +}; + +template +struct UnwrapTraits > { + typedef const T& ForwardType; + static ForwardType Unwrap(ConstRefWrapper const_ref) { + return const_ref.get(); + } +}; + +template +struct UnwrapTraits > { + typedef T* ForwardType; + static ForwardType Unwrap(const scoped_refptr& o) { return o.get(); } +}; + +template +struct UnwrapTraits > { + typedef const WeakPtr& ForwardType; + static ForwardType Unwrap(const WeakPtr& o) { return o; } +}; + +template +struct UnwrapTraits > { + typedef T* ForwardType; + static ForwardType Unwrap(const OwnedWrapper& o) { + return o.get(); + } +}; + +template +struct UnwrapTraits > { + typedef T ForwardType; + static T Unwrap(PassedWrapper& o) { + return o.Pass(); + } +}; + +// Utility for handling different refcounting semantics in the Bind() +// function. +template +struct MaybeRefcount; + +template +struct MaybeRefcount { + static void AddRef(const T&) {} + static void Release(const T&) {} +}; + +template +struct MaybeRefcount { + static void AddRef(const T*) {} + static void Release(const T*) {} +}; + +template +struct MaybeRefcount { + static void AddRef(const T&) {} + static void Release(const T&) {} +}; + +template +struct MaybeRefcount { + static void AddRef(T* o) { o->AddRef(); } + static void Release(T* o) { o->Release(); } +}; + +// No need to additionally AddRef() and Release() since we are storing a +// scoped_refptr<> inside the storage object already. +template +struct MaybeRefcount > { + static void AddRef(const scoped_refptr& o) {} + static void Release(const scoped_refptr& o) {} +}; + +template +struct MaybeRefcount { + static void AddRef(const T* o) { o->AddRef(); } + static void Release(const T* o) { o->Release(); } +}; + +// IsWeakMethod is a helper that determine if we are binding a WeakPtr<> to a +// method. It is used internally by Bind() to select the correct +// InvokeHelper that will no-op itself in the event the WeakPtr<> for +// the target object is invalidated. +// +// P1 should be the type of the object that will be received of the method. +template +struct IsWeakMethod : public false_type {}; + +template +struct IsWeakMethod > : public true_type {}; + +template +struct IsWeakMethod > > : public true_type {}; + +} // namespace internal + +template +static inline internal::UnretainedWrapper Unretained(T* o) { + return internal::UnretainedWrapper(o); +} + +template +static inline internal::ConstRefWrapper ConstRef(const T& o) { + return internal::ConstRefWrapper(o); +} + +template +static inline internal::OwnedWrapper Owned(T* o) { + return internal::OwnedWrapper(o); +} + +// We offer 2 syntaxes for calling Passed(). The first takes a temporary and +// is best suited for use with the return value of a function. The second +// takes a pointer to the scoper and is just syntactic sugar to avoid having +// to write Passed(scoper.Pass()). +template +static inline internal::PassedWrapper Passed(T scoper) { + return internal::PassedWrapper(scoper.Pass()); +} +template +static inline internal::PassedWrapper Passed(T* scoper) { + return internal::PassedWrapper(scoper->Pass()); +} + +template +static inline internal::IgnoreResultHelper IgnoreResult(T data) { + return internal::IgnoreResultHelper(data); +} + +template +static inline internal::IgnoreResultHelper > +IgnoreResult(const Callback& data) { + return internal::IgnoreResultHelper >(data); +} + +void DoNothing(); + +template +void DeletePointer(T* obj) { + delete obj; +} + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BIND_HELPERS_H_ diff --git a/vendor/cef3/include/base/cef_build.h b/vendor/cef3/include/base/cef_build.h new file mode 100644 index 00000000000..e98a564613c --- /dev/null +++ b/vendor/cef3/include/base/cef_build.h @@ -0,0 +1,178 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_BASE_CEF_BUILD_H_ +#define CEF_INCLUDE_BASE_CEF_BUILD_H_ +#pragma once + +#if defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/compiler_specific.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#if defined(_WIN32) +#ifndef OS_WIN +#define OS_WIN 1 +#endif +#elif defined(__APPLE__) +#ifndef OS_MACOSX +#define OS_MACOSX 1 +#endif +#elif defined(__linux__) +#ifndef OS_LINUX +#define OS_LINUX 1 +#endif +#else +#error Please add support for your platform in cef_build.h +#endif + +// For access to standard POSIXish features, use OS_POSIX instead of a +// more specific macro. +#if defined(OS_MACOSX) || defined(OS_LINUX) +#ifndef OS_POSIX +#define OS_POSIX 1 +#endif +#endif + +// Compiler detection. +#if defined(__GNUC__) +#ifndef COMPILER_GCC +#define COMPILER_GCC 1 +#endif +#elif defined(_MSC_VER) +#ifndef COMPILER_MSVC +#define COMPILER_MSVC 1 +#endif +#else +#error Please add support for your compiler in cef_build.h +#endif + +// Processor architecture detection. For more info on what's defined, see: +// http://msdn.microsoft.com/en-us/library/b0084kay.aspx +// http://www.agner.org/optimize/calling_conventions.pdf +// or with gcc, run: "echo | gcc -E -dM -" +#if defined(_M_X64) || defined(__x86_64__) +#define ARCH_CPU_X86_FAMILY 1 +#define ARCH_CPU_X86_64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(_M_IX86) || defined(__i386__) +#define ARCH_CPU_X86_FAMILY 1 +#define ARCH_CPU_X86 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__ARMEL__) +#define ARCH_CPU_ARM_FAMILY 1 +#define ARCH_CPU_ARMEL 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__aarch64__) +#define ARCH_CPU_ARM_FAMILY 1 +#define ARCH_CPU_ARM64 1 +#define ARCH_CPU_64_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__pnacl__) +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#elif defined(__MIPSEL__) +#define ARCH_CPU_MIPS_FAMILY 1 +#define ARCH_CPU_MIPSEL 1 +#define ARCH_CPU_32_BITS 1 +#define ARCH_CPU_LITTLE_ENDIAN 1 +#else +#error Please add support for your architecture in cef_build.h +#endif + +// Type detection for wchar_t. +#if defined(OS_WIN) +#define WCHAR_T_IS_UTF16 +#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ + defined(__WCHAR_MAX__) && \ + (__WCHAR_MAX__ == 0x7fffffff || __WCHAR_MAX__ == 0xffffffff) +#define WCHAR_T_IS_UTF32 +#elif defined(OS_POSIX) && defined(COMPILER_GCC) && \ + defined(__WCHAR_MAX__) && \ + (__WCHAR_MAX__ == 0x7fff || __WCHAR_MAX__ == 0xffff) +// On Posix, we'll detect short wchar_t, but projects aren't guaranteed to +// compile in this mode (in particular, Chrome doesn't). This is intended for +// other projects using base who manage their own dependencies and make sure +// short wchar works for them. +#define WCHAR_T_IS_UTF16 +#else +#error Please add support for your compiler in cef_build.h +#endif + +// Annotate a virtual method indicating it must be overriding a virtual +// method in the parent class. +// Use like: +// virtual void foo() OVERRIDE; +#ifndef OVERRIDE +#if defined(__clang__) || defined(COMPILER_MSVC) +#define OVERRIDE override +#elif defined(COMPILER_GCC) && __cplusplus >= 201103 && \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100) >= 40700 +// GCC 4.7 supports explicit virtual overrides when C++11 support is enabled. +#define OVERRIDE override +#else +#define OVERRIDE +#endif +#endif // OVERRIDE + +// Annotate a function indicating the caller must examine the return value. +// Use like: +// int foo() WARN_UNUSED_RESULT; +// To explicitly ignore a result, see |ignore_result()| in . +#ifndef WARN_UNUSED_RESULT +#if defined(COMPILER_GCC) +#define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define WARN_UNUSED_RESULT +#endif +#endif // WARN_UNUSED_RESULT + +// Annotate a variable indicating it's ok if the variable is not used. +// (Typically used to silence a compiler warning when the assignment +// is important for some other reason.) +// Use like: +// int x ALLOW_UNUSED = ...; +#ifndef ALLOW_UNUSED +#if defined(COMPILER_GCC) +#define ALLOW_UNUSED __attribute__((unused)) +#else +#define ALLOW_UNUSED +#endif +#endif // ALLOW_UNUSED + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_BUILD_H_ diff --git a/vendor/cef3/include/base/cef_callback.h b/vendor/cef3/include/base/cef_callback.h new file mode 100644 index 00000000000..002f78fbf9a --- /dev/null +++ b/vendor/cef3/include/base/cef_callback.h @@ -0,0 +1,807 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_H_ +#define CEF_INCLUDE_BASE_CEF_CALLBACK_H_ +#pragma once + +#if defined(BASE_CALLBACK_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/internal/cef_callback_internal.h" +#include "include/base/cef_callback_forward.h" +#include "include/base/cef_template_util.h" + +// NOTE: Header files that do not require the full definition of Callback or +// Closure should #include "base/cef_callback_forward.h" instead of this file. + +// ----------------------------------------------------------------------------- +// Introduction +// ----------------------------------------------------------------------------- +// +// The templated Callback class is a generalized function object. Together +// with the Bind() function in bind.h, they provide a type-safe method for +// performing partial application of functions. +// +// Partial application (or "currying") is the process of binding a subset of +// a function's arguments to produce another function that takes fewer +// arguments. This can be used to pass around a unit of delayed execution, +// much like lexical closures are used in other languages. For example, it +// is used in Chromium code to schedule tasks on different MessageLoops. +// +// A callback with no unbound input parameters (base::Callback) +// is called a base::Closure. Note that this is NOT the same as what other +// languages refer to as a closure -- it does not retain a reference to its +// enclosing environment. +// +// MEMORY MANAGEMENT AND PASSING +// +// The Callback objects themselves should be passed by const-reference, and +// stored by copy. They internally store their state via a refcounted class +// and thus do not need to be deleted. +// +// The reason to pass via a const-reference is to avoid unnecessary +// AddRef/Release pairs to the internal state. +// +// +// ----------------------------------------------------------------------------- +// Quick reference for basic stuff +// ----------------------------------------------------------------------------- +// +// BINDING A BARE FUNCTION +// +// int Return5() { return 5; } +// base::Callback func_cb = base::Bind(&Return5); +// LOG(INFO) << func_cb.Run(); // Prints 5. +// +// BINDING A CLASS METHOD +// +// The first argument to bind is the member function to call, the second is +// the object on which to call it. +// +// class Ref : public base::RefCountedThreadSafe { +// public: +// int Foo() { return 3; } +// void PrintBye() { LOG(INFO) << "bye."; } +// }; +// scoped_refptr ref = new Ref(); +// base::Callback ref_cb = base::Bind(&Ref::Foo, ref); +// LOG(INFO) << ref_cb.Run(); // Prints out 3. +// +// By default the object must support RefCounted or you will get a compiler +// error. If you're passing between threads, be sure it's +// RefCountedThreadSafe! See "Advanced binding of member functions" below if +// you don't want to use reference counting. +// +// RUNNING A CALLBACK +// +// Callbacks can be run with their "Run" method, which has the same +// signature as the template argument to the callback. +// +// void DoSomething(const base::Callback& callback) { +// callback.Run(5, "hello"); +// } +// +// Callbacks can be run more than once (they don't get deleted or marked when +// run). However, this precludes using base::Passed (see below). +// +// void DoSomething(const base::Callback& callback) { +// double myresult = callback.Run(3.14159); +// myresult += callback.Run(2.71828); +// } +// +// PASSING UNBOUND INPUT PARAMETERS +// +// Unbound parameters are specified at the time a callback is Run(). They are +// specified in the Callback template type: +// +// void MyFunc(int i, const std::string& str) {} +// base::Callback cb = base::Bind(&MyFunc); +// cb.Run(23, "hello, world"); +// +// PASSING BOUND INPUT PARAMETERS +// +// Bound parameters are specified when you create thee callback as arguments +// to Bind(). They will be passed to the function and the Run()ner of the +// callback doesn't see those values or even know that the function it's +// calling. +// +// void MyFunc(int i, const std::string& str) {} +// base::Callback cb = base::Bind(&MyFunc, 23, "hello world"); +// cb.Run(); +// +// A callback with no unbound input parameters (base::Callback) +// is called a base::Closure. So we could have also written: +// +// base::Closure cb = base::Bind(&MyFunc, 23, "hello world"); +// +// When calling member functions, bound parameters just go after the object +// pointer. +// +// base::Closure cb = base::Bind(&MyClass::MyFunc, this, 23, "hello world"); +// +// PARTIAL BINDING OF PARAMETERS +// +// You can specify some parameters when you create the callback, and specify +// the rest when you execute the callback. +// +// void MyFunc(int i, const std::string& str) {} +// base::Callback cb = base::Bind(&MyFunc, 23); +// cb.Run("hello world"); +// +// When calling a function bound parameters are first, followed by unbound +// parameters. +// +// +// ----------------------------------------------------------------------------- +// Quick reference for advanced binding +// ----------------------------------------------------------------------------- +// +// BINDING A CLASS METHOD WITH WEAK POINTERS +// +// base::Bind(&MyClass::Foo, GetWeakPtr()); +// +// The callback will not be run if the object has already been destroyed. +// DANGER: weak pointers are not threadsafe, so don't use this +// when passing between threads! +// +// BINDING A CLASS METHOD WITH MANUAL LIFETIME MANAGEMENT +// +// base::Bind(&MyClass::Foo, base::Unretained(this)); +// +// This disables all lifetime management on the object. You're responsible +// for making sure the object is alive at the time of the call. You break it, +// you own it! +// +// BINDING A CLASS METHOD AND HAVING THE CALLBACK OWN THE CLASS +// +// MyClass* myclass = new MyClass; +// base::Bind(&MyClass::Foo, base::Owned(myclass)); +// +// The object will be deleted when the callback is destroyed, even if it's +// not run (like if you post a task during shutdown). Potentially useful for +// "fire and forget" cases. +// +// IGNORING RETURN VALUES +// +// Sometimes you want to call a function that returns a value in a callback +// that doesn't expect a return value. +// +// int DoSomething(int arg) { cout << arg << endl; } +// base::Callback) cb = +// base::Bind(base::IgnoreResult(&DoSomething)); +// +// +// ----------------------------------------------------------------------------- +// Quick reference for binding parameters to Bind() +// ----------------------------------------------------------------------------- +// +// Bound parameters are specified as arguments to Bind() and are passed to the +// function. A callback with no parameters or no unbound parameters is called a +// Closure (base::Callback and base::Closure are the same thing). +// +// PASSING PARAMETERS OWNED BY THE CALLBACK +// +// void Foo(int* arg) { cout << *arg << endl; } +// int* pn = new int(1); +// base::Closure foo_callback = base::Bind(&foo, base::Owned(pn)); +// +// The parameter will be deleted when the callback is destroyed, even if it's +// not run (like if you post a task during shutdown). +// +// PASSING PARAMETERS AS A scoped_ptr +// +// void TakesOwnership(scoped_ptr arg) {} +// scoped_ptr f(new Foo); +// // f becomes null during the following call. +// base::Closure cb = base::Bind(&TakesOwnership, base::Passed(&f)); +// +// Ownership of the parameter will be with the callback until the it is run, +// when ownership is passed to the callback function. This means the callback +// can only be run once. If the callback is never run, it will delete the +// object when it's destroyed. +// +// PASSING PARAMETERS AS A scoped_refptr +// +// void TakesOneRef(scoped_refptr arg) {} +// scoped_refptr f(new Foo) +// base::Closure cb = base::Bind(&TakesOneRef, f); +// +// This should "just work." The closure will take a reference as long as it +// is alive, and another reference will be taken for the called function. +// +// PASSING PARAMETERS BY REFERENCE +// +// Const references are *copied* unless ConstRef is used. Example: +// +// void foo(const int& arg) { printf("%d %p\n", arg, &arg); } +// int n = 1; +// base::Closure has_copy = base::Bind(&foo, n); +// base::Closure has_ref = base::Bind(&foo, base::ConstRef(n)); +// n = 2; +// foo(n); // Prints "2 0xaaaaaaaaaaaa" +// has_copy.Run(); // Prints "1 0xbbbbbbbbbbbb" +// has_ref.Run(); // Prints "2 0xaaaaaaaaaaaa" +// +// Normally parameters are copied in the closure. DANGER: ConstRef stores a +// const reference instead, referencing the original parameter. This means +// that you must ensure the object outlives the callback! +// +// +// ----------------------------------------------------------------------------- +// Implementation notes +// ----------------------------------------------------------------------------- +// +// WHERE IS THIS DESIGN FROM: +// +// The design Callback and Bind is heavily influenced by C++'s +// tr1::function/tr1::bind, and by the "Google Callback" system used inside +// Google. +// +// +// HOW THE IMPLEMENTATION WORKS: +// +// There are three main components to the system: +// 1) The Callback classes. +// 2) The Bind() functions. +// 3) The arguments wrappers (e.g., Unretained() and ConstRef()). +// +// The Callback classes represent a generic function pointer. Internally, +// it stores a refcounted piece of state that represents the target function +// and all its bound parameters. Each Callback specialization has a templated +// constructor that takes an BindState<>*. In the context of the constructor, +// the static type of this BindState<> pointer uniquely identifies the +// function it is representing, all its bound parameters, and a Run() method +// that is capable of invoking the target. +// +// Callback's constructor takes the BindState<>* that has the full static type +// and erases the target function type as well as the types of the bound +// parameters. It does this by storing a pointer to the specific Run() +// function, and upcasting the state of BindState<>* to a +// BindStateBase*. This is safe as long as this BindStateBase pointer +// is only used with the stored Run() pointer. +// +// To BindState<> objects are created inside the Bind() functions. +// These functions, along with a set of internal templates, are responsible for +// +// - Unwrapping the function signature into return type, and parameters +// - Determining the number of parameters that are bound +// - Creating the BindState storing the bound parameters +// - Performing compile-time asserts to avoid error-prone behavior +// - Returning an Callback<> with an arity matching the number of unbound +// parameters and that knows the correct refcounting semantics for the +// target object if we are binding a method. +// +// The Bind functions do the above using type-inference, and template +// specializations. +// +// By default Bind() will store copies of all bound parameters, and attempt +// to refcount a target object if the function being bound is a class method. +// These copies are created even if the function takes parameters as const +// references. (Binding to non-const references is forbidden, see bind.h.) +// +// To change this behavior, we introduce a set of argument wrappers +// (e.g., Unretained(), and ConstRef()). These are simple container templates +// that are passed by value, and wrap a pointer to argument. See the +// file-level comment in base/bind_helpers.h for more info. +// +// These types are passed to the Unwrap() functions, and the MaybeRefcount() +// functions respectively to modify the behavior of Bind(). The Unwrap() +// and MaybeRefcount() functions change behavior by doing partial +// specialization based on whether or not a parameter is a wrapper type. +// +// ConstRef() is similar to tr1::cref. Unretained() is specific to Chromium. +// +// +// WHY NOT TR1 FUNCTION/BIND? +// +// Direct use of tr1::function and tr1::bind was considered, but ultimately +// rejected because of the number of copy constructors invocations involved +// in the binding of arguments during construction, and the forwarding of +// arguments during invocation. These copies will no longer be an issue in +// C++0x because C++0x will support rvalue reference allowing for the compiler +// to avoid these copies. However, waiting for C++0x is not an option. +// +// Measured with valgrind on gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5), the +// tr1::bind call itself will invoke a non-trivial copy constructor three times +// for each bound parameter. Also, each when passing a tr1::function, each +// bound argument will be copied again. +// +// In addition to the copies taken at binding and invocation, copying a +// tr1::function causes a copy to be made of all the bound parameters and +// state. +// +// Furthermore, in Chromium, it is desirable for the Callback to take a +// reference on a target object when representing a class method call. This +// is not supported by tr1. +// +// Lastly, tr1::function and tr1::bind has a more general and flexible API. +// This includes things like argument reordering by use of +// tr1::bind::placeholder, support for non-const reference parameters, and some +// limited amount of subtyping of the tr1::function object (e.g., +// tr1::function is convertible to tr1::function). +// +// These are not features that are required in Chromium. Some of them, such as +// allowing for reference parameters, and subtyping of functions, may actually +// become a source of errors. Removing support for these features actually +// allows for a simpler implementation, and a terser Currying API. +// +// +// WHY NOT GOOGLE CALLBACKS? +// +// The Google callback system also does not support refcounting. Furthermore, +// its implementation has a number of strange edge cases with respect to type +// conversion of its arguments. In particular, the argument's constness must +// at times match exactly the function signature, or the type-inference might +// break. Given the above, writing a custom solution was easier. +// +// +// MISSING FUNCTIONALITY +// - Invoking the return of Bind. Bind(&foo).Run() does not work; +// - Binding arrays to functions that take a non-const pointer. +// Example: +// void Foo(const char* ptr); +// void Bar(char* ptr); +// Bind(&Foo, "test"); +// Bind(&Bar, "test"); // This fails because ptr is not const. + +namespace base { + +// First, we forward declare the Callback class template. This informs the +// compiler that the template only has 1 type parameter which is the function +// signature that the Callback is representing. +// +// After this, create template specializations for 0-7 parameters. Note that +// even though the template typelist grows, the specialization still +// only has one type: the function signature. +// +// If you are thinking of forward declaring Callback in your own header file, +// please include "base/callback_forward.h" instead. +template +class Callback; + +namespace internal { +template +struct BindState; +} // namespace internal + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run() const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get()); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*); + +}; + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(A1); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits::ForwardType a1) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), internal::CallbackForward(a1)); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), internal::CallbackForward(a1), + internal::CallbackForward(a2)); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), internal::CallbackForward(a1), + internal::CallbackForward(a2), + internal::CallbackForward(a3)); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), internal::CallbackForward(a1), + internal::CallbackForward(a2), + internal::CallbackForward(a3), + internal::CallbackForward(a4)); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4, + typename internal::CallbackParamTraits::ForwardType a5) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), internal::CallbackForward(a1), + internal::CallbackForward(a2), + internal::CallbackForward(a3), + internal::CallbackForward(a4), + internal::CallbackForward(a5)); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4, + typename internal::CallbackParamTraits::ForwardType a5, + typename internal::CallbackParamTraits::ForwardType a6) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), internal::CallbackForward(a1), + internal::CallbackForward(a2), + internal::CallbackForward(a3), + internal::CallbackForward(a4), + internal::CallbackForward(a5), + internal::CallbackForward(a6)); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType); + +}; + +template +class Callback : public internal::CallbackBase { + public: + typedef R(RunType)(A1, A2, A3, A4, A5, A6, A7); + + Callback() : CallbackBase(NULL) { } + + // Note that this constructor CANNOT be explicit, and that Bind() CANNOT + // return the exact Callback<> type. See base/bind.h for details. + template + Callback(internal::BindState* bind_state) + : CallbackBase(bind_state) { + + // Force the assignment to a local variable of PolymorphicInvoke + // so the compiler will typecheck that the passed in Run() method has + // the correct type. + PolymorphicInvoke invoke_func = + &internal::BindState + ::InvokerType::Run; + polymorphic_invoke_ = reinterpret_cast(invoke_func); + } + + bool Equals(const Callback& other) const { + return CallbackBase::Equals(other); + } + + R Run(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4, + typename internal::CallbackParamTraits::ForwardType a5, + typename internal::CallbackParamTraits::ForwardType a6, + typename internal::CallbackParamTraits::ForwardType a7) const { + PolymorphicInvoke f = + reinterpret_cast(polymorphic_invoke_); + + return f(bind_state_.get(), internal::CallbackForward(a1), + internal::CallbackForward(a2), + internal::CallbackForward(a3), + internal::CallbackForward(a4), + internal::CallbackForward(a5), + internal::CallbackForward(a6), + internal::CallbackForward(a7)); + } + + private: + typedef R(*PolymorphicInvoke)( + internal::BindStateBase*, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType, + typename internal::CallbackParamTraits::ForwardType); + +}; + + +// Syntactic sugar to make Callbacks easier to declare since it +// will be used in a lot of APIs with delayed execution. +typedef Callback Closure; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_H_ diff --git a/vendor/cef3/include/base/cef_callback_forward.h b/vendor/cef3/include/base/cef_callback_forward.h new file mode 100644 index 00000000000..4986b8f765a --- /dev/null +++ b/vendor/cef3/include/base/cef_callback_forward.h @@ -0,0 +1,59 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ +#define INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ +#pragma once + +#if defined(BASE_CALLBACK_FORWARD_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback_forward.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +namespace base { + +template +class Callback; + +typedef Callback Closure; + +} // namespace base + +#endif // !!BUILDING_CEF_SHARED + +#endif // INCLUDE_BASE_CEF_CALLBACK_FORWARD_H_ diff --git a/vendor/cef3/include/base/cef_callback_helpers.h b/vendor/cef3/include/base/cef_callback_helpers.h new file mode 100644 index 00000000000..62a0c8752a3 --- /dev/null +++ b/vendor/cef3/include/base/cef_callback_helpers.h @@ -0,0 +1,93 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// This defines helpful methods for dealing with Callbacks. Because Callbacks +// are implemented using templates, with a class per callback signature, adding +// methods to Callback<> itself is unattractive (lots of extra code gets +// generated). Instead, consider adding methods here. +// +// ResetAndReturn(&cb) is like cb.Reset() but allows executing a callback (via a +// copy) after the original callback is Reset(). This can be handy if Run() +// reads/writes the variable holding the Callback. + +#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ +#define CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ +#pragma once + +#if defined(BASE_CALLBACK_HELPERS_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback_helpers.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/base/cef_callback.h" +#include "include/base/cef_macros.h" + +namespace base { + +template +base::Callback ResetAndReturn(base::Callback* cb) { + base::Callback ret(*cb); + cb->Reset(); + return ret; +} + +// ScopedClosureRunner is akin to scoped_ptr for Closures. It ensures that the +// Closure is executed and deleted no matter how the current scope exits. +class ScopedClosureRunner { + public: + ScopedClosureRunner(); + explicit ScopedClosureRunner(const Closure& closure); + ~ScopedClosureRunner(); + + void Reset(); + void Reset(const Closure& closure); + Closure Release() WARN_UNUSED_RESULT; + + private: + Closure closure_; + + DISALLOW_COPY_AND_ASSIGN(ScopedClosureRunner); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_HELPERS_H_ diff --git a/vendor/cef3/include/base/cef_callback_list.h b/vendor/cef3/include/base/cef_callback_list.h new file mode 100644 index 00000000000..e198fd39067 --- /dev/null +++ b/vendor/cef3/include/base/cef_callback_list.h @@ -0,0 +1,444 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2013 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ +#define CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ +#pragma once + +#if defined(BASE_CALLBACK_LIST_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/callback_list.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_callback.h" +#include "include/base/internal/cef_callback_internal.h" +#include "include/base/cef_build.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_scoped_ptr.h" + +// OVERVIEW: +// +// A container for a list of callbacks. Unlike a normal STL vector or list, +// this container can be modified during iteration without invalidating the +// iterator. It safely handles the case of a callback removing itself +// or another callback from the list while callbacks are being run. +// +// TYPICAL USAGE: +// +// class MyWidget { +// public: +// ... +// +// typedef base::Callback OnFooCallback; +// +// scoped_ptr::Subscription> +// RegisterCallback(const OnFooCallback& cb) { +// return callback_list_.Add(cb); +// } +// +// private: +// void NotifyFoo(const Foo& foo) { +// callback_list_.Notify(foo); +// } +// +// base::CallbackList callback_list_; +// +// DISALLOW_COPY_AND_ASSIGN(MyWidget); +// }; +// +// +// class MyWidgetListener { +// public: +// MyWidgetListener::MyWidgetListener() { +// foo_subscription_ = MyWidget::GetCurrent()->RegisterCallback( +// base::Bind(&MyWidgetListener::OnFoo, this))); +// } +// +// MyWidgetListener::~MyWidgetListener() { +// // Subscription gets deleted automatically and will deregister +// // the callback in the process. +// } +// +// private: +// void OnFoo(const Foo& foo) { +// // Do something. +// } +// +// scoped_ptr::Subscription> +// foo_subscription_; +// +// DISALLOW_COPY_AND_ASSIGN(MyWidgetListener); +// }; + +namespace base { + +namespace internal { + +template +class CallbackListBase { + public: + class Subscription { + public: + Subscription(CallbackListBase* list, + typename std::list::iterator iter) + : list_(list), + iter_(iter) { + } + + ~Subscription() { + if (list_->active_iterator_count_) { + iter_->Reset(); + } else { + list_->callbacks_.erase(iter_); + if (!list_->removal_callback_.is_null()) + list_->removal_callback_.Run(); + } + } + + private: + CallbackListBase* list_; + typename std::list::iterator iter_; + + DISALLOW_COPY_AND_ASSIGN(Subscription); + }; + + // Add a callback to the list. The callback will remain registered until the + // returned Subscription is destroyed, which must occur before the + // CallbackList is destroyed. + scoped_ptr Add(const CallbackType& cb) WARN_UNUSED_RESULT { + DCHECK(!cb.is_null()); + return scoped_ptr( + new Subscription(this, callbacks_.insert(callbacks_.end(), cb))); + } + + // Sets a callback which will be run when a subscription list is changed. + void set_removal_callback(const Closure& callback) { + removal_callback_ = callback; + } + + // Returns true if there are no subscriptions. This is only valid to call when + // not looping through the list. + bool empty() { + DCHECK_EQ(0, active_iterator_count_); + return callbacks_.empty(); + } + + protected: + // An iterator class that can be used to access the list of callbacks. + class Iterator { + public: + explicit Iterator(CallbackListBase* list) + : list_(list), + list_iter_(list_->callbacks_.begin()) { + ++list_->active_iterator_count_; + } + + Iterator(const Iterator& iter) + : list_(iter.list_), + list_iter_(iter.list_iter_) { + ++list_->active_iterator_count_; + } + + ~Iterator() { + if (list_ && --list_->active_iterator_count_ == 0) { + list_->Compact(); + } + } + + CallbackType* GetNext() { + while ((list_iter_ != list_->callbacks_.end()) && list_iter_->is_null()) + ++list_iter_; + + CallbackType* cb = NULL; + if (list_iter_ != list_->callbacks_.end()) { + cb = &(*list_iter_); + ++list_iter_; + } + return cb; + } + + private: + CallbackListBase* list_; + typename std::list::iterator list_iter_; + }; + + CallbackListBase() : active_iterator_count_(0) {} + + ~CallbackListBase() { + DCHECK_EQ(0, active_iterator_count_); + DCHECK_EQ(0U, callbacks_.size()); + } + + // Returns an instance of a CallbackListBase::Iterator which can be used + // to run callbacks. + Iterator GetIterator() { + return Iterator(this); + } + + // Compact the list: remove any entries which were NULLed out during + // iteration. + void Compact() { + typename std::list::iterator it = callbacks_.begin(); + bool updated = false; + while (it != callbacks_.end()) { + if ((*it).is_null()) { + updated = true; + it = callbacks_.erase(it); + } else { + ++it; + } + + if (updated && !removal_callback_.is_null()) + removal_callback_.Run(); + } + } + + private: + std::list callbacks_; + int active_iterator_count_; + Closure removal_callback_; + + DISALLOW_COPY_AND_ASSIGN(CallbackListBase); +}; + +} // namespace internal + +template class CallbackList; + +template <> +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify() { + internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename internal::CallbackParamTraits::ForwardType a1) { + typename internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2) { + typename internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3) { + typename internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4) { + typename internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4, + typename internal::CallbackParamTraits::ForwardType a5) { + typename internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4, a5); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4, + typename internal::CallbackParamTraits::ForwardType a5, + typename internal::CallbackParamTraits::ForwardType a6) { + typename internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4, a5, a6); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +template +class CallbackList + : public internal::CallbackListBase > { + public: + typedef Callback CallbackType; + + CallbackList() {} + + void Notify(typename internal::CallbackParamTraits::ForwardType a1, + typename internal::CallbackParamTraits::ForwardType a2, + typename internal::CallbackParamTraits::ForwardType a3, + typename internal::CallbackParamTraits::ForwardType a4, + typename internal::CallbackParamTraits::ForwardType a5, + typename internal::CallbackParamTraits::ForwardType a6, + typename internal::CallbackParamTraits::ForwardType a7) { + typename internal::CallbackListBase::Iterator it = + this->GetIterator(); + CallbackType* cb; + while ((cb = it.GetNext()) != NULL) { + cb->Run(a1, a2, a3, a4, a5, a6, a7); + } + } + + private: + DISALLOW_COPY_AND_ASSIGN(CallbackList); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CALLBACK_LIST_H_ diff --git a/vendor/cef3/include/base/cef_cancelable_callback.h b/vendor/cef3/include/base/cef_cancelable_callback.h new file mode 100644 index 00000000000..8ad3bf3bbd5 --- /dev/null +++ b/vendor/cef3/include/base/cef_cancelable_callback.h @@ -0,0 +1,314 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// CancelableCallback is a wrapper around base::Callback that allows +// cancellation of a callback. CancelableCallback takes a reference on the +// wrapped callback until this object is destroyed or Reset()/Cancel() are +// called. +// +// NOTE: +// +// Calling CancelableCallback::Cancel() brings the object back to its natural, +// default-constructed state, i.e., CancelableCallback::callback() will return +// a null callback. +// +// THREAD-SAFETY: +// +// CancelableCallback objects must be created on, posted to, cancelled on, and +// destroyed on the same thread. +// +// +// EXAMPLE USAGE: +// +// In the following example, the test is verifying that RunIntensiveTest() +// Quit()s the message loop within 4 seconds. The cancelable callback is posted +// to the message loop, the intensive test runs, the message loop is run, +// then the callback is cancelled. +// +// void TimeoutCallback(const std::string& timeout_message) { +// FAIL() << timeout_message; +// MessageLoop::current()->QuitWhenIdle(); +// } +// +// CancelableClosure timeout(base::Bind(&TimeoutCallback, "Test timed out.")); +// MessageLoop::current()->PostDelayedTask(FROM_HERE, timeout.callback(), +// 4000) // 4 seconds to run. +// RunIntensiveTest(); +// MessageLoop::current()->Run(); +// timeout.Cancel(); // Hopefully this is hit before the timeout callback runs. +// + +#ifndef CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ +#define CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ +#pragma once + +#if defined(BASE_CANCELABLE_CALLBACK_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/cancelable_callback.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_bind.h" +#include "include/base/cef_callback.h" +#include "include/base/cef_build.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_weak_ptr.h" +#include "include/base/internal/cef_callback_internal.h" + +namespace base { + +template +class CancelableCallback; + +template <> +class CancelableCallback { + public: + CancelableCallback() : weak_factory_(this) {} + + // |callback| must not be null. + explicit CancelableCallback(const base::Callback& callback) + : weak_factory_(this), + callback_(callback) { + DCHECK(!callback.is_null()); + InitializeForwarder(); + } + + ~CancelableCallback() {} + + // Cancels and drops the reference to the wrapped callback. + void Cancel() { + weak_factory_.InvalidateWeakPtrs(); + forwarder_.Reset(); + callback_.Reset(); + } + + // Returns true if the wrapped callback has been cancelled. + bool IsCancelled() const { + return callback_.is_null(); + } + + // Sets |callback| as the closure that may be cancelled. |callback| may not + // be null. Outstanding and any previously wrapped callbacks are cancelled. + void Reset(const base::Callback& callback) { + DCHECK(!callback.is_null()); + + // Outstanding tasks (e.g., posted to a message loop) must not be called. + Cancel(); + + // |forwarder_| is no longer valid after Cancel(), so re-bind. + InitializeForwarder(); + + callback_ = callback; + } + + // Returns a callback that can be disabled by calling Cancel(). + const base::Callback& callback() const { + return forwarder_; + } + + private: + void Forward() { + callback_.Run(); + } + + // Helper method to bind |forwarder_| using a weak pointer from + // |weak_factory_|. + void InitializeForwarder() { + forwarder_ = base::Bind(&CancelableCallback::Forward, + weak_factory_.GetWeakPtr()); + } + + // Used to ensure Forward() is not run when this object is destroyed. + base::WeakPtrFactory > weak_factory_; + + // The wrapper closure. + base::Callback forwarder_; + + // The stored closure that may be cancelled. + base::Callback callback_; + + DISALLOW_COPY_AND_ASSIGN(CancelableCallback); +}; + +template +class CancelableCallback { + public: + CancelableCallback() : weak_factory_(this) {} + + // |callback| must not be null. + explicit CancelableCallback(const base::Callback& callback) + : weak_factory_(this), + callback_(callback) { + DCHECK(!callback.is_null()); + InitializeForwarder(); + } + + ~CancelableCallback() {} + + // Cancels and drops the reference to the wrapped callback. + void Cancel() { + weak_factory_.InvalidateWeakPtrs(); + forwarder_.Reset(); + callback_.Reset(); + } + + // Returns true if the wrapped callback has been cancelled. + bool IsCancelled() const { + return callback_.is_null(); + } + + // Sets |callback| as the closure that may be cancelled. |callback| may not + // be null. Outstanding and any previously wrapped callbacks are cancelled. + void Reset(const base::Callback& callback) { + DCHECK(!callback.is_null()); + + // Outstanding tasks (e.g., posted to a message loop) must not be called. + Cancel(); + + // |forwarder_| is no longer valid after Cancel(), so re-bind. + InitializeForwarder(); + + callback_ = callback; + } + + // Returns a callback that can be disabled by calling Cancel(). + const base::Callback& callback() const { + return forwarder_; + } + + private: + void Forward(A1 a1) const { + callback_.Run(a1); + } + + // Helper method to bind |forwarder_| using a weak pointer from + // |weak_factory_|. + void InitializeForwarder() { + forwarder_ = base::Bind(&CancelableCallback::Forward, + weak_factory_.GetWeakPtr()); + } + + // Used to ensure Forward() is not run when this object is destroyed. + base::WeakPtrFactory > weak_factory_; + + // The wrapper closure. + base::Callback forwarder_; + + // The stored closure that may be cancelled. + base::Callback callback_; + + DISALLOW_COPY_AND_ASSIGN(CancelableCallback); +}; + +template +class CancelableCallback { + public: + CancelableCallback() : weak_factory_(this) {} + + // |callback| must not be null. + explicit CancelableCallback(const base::Callback& callback) + : weak_factory_(this), + callback_(callback) { + DCHECK(!callback.is_null()); + InitializeForwarder(); + } + + ~CancelableCallback() {} + + // Cancels and drops the reference to the wrapped callback. + void Cancel() { + weak_factory_.InvalidateWeakPtrs(); + forwarder_.Reset(); + callback_.Reset(); + } + + // Returns true if the wrapped callback has been cancelled. + bool IsCancelled() const { + return callback_.is_null(); + } + + // Sets |callback| as the closure that may be cancelled. |callback| may not + // be null. Outstanding and any previously wrapped callbacks are cancelled. + void Reset(const base::Callback& callback) { + DCHECK(!callback.is_null()); + + // Outstanding tasks (e.g., posted to a message loop) must not be called. + Cancel(); + + // |forwarder_| is no longer valid after Cancel(), so re-bind. + InitializeForwarder(); + + callback_ = callback; + } + + // Returns a callback that can be disabled by calling Cancel(). + const base::Callback& callback() const { + return forwarder_; + } + + private: + void Forward(A1 a1, A2 a2) const { + callback_.Run(a1, a2); + } + + // Helper method to bind |forwarder_| using a weak pointer from + // |weak_factory_|. + void InitializeForwarder() { + forwarder_ = base::Bind(&CancelableCallback::Forward, + weak_factory_.GetWeakPtr()); + } + + // Used to ensure Forward() is not run when this object is destroyed. + base::WeakPtrFactory > weak_factory_; + + // The wrapper closure. + base::Callback forwarder_; + + // The stored closure that may be cancelled. + base::Callback callback_; + + DISALLOW_COPY_AND_ASSIGN(CancelableCallback); +}; + +typedef CancelableCallback CancelableClosure; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_CANCELABLE_CALLBACK_H_ diff --git a/vendor/cef3/include/base/cef_lock.h b/vendor/cef3/include/base/cef_lock.h new file mode 100644 index 00000000000..d50d60ba8f2 --- /dev/null +++ b/vendor/cef3/include/base/cef_lock.h @@ -0,0 +1,167 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_LOCK_H_ +#define CEF_INCLUDE_BASE_CEF_LOCK_H_ +#pragma once + +#if defined(BASE_SYNCHRONIZATION_LOCK_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/synchronization/lock.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_macros.h" +#include "include/base/cef_platform_thread.h" +#include "include/base/internal/cef_lock_impl.h" + +namespace base { + +// A convenient wrapper for an OS specific critical section. The only real +// intelligence in this class is in debug mode for the support for the +// AssertAcquired() method. +class Lock { + public: +#if defined(NDEBUG) // Optimized wrapper implementation + Lock() : lock_() {} + ~Lock() {} + void Acquire() { lock_.Lock(); } + void Release() { lock_.Unlock(); } + + // If the lock is not held, take it and return true. If the lock is already + // held by another thread, immediately return false. This must not be called + // by a thread already holding the lock (what happens is undefined and an + // assertion may fail). + bool Try() { return lock_.Try(); } + + // Null implementation if not debug. + void AssertAcquired() const {} +#else + Lock(); + ~Lock(); + + // NOTE: Although windows critical sections support recursive locks, we do not + // allow this, and we will commonly fire a DCHECK() if a thread attempts to + // acquire the lock a second time (while already holding it). + void Acquire() { + lock_.Lock(); + CheckUnheldAndMark(); + } + void Release() { + CheckHeldAndUnmark(); + lock_.Unlock(); + } + + bool Try() { + bool rv = lock_.Try(); + if (rv) { + CheckUnheldAndMark(); + } + return rv; + } + + void AssertAcquired() const; +#endif // NDEBUG + + private: +#if !defined(NDEBUG) + // Members and routines taking care of locks assertions. + // Note that this checks for recursive locks and allows them + // if the variable is set. This is allowed by the underlying implementation + // on windows but not on Posix, so we're doing unneeded checks on Posix. + // It's worth it to share the code. + void CheckHeldAndUnmark(); + void CheckUnheldAndMark(); + + // All private data is implicitly protected by lock_. + // Be VERY careful to only access members under that lock. + base::PlatformThreadRef owning_thread_ref_; +#endif // NDEBUG + + // Platform specific underlying lock implementation. + internal::LockImpl lock_; + + DISALLOW_COPY_AND_ASSIGN(Lock); +}; + +// A helper class that acquires the given Lock while the AutoLock is in scope. +class AutoLock { + public: + struct AlreadyAcquired {}; + + explicit AutoLock(Lock& lock) : lock_(lock) { + lock_.Acquire(); + } + + AutoLock(Lock& lock, const AlreadyAcquired&) : lock_(lock) { + lock_.AssertAcquired(); + } + + ~AutoLock() { + lock_.AssertAcquired(); + lock_.Release(); + } + + private: + Lock& lock_; + DISALLOW_COPY_AND_ASSIGN(AutoLock); +}; + +// AutoUnlock is a helper that will Release() the |lock| argument in the +// constructor, and re-Acquire() it in the destructor. +class AutoUnlock { + public: + explicit AutoUnlock(Lock& lock) : lock_(lock) { + // We require our caller to have the lock. + lock_.AssertAcquired(); + lock_.Release(); + } + + ~AutoUnlock() { + lock_.Acquire(); + } + + private: + Lock& lock_; + DISALLOW_COPY_AND_ASSIGN(AutoUnlock); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_LOCK_H_ diff --git a/vendor/cef3/include/base/cef_logging.h b/vendor/cef3/include/base/cef_logging.h new file mode 100644 index 00000000000..b3951f12e86 --- /dev/null +++ b/vendor/cef3/include/base/cef_logging.h @@ -0,0 +1,746 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// +// WARNING: Logging macros should not be used in the main/browser process before +// calling CefInitialize or in sub-processes before calling CefExecuteProcess. +// +// Instructions +// ------------ +// +// Make a bunch of macros for logging. The way to log things is to stream +// things to LOG(). E.g., +// +// LOG(INFO) << "Found " << num_cookies << " cookies"; +// +// You can also do conditional logging: +// +// LOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// The CHECK(condition) macro is active in both debug and release builds and +// effectively performs a LOG(FATAL) which terminates the process and +// generates a crashdump unless a debugger is attached. +// +// There are also "debug mode" logging macros like the ones above: +// +// DLOG(INFO) << "Found cookies"; +// +// DLOG_IF(INFO, num_cookies > 10) << "Got lots of cookies"; +// +// All "debug mode" logging is compiled away to nothing for non-debug mode +// compiles. LOG_IF and development flags also work well together +// because the code can be compiled away sometimes. +// +// We also have +// +// LOG_ASSERT(assertion); +// DLOG_ASSERT(assertion); +// +// which is syntactic sugar for {,D}LOG_IF(FATAL, assert fails) << assertion; +// +// There are "verbose level" logging macros. They look like +// +// VLOG(1) << "I'm printed when you run the program with --v=1 or more"; +// VLOG(2) << "I'm printed when you run the program with --v=2 or more"; +// +// These always log at the INFO log level (when they log at all). +// The verbose logging can also be turned on module-by-module. For instance, +// --vmodule=profile=2,icon_loader=1,browser_*=3,*/chromeos/*=4 --v=0 +// will cause: +// a. VLOG(2) and lower messages to be printed from profile.{h,cc} +// b. VLOG(1) and lower messages to be printed from icon_loader.{h,cc} +// c. VLOG(3) and lower messages to be printed from files prefixed with +// "browser" +// d. VLOG(4) and lower messages to be printed from files under a +// "chromeos" directory. +// e. VLOG(0) and lower messages to be printed from elsewhere +// +// The wildcarding functionality shown by (c) supports both '*' (match +// 0 or more characters) and '?' (match any single character) +// wildcards. Any pattern containing a forward or backward slash will +// be tested against the whole pathname and not just the module. +// E.g., "*/foo/bar/*=2" would change the logging level for all code +// in source files under a "foo/bar" directory. +// +// There's also VLOG_IS_ON(n) "verbose level" condition macro. To be used as +// +// if (VLOG_IS_ON(2)) { +// // do some logging preparation and logging +// // that can't be accomplished with just VLOG(2) << ...; +// } +// +// There is also a VLOG_IF "verbose level" condition macro for sample +// cases, when some extra computation and preparation for logs is not +// needed. +// +// VLOG_IF(1, (size > 1024)) +// << "I'm printed when size is more than 1024 and when you run the " +// "program with --v=1 or more"; +// +// We also override the standard 'assert' to use 'DLOG_ASSERT'. +// +// Lastly, there is: +// +// PLOG(ERROR) << "Couldn't do foo"; +// DPLOG(ERROR) << "Couldn't do foo"; +// PLOG_IF(ERROR, cond) << "Couldn't do foo"; +// DPLOG_IF(ERROR, cond) << "Couldn't do foo"; +// PCHECK(condition) << "Couldn't do foo"; +// DPCHECK(condition) << "Couldn't do foo"; +// +// which append the last system error to the message in string form (taken from +// GetLastError() on Windows and errno on POSIX). +// +// The supported severity levels for macros that allow you to specify one +// are (in increasing order of severity) INFO, WARNING, ERROR, and FATAL. +// +// Very important: logging a message at the FATAL severity level causes +// the program to terminate (after the message is logged). +// +// There is the special severity of DFATAL, which logs FATAL in debug mode, +// ERROR in normal mode. +// + +#ifndef CEF_INCLUDE_BASE_CEF_LOGGING_H_ +#define CEF_INCLUDE_BASE_CEF_LOGGING_H_ +#pragma once + +#if defined(DCHECK) +// Do nothing if the macros provided by this header already exist. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/logging.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include +#include +#include +#include + +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" +#include "include/internal/cef_logging_internal.h" + +namespace cef { +namespace logging { + +// Gets the current log level. +inline int GetMinLogLevel() { + return cef_get_min_log_level(); +} + +// Gets the current vlog level for the given file (usually taken from +// __FILE__). Note that |N| is the size *with* the null terminator. +template +int GetVlogLevel(const char (&file)[N]) { + return cef_get_vlog_level(file, N); +} + +typedef int LogSeverity; +const LogSeverity LOG_VERBOSE = -1; // This is level 1 verbosity +// Note: the log severities are used to index into the array of names, +// see log_severity_names. +const LogSeverity LOG_INFO = 0; +const LogSeverity LOG_WARNING = 1; +const LogSeverity LOG_ERROR = 2; +const LogSeverity LOG_FATAL = 3; +const LogSeverity LOG_NUM_SEVERITIES = 4; + +// LOG_DFATAL is LOG_FATAL in debug mode, ERROR in normal mode +#ifdef NDEBUG +const LogSeverity LOG_DFATAL = LOG_ERROR; +#else +const LogSeverity LOG_DFATAL = LOG_FATAL; +#endif + +// A few definitions of macros that don't generate much code. These are used +// by LOG() and LOG_IF, etc. Since these are used all over our code, it's +// better to have compact code for these operations. +#define COMPACT_GOOGLE_LOG_EX_INFO(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_INFO , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_WARNING(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_WARNING , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_ERROR(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_ERROR , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_FATAL(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_FATAL , \ + ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_EX_DFATAL(ClassName, ...) \ + cef::logging::ClassName(__FILE__, __LINE__, cef::logging::LOG_DFATAL , \ + ##__VA_ARGS__) + +#define COMPACT_GOOGLE_LOG_INFO \ + COMPACT_GOOGLE_LOG_EX_INFO(LogMessage) +#define COMPACT_GOOGLE_LOG_WARNING \ + COMPACT_GOOGLE_LOG_EX_WARNING(LogMessage) +#define COMPACT_GOOGLE_LOG_ERROR \ + COMPACT_GOOGLE_LOG_EX_ERROR(LogMessage) +#define COMPACT_GOOGLE_LOG_FATAL \ + COMPACT_GOOGLE_LOG_EX_FATAL(LogMessage) +#define COMPACT_GOOGLE_LOG_DFATAL \ + COMPACT_GOOGLE_LOG_EX_DFATAL(LogMessage) + +#if defined(OS_WIN) +// wingdi.h defines ERROR to be 0. When we call LOG(ERROR), it gets +// substituted with 0, and it expands to COMPACT_GOOGLE_LOG_0. To allow us +// to keep using this syntax, we define this macro to do the same thing +// as COMPACT_GOOGLE_LOG_ERROR, and also define ERROR the same way that +// the Windows SDK does for consistency. +#define ERROR 0 +#define COMPACT_GOOGLE_LOG_EX_0(ClassName, ...) \ + COMPACT_GOOGLE_LOG_EX_ERROR(ClassName , ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_0 COMPACT_GOOGLE_LOG_ERROR +// Needed for LOG_IS_ON(ERROR). +const LogSeverity LOG_0 = LOG_ERROR; +#endif + +// As special cases, we can assume that LOG_IS_ON(FATAL) always holds. Also, +// LOG_IS_ON(DFATAL) always holds in debug mode. In particular, CHECK()s will +// always fire if they fail. +#define LOG_IS_ON(severity) \ + ((::cef::logging::LOG_ ## severity) >= ::cef::logging::GetMinLogLevel()) + +// We can't do any caching tricks with VLOG_IS_ON() like the +// google-glog version since it requires GCC extensions. This means +// that using the v-logging functions in conjunction with --vmodule +// may be slow. +#define VLOG_IS_ON(verboselevel) \ + ((verboselevel) <= ::cef::logging::GetVlogLevel(__FILE__)) + +// Helper macro which avoids evaluating the arguments to a stream if +// the condition doesn't hold. +#define LAZY_STREAM(stream, condition) \ + !(condition) ? (void) 0 : ::cef::logging::LogMessageVoidify() & (stream) + +// We use the preprocessor's merging operator, "##", so that, e.g., +// LOG(INFO) becomes the token COMPACT_GOOGLE_LOG_INFO. There's some funny +// subtle difference between ostream member streaming functions (e.g., +// ostream::operator<<(int) and ostream non-member streaming functions +// (e.g., ::operator<<(ostream&, string&): it turns out that it's +// impossible to stream something like a string directly to an unnamed +// ostream. We employ a neat hack by calling the stream() member +// function of LogMessage which seems to avoid the problem. +#define LOG_STREAM(severity) COMPACT_GOOGLE_LOG_ ## severity.stream() + +#define LOG(severity) LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity)) +#define LOG_IF(severity, condition) \ + LAZY_STREAM(LOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) + +#define SYSLOG(severity) LOG(severity) +#define SYSLOG_IF(severity, condition) LOG_IF(severity, condition) + +// The VLOG macros log with negative verbosities. +#define VLOG_STREAM(verbose_level) \ + cef::logging::LogMessage(__FILE__, __LINE__, -verbose_level).stream() + +#define VLOG(verbose_level) \ + LAZY_STREAM(VLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level)) + +#define VLOG_IF(verbose_level, condition) \ + LAZY_STREAM(VLOG_STREAM(verbose_level), \ + VLOG_IS_ON(verbose_level) && (condition)) + +#if defined (OS_WIN) +#define VPLOG_STREAM(verbose_level) \ + cef::logging::Win32ErrorLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#elif defined(OS_POSIX) +#define VPLOG_STREAM(verbose_level) \ + cef::logging::ErrnoLogMessage(__FILE__, __LINE__, -verbose_level, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#endif + +#define VPLOG(verbose_level) \ + LAZY_STREAM(VPLOG_STREAM(verbose_level), VLOG_IS_ON(verbose_level)) + +#define VPLOG_IF(verbose_level, condition) \ + LAZY_STREAM(VPLOG_STREAM(verbose_level), \ + VLOG_IS_ON(verbose_level) && (condition)) + +// TODO(akalin): Add more VLOG variants, e.g. VPLOG. + +#define LOG_ASSERT(condition) \ + LOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " +#define SYSLOG_ASSERT(condition) \ + SYSLOG_IF(FATAL, !(condition)) << "Assert failed: " #condition ". " + +#if defined(OS_WIN) +#define PLOG_STREAM(severity) \ + COMPACT_GOOGLE_LOG_EX_ ## severity(Win32ErrorLogMessage, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#elif defined(OS_POSIX) +#define PLOG_STREAM(severity) \ + COMPACT_GOOGLE_LOG_EX_ ## severity(ErrnoLogMessage, \ + ::cef::logging::GetLastSystemErrorCode()).stream() +#endif + +#define PLOG(severity) \ + LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity)) + +#define PLOG_IF(severity, condition) \ + LAZY_STREAM(PLOG_STREAM(severity), LOG_IS_ON(severity) && (condition)) + +// The actual stream used isn't important. +#define EAT_STREAM_PARAMETERS \ + true ? (void) 0 : ::cef::logging::LogMessageVoidify() & LOG_STREAM(FATAL) + +// CHECK dies with a fatal error if condition is not true. It is *not* +// controlled by NDEBUG, so the check will be executed regardless of +// compilation mode. +// +// We make sure CHECK et al. always evaluates their arguments, as +// doing CHECK(FunctionWithSideEffect()) is a common idiom. + +#define CHECK(condition) \ + LAZY_STREAM(LOG_STREAM(FATAL), !(condition)) \ + << "Check failed: " #condition ". " + +#define PCHECK(condition) \ + LAZY_STREAM(PLOG_STREAM(FATAL), !(condition)) \ + << "Check failed: " #condition ". " + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use CHECK_EQ et al below. +// +// TODO(akalin): Rewrite this so that constructs like if (...) +// CHECK_EQ(...) else { ... } work properly. +#define CHECK_OP(name, op, val1, val2) \ + if (std::string* _result = \ + cef::logging::Check##name##Impl((val1), (val2), \ + #val1 " " #op " " #val2)) \ + cef::logging::LogMessage(__FILE__, __LINE__, _result).stream() + +// Build the error message string. This is separate from the "Impl" +// function template because it is not performance critical and so can +// be out of line, while the "Impl" code should be inline. Caller +// takes ownership of the returned string. +template +std::string* MakeCheckOpString(const t1& v1, const t2& v2, const char* names) { + std::ostringstream ss; + ss << names << " (" << v1 << " vs. " << v2 << ")"; + std::string* msg = new std::string(ss.str()); + return msg; +} + +// MSVC doesn't like complex extern templates and DLLs. +#if !defined(COMPILER_MSVC) +// Commonly used instantiations of MakeCheckOpString<>. Explicitly instantiated +// in logging.cc. +extern template std::string* MakeCheckOpString( + const int&, const int&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned long&, const unsigned long&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned long&, const unsigned int&, const char* names); +extern template +std::string* MakeCheckOpString( + const unsigned int&, const unsigned long&, const char* names); +extern template +std::string* MakeCheckOpString( + const std::string&, const std::string&, const char* name); +#endif + +// Helper functions for CHECK_OP macro. +// The (int, int) specialization works around the issue that the compiler +// will not instantiate the template version of the function on values of +// unnamed enum type - see comment below. +#define DEFINE_CHECK_OP_IMPL(name, op) \ + template \ + inline std::string* Check##name##Impl(const t1& v1, const t2& v2, \ + const char* names) { \ + if (v1 op v2) return NULL; \ + else return MakeCheckOpString(v1, v2, names); \ + } \ + inline std::string* Check##name##Impl(int v1, int v2, const char* names) { \ + if (v1 op v2) return NULL; \ + else return MakeCheckOpString(v1, v2, names); \ + } +DEFINE_CHECK_OP_IMPL(EQ, ==) +DEFINE_CHECK_OP_IMPL(NE, !=) +DEFINE_CHECK_OP_IMPL(LE, <=) +DEFINE_CHECK_OP_IMPL(LT, < ) +DEFINE_CHECK_OP_IMPL(GE, >=) +DEFINE_CHECK_OP_IMPL(GT, > ) +#undef DEFINE_CHECK_OP_IMPL + +#define CHECK_EQ(val1, val2) CHECK_OP(EQ, ==, val1, val2) +#define CHECK_NE(val1, val2) CHECK_OP(NE, !=, val1, val2) +#define CHECK_LE(val1, val2) CHECK_OP(LE, <=, val1, val2) +#define CHECK_LT(val1, val2) CHECK_OP(LT, < , val1, val2) +#define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2) +#define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2) + +#if defined(NDEBUG) +#define ENABLE_DLOG 0 +#else +#define ENABLE_DLOG 1 +#endif + +#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) +#define DCHECK_IS_ON 0 +#else +#define DCHECK_IS_ON 1 +#endif + +// Definitions for DLOG et al. + +#if ENABLE_DLOG + +#define DLOG_IS_ON(severity) LOG_IS_ON(severity) +#define DLOG_IF(severity, condition) LOG_IF(severity, condition) +#define DLOG_ASSERT(condition) LOG_ASSERT(condition) +#define DPLOG_IF(severity, condition) PLOG_IF(severity, condition) +#define DVLOG_IF(verboselevel, condition) VLOG_IF(verboselevel, condition) +#define DVPLOG_IF(verboselevel, condition) VPLOG_IF(verboselevel, condition) + +#else // ENABLE_DLOG + +// If ENABLE_DLOG is off, we want to avoid emitting any references to +// |condition| (which may reference a variable defined only if NDEBUG +// is not defined). Contrast this with DCHECK et al., which has +// different behavior. + +#define DLOG_IS_ON(severity) false +#define DLOG_IF(severity, condition) EAT_STREAM_PARAMETERS +#define DLOG_ASSERT(condition) EAT_STREAM_PARAMETERS +#define DPLOG_IF(severity, condition) EAT_STREAM_PARAMETERS +#define DVLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS +#define DVPLOG_IF(verboselevel, condition) EAT_STREAM_PARAMETERS + +#endif // ENABLE_DLOG + +// DEBUG_MODE is for uses like +// if (DEBUG_MODE) foo.CheckThatFoo(); +// instead of +// #ifndef NDEBUG +// foo.CheckThatFoo(); +// #endif +// +// We tie its state to ENABLE_DLOG. +enum { DEBUG_MODE = ENABLE_DLOG }; + +#undef ENABLE_DLOG + +#define DLOG(severity) \ + LAZY_STREAM(LOG_STREAM(severity), DLOG_IS_ON(severity)) + +#define DPLOG(severity) \ + LAZY_STREAM(PLOG_STREAM(severity), DLOG_IS_ON(severity)) + +#define DVLOG(verboselevel) DVLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) + +#define DVPLOG(verboselevel) DVPLOG_IF(verboselevel, VLOG_IS_ON(verboselevel)) + +// Definitions for DCHECK et al. + +#if DCHECK_IS_ON + +#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ + COMPACT_GOOGLE_LOG_EX_FATAL(ClassName , ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_FATAL +const LogSeverity LOG_DCHECK = LOG_FATAL; + +#else // DCHECK_IS_ON + +// These are just dummy values. +#define COMPACT_GOOGLE_LOG_EX_DCHECK(ClassName, ...) \ + COMPACT_GOOGLE_LOG_EX_INFO(ClassName , ##__VA_ARGS__) +#define COMPACT_GOOGLE_LOG_DCHECK COMPACT_GOOGLE_LOG_INFO +const LogSeverity LOG_DCHECK = LOG_INFO; + +#endif // DCHECK_IS_ON + +// DCHECK et al. make sure to reference |condition| regardless of +// whether DCHECKs are enabled; this is so that we don't get unused +// variable warnings if the only use of a variable is in a DCHECK. +// This behavior is different from DLOG_IF et al. + +#define DCHECK(condition) \ + LAZY_STREAM(LOG_STREAM(DCHECK), DCHECK_IS_ON && !(condition)) \ + << "Check failed: " #condition ". " + +#define DPCHECK(condition) \ + LAZY_STREAM(PLOG_STREAM(DCHECK), DCHECK_IS_ON && !(condition)) \ + << "Check failed: " #condition ". " + +// Helper macro for binary operators. +// Don't use this macro directly in your code, use DCHECK_EQ et al below. +#define DCHECK_OP(name, op, val1, val2) \ + if (DCHECK_IS_ON) \ + if (std::string* _result = \ + cef::logging::Check##name##Impl((val1), (val2), \ + #val1 " " #op " " #val2)) \ + cef::logging::LogMessage( \ + __FILE__, __LINE__, ::cef::logging::LOG_DCHECK, \ + _result).stream() + +// Equality/Inequality checks - compare two values, and log a +// LOG_DCHECK message including the two values when the result is not +// as expected. The values must have operator<<(ostream, ...) +// defined. +// +// You may append to the error message like so: +// DCHECK_NE(1, 2) << ": The world must be ending!"; +// +// We are very careful to ensure that each argument is evaluated exactly +// once, and that anything which is legal to pass as a function argument is +// legal here. In particular, the arguments may be temporary expressions +// which will end up being destroyed at the end of the apparent statement, +// for example: +// DCHECK_EQ(string("abc")[1], 'b'); +// +// WARNING: These may not compile correctly if one of the arguments is a pointer +// and the other is NULL. To work around this, simply static_cast NULL to the +// type of the desired pointer. + +#define DCHECK_EQ(val1, val2) DCHECK_OP(EQ, ==, val1, val2) +#define DCHECK_NE(val1, val2) DCHECK_OP(NE, !=, val1, val2) +#define DCHECK_LE(val1, val2) DCHECK_OP(LE, <=, val1, val2) +#define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) +#define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) +#define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) + +#if defined(NDEBUG) && defined(OS_CHROMEOS) +#define NOTREACHED() LOG(ERROR) << "NOTREACHED() hit in " << \ + __FUNCTION__ << ". " +#else +#define NOTREACHED() DCHECK(false) +#endif + +// Redefine the standard assert to use our nice log files +#undef assert +#define assert(x) DLOG_ASSERT(x) + +// This class more or less represents a particular log message. You +// create an instance of LogMessage and then stream stuff to it. +// When you finish streaming to it, ~LogMessage is called and the +// full message gets streamed to the appropriate destination. +// +// You shouldn't actually use LogMessage's constructor to log things, +// though. You should use the LOG() macro (and variants thereof) +// above. +class LogMessage { + public: + // Used for LOG(severity). + LogMessage(const char* file, int line, LogSeverity severity); + + // Used for CHECK_EQ(), etc. Takes ownership of the given string. + // Implied severity = LOG_FATAL. + LogMessage(const char* file, int line, std::string* result); + + // Used for DCHECK_EQ(), etc. Takes ownership of the given string. + LogMessage(const char* file, int line, LogSeverity severity, + std::string* result); + + ~LogMessage(); + + std::ostream& stream() { return stream_; } + + private: + LogSeverity severity_; + std::ostringstream stream_; + + // The file and line information passed in to the constructor. + const char* file_; + const int line_; + +#if defined(OS_WIN) + // Stores the current value of GetLastError in the constructor and restores + // it in the destructor by calling SetLastError. + // This is useful since the LogMessage class uses a lot of Win32 calls + // that will lose the value of GLE and the code that called the log function + // will have lost the thread error value when the log call returns. + class SaveLastError { + public: + SaveLastError(); + ~SaveLastError(); + + unsigned long get_error() const { return last_error_; } + + protected: + unsigned long last_error_; + }; + + SaveLastError last_error_; +#endif + + DISALLOW_COPY_AND_ASSIGN(LogMessage); +}; + +// A non-macro interface to the log facility; (useful +// when the logging level is not a compile-time constant). +inline void LogAtLevel(int const log_level, std::string const &msg) { + LogMessage(__FILE__, __LINE__, log_level).stream() << msg; +} + +// This class is used to explicitly ignore values in the conditional +// logging macros. This avoids compiler warnings like "value computed +// is not used" and "statement has no effect". +class LogMessageVoidify { + public: + LogMessageVoidify() { } + // This has to be an operator with a precedence lower than << but + // higher than ?: + void operator&(std::ostream&) { } +}; + +#if defined(OS_WIN) +typedef unsigned long SystemErrorCode; +#elif defined(OS_POSIX) +typedef int SystemErrorCode; +#endif + +// Alias for ::GetLastError() on Windows and errno on POSIX. Avoids having to +// pull in windows.h just for GetLastError() and DWORD. +SystemErrorCode GetLastSystemErrorCode(); +std::string SystemErrorCodeToString(SystemErrorCode error_code); + +#if defined(OS_WIN) +// Appends a formatted system message of the GetLastError() type. +class Win32ErrorLogMessage { + public: + Win32ErrorLogMessage(const char* file, + int line, + LogSeverity severity, + SystemErrorCode err); + + // Appends the error message before destructing the encapsulated class. + ~Win32ErrorLogMessage(); + + std::ostream& stream() { return log_message_.stream(); } + + private: + SystemErrorCode err_; + LogMessage log_message_; + + DISALLOW_COPY_AND_ASSIGN(Win32ErrorLogMessage); +}; +#elif defined(OS_POSIX) +// Appends a formatted system message of the errno type +class ErrnoLogMessage { + public: + ErrnoLogMessage(const char* file, + int line, + LogSeverity severity, + SystemErrorCode err); + + // Appends the error message before destructing the encapsulated class. + ~ErrnoLogMessage(); + + std::ostream& stream() { return log_message_.stream(); } + + private: + SystemErrorCode err_; + LogMessage log_message_; + + DISALLOW_COPY_AND_ASSIGN(ErrnoLogMessage); +}; +#endif // OS_WIN + +} // namespace logging +} // namespace cef + +// These functions are provided as a convenience for logging, which is where we +// use streams (it is against Google style to use streams in other places). It +// is designed to allow you to emit non-ASCII Unicode strings to the log file, +// which is normally ASCII. It is relatively slow, so try not to use it for +// common cases. Non-ASCII characters will be converted to UTF-8 by these +// operators. +std::ostream& operator<<(std::ostream& out, const wchar_t* wstr); +inline std::ostream& operator<<(std::ostream& out, const std::wstring& wstr) { + return out << wstr.c_str(); +} + +// The NOTIMPLEMENTED() macro annotates codepaths which have +// not been implemented yet. +// +// The implementation of this macro is controlled by NOTIMPLEMENTED_POLICY: +// 0 -- Do nothing (stripped by compiler) +// 1 -- Warn at compile time +// 2 -- Fail at compile time +// 3 -- Fail at runtime (DCHECK) +// 4 -- [default] LOG(ERROR) at runtime +// 5 -- LOG(ERROR) at runtime, only once per call-site + +#ifndef NOTIMPLEMENTED_POLICY +#if defined(OS_ANDROID) && defined(OFFICIAL_BUILD) +#define NOTIMPLEMENTED_POLICY 0 +#else +// Select default policy: LOG(ERROR) +#define NOTIMPLEMENTED_POLICY 4 +#endif +#endif + +#if defined(COMPILER_GCC) +// On Linux, with GCC, we can use __PRETTY_FUNCTION__ to get the demangled name +// of the current function in the NOTIMPLEMENTED message. +#define NOTIMPLEMENTED_MSG "Not implemented reached in " << __PRETTY_FUNCTION__ +#else +#define NOTIMPLEMENTED_MSG "NOT IMPLEMENTED" +#endif + +#if NOTIMPLEMENTED_POLICY == 0 +#define NOTIMPLEMENTED() EAT_STREAM_PARAMETERS +#elif NOTIMPLEMENTED_POLICY == 1 +// TODO, figure out how to generate a warning +#define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) +#elif NOTIMPLEMENTED_POLICY == 2 +#define NOTIMPLEMENTED() COMPILE_ASSERT(false, NOT_IMPLEMENTED) +#elif NOTIMPLEMENTED_POLICY == 3 +#define NOTIMPLEMENTED() NOTREACHED() +#elif NOTIMPLEMENTED_POLICY == 4 +#define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG +#elif NOTIMPLEMENTED_POLICY == 5 +#define NOTIMPLEMENTED() do {\ + static bool logged_once = false;\ + LOG_IF(ERROR, !logged_once) << NOTIMPLEMENTED_MSG;\ + logged_once = true;\ +} while(0);\ +EAT_STREAM_PARAMETERS +#endif + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_LOGGING_H_ diff --git a/vendor/cef3/include/base/cef_macros.h b/vendor/cef3/include/base/cef_macros.h new file mode 100644 index 00000000000..41b40e79aab --- /dev/null +++ b/vendor/cef3/include/base/cef_macros.h @@ -0,0 +1,217 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_MACROS_H_ +#define CEF_INCLUDE_BASE_CEF_MACROS_H_ +#pragma once + +#if defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/macros.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include // For size_t. + +#if !defined(ALLOW_THIS_IN_INITIALIZER_LIST) +#if defined(COMPILER_MSVC) + +// MSVC_PUSH_DISABLE_WARNING pushes |n| onto a stack of warnings to be disabled. +// The warning remains disabled until popped by MSVC_POP_WARNING. +#define MSVC_PUSH_DISABLE_WARNING(n) __pragma(warning(push)) \ + __pragma(warning(disable:n)) + +// MSVC_PUSH_WARNING_LEVEL pushes |n| as the global warning level. The level +// remains in effect until popped by MSVC_POP_WARNING(). Use 0 to disable all +// warnings. +#define MSVC_PUSH_WARNING_LEVEL(n) __pragma(warning(push, n)) + +// Pop effects of innermost MSVC_PUSH_* macro. +#define MSVC_POP_WARNING() __pragma(warning(pop)) + +// Allows |this| to be passed as an argument in constructor initializer lists. +// This uses push/pop instead of the seemingly simpler suppress feature to avoid +// having the warning be disabled for more than just |code|. +// +// Example usage: +// Foo::Foo() : x(NULL), ALLOW_THIS_IN_INITIALIZER_LIST(y(this)), z(3) {} +// +// Compiler warning C4355: 'this': used in base member initializer list: +// http://msdn.microsoft.com/en-us/library/3c594ae3(VS.80).aspx +#define ALLOW_THIS_IN_INITIALIZER_LIST(code) MSVC_PUSH_DISABLE_WARNING(4355) \ + code \ + MSVC_POP_WARNING() +#else // !COMPILER_MSVC + +#define ALLOW_THIS_IN_INITIALIZER_LIST(code) code + +#endif // !COMPILER_MSVC +#endif // !ALLOW_THIS_IN_INITIALIZER_LIST + +#if !defined(arraysize) + +// The arraysize(arr) macro returns the # of elements in an array arr. +// The expression is a compile-time constant, and therefore can be +// used in defining new arrays, for example. If you use arraysize on +// a pointer by mistake, you will get a compile-time error. +// +// One caveat is that arraysize() doesn't accept any array of an +// anonymous type or a type defined inside a function. In these rare +// cases, you have to use the unsafe ARRAYSIZE_UNSAFE() macro below. This is +// due to a limitation in C++'s template system. The limitation might +// eventually be removed, but it hasn't happened yet. + +// This template function declaration is used in defining arraysize. +// Note that the function doesn't need an implementation, as we only +// use its type. +template +char (&ArraySizeHelper(T (&array)[N]))[N]; + +// That gcc wants both of these prototypes seems mysterious. VC, for +// its part, can't decide which to use (another mystery). Matching of +// template overloads: the final frontier. +#ifndef _MSC_VER +template +char (&ArraySizeHelper(const T (&array)[N]))[N]; +#endif + +#define arraysize(array) (sizeof(ArraySizeHelper(array))) + +#endif // !arraysize + +#if !defined(DISALLOW_COPY_AND_ASSIGN) + +// A macro to disallow the copy constructor and operator= functions +// This should be used in the private: declarations for a class +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + +#endif // !DISALLOW_COPY_AND_ASSIGN + +#if !defined(DISALLOW_IMPLICIT_CONSTRUCTORS) + +// A macro to disallow all the implicit constructors, namely the +// default constructor, copy constructor and operator= functions. +// +// This should be used in the private: declarations for a class +// that wants to prevent anyone from instantiating it. This is +// especially useful for classes containing only static methods. +#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName) \ + TypeName(); \ + DISALLOW_COPY_AND_ASSIGN(TypeName) + +#endif // !DISALLOW_IMPLICIT_CONSTRUCTORS + +#if !defined(COMPILE_ASSERT) + +// The COMPILE_ASSERT macro can be used to verify that a compile time +// expression is true. For example, you could use it to verify the +// size of a static array: +// +// COMPILE_ASSERT(ARRAYSIZE_UNSAFE(content_type_names) == CONTENT_NUM_TYPES, +// content_type_names_incorrect_size); +// +// or to make sure a struct is smaller than a certain size: +// +// COMPILE_ASSERT(sizeof(foo) < 128, foo_too_large); +// +// The second argument to the macro is the name of the variable. If +// the expression is false, most compilers will issue a warning/error +// containing the name of the variable. + +#if __cplusplus >= 201103L + +// Under C++11, just use static_assert. +#define COMPILE_ASSERT(expr, msg) static_assert(expr, #msg) + +#else + +namespace cef { + +template +struct CompileAssert { +}; + +} // namespace cef + +#define COMPILE_ASSERT(expr, msg) \ + typedef cef::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] ALLOW_UNUSED + +// Implementation details of COMPILE_ASSERT: +// +// - COMPILE_ASSERT works by defining an array type that has -1 +// elements (and thus is invalid) when the expression is false. +// +// - The simpler definition +// +// #define COMPILE_ASSERT(expr, msg) typedef char msg[(expr) ? 1 : -1] +// +// does not work, as gcc supports variable-length arrays whose sizes +// are determined at run-time (this is gcc's extension and not part +// of the C++ standard). As a result, gcc fails to reject the +// following code with the simple definition: +// +// int foo; +// COMPILE_ASSERT(foo, msg); // not supposed to compile as foo is +// // not a compile-time constant. +// +// - By using the type CompileAssert<(bool(expr))>, we ensures that +// expr is a compile-time constant. (Template arguments must be +// determined at compile-time.) +// +// - The outer parentheses in CompileAssert<(bool(expr))> are necessary +// to work around a bug in gcc 3.4.4 and 4.0.1. If we had written +// +// CompileAssert +// +// instead, these compilers will refuse to compile +// +// COMPILE_ASSERT(5 > 0, some_message); +// +// (They seem to think the ">" in "5 > 0" marks the end of the +// template argument list.) +// +// - The array size is (bool(expr) ? 1 : -1), instead of simply +// +// ((expr) ? 1 : -1). +// +// This is to avoid running into a bug in MS VC 7.1, which +// causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. + +#endif // !(__cplusplus >= 201103L) + +#endif // !defined(COMPILE_ASSERT) + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_MACROS_H_ diff --git a/vendor/cef3/include/base/cef_move.h b/vendor/cef3/include/base/cef_move.h new file mode 100644 index 00000000000..91069297d9c --- /dev/null +++ b/vendor/cef3/include/base/cef_move.h @@ -0,0 +1,259 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_MOVE_H_ +#define CEF_INCLUDE_BASE_CEF_MOVE_H_ + +#if defined(MOVE_ONLY_TYPE_FOR_CPP_03) +// Do nothing if the macro in this header has already been defined. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/move.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +// Macro with the boilerplate that makes a type move-only in C++03. +// +// USAGE +// +// This macro should be used instead of DISALLOW_COPY_AND_ASSIGN to create +// a "move-only" type. Unlike DISALLOW_COPY_AND_ASSIGN, this macro should be +// the first line in a class declaration. +// +// A class using this macro must call .Pass() (or somehow be an r-value already) +// before it can be: +// +// * Passed as a function argument +// * Used as the right-hand side of an assignment +// * Returned from a function +// +// Each class will still need to define their own "move constructor" and "move +// operator=" to make this useful. Here's an example of the macro, the move +// constructor, and the move operator= from the scoped_ptr class: +// +// template +// class scoped_ptr { +// MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) +// public: +// scoped_ptr(RValue& other) : ptr_(other.release()) { } +// scoped_ptr& operator=(RValue& other) { +// swap(other); +// return *this; +// } +// }; +// +// Note that the constructor must NOT be marked explicit. +// +// For consistency, the second parameter to the macro should always be RValue +// unless you have a strong reason to do otherwise. It is only exposed as a +// macro parameter so that the move constructor and move operator= don't look +// like they're using a phantom type. +// +// +// HOW THIS WORKS +// +// For a thorough explanation of this technique, see: +// +// http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Move_Constructor +// +// The summary is that we take advantage of 2 properties: +// +// 1) non-const references will not bind to r-values. +// 2) C++ can apply one user-defined conversion when initializing a +// variable. +// +// The first lets us disable the copy constructor and assignment operator +// by declaring private version of them with a non-const reference parameter. +// +// For l-values, direct initialization still fails like in +// DISALLOW_COPY_AND_ASSIGN because the copy constructor and assignment +// operators are private. +// +// For r-values, the situation is different. The copy constructor and +// assignment operator are not viable due to (1), so we are trying to call +// a non-existent constructor and non-existing operator= rather than a private +// one. Since we have not committed an error quite yet, we can provide an +// alternate conversion sequence and a constructor. We add +// +// * a private struct named "RValue" +// * a user-defined conversion "operator RValue()" +// * a "move constructor" and "move operator=" that take the RValue& as +// their sole parameter. +// +// Only r-values will trigger this sequence and execute our "move constructor" +// or "move operator=." L-values will match the private copy constructor and +// operator= first giving a "private in this context" error. This combination +// gives us a move-only type. +// +// For signaling a destructive transfer of data from an l-value, we provide a +// method named Pass() which creates an r-value for the current instance +// triggering the move constructor or move operator=. +// +// Other ways to get r-values is to use the result of an expression like a +// function call. +// +// Here's an example with comments explaining what gets triggered where: +// +// class Foo { +// MOVE_ONLY_TYPE_FOR_CPP_03(Foo, RValue); +// +// public: +// ... API ... +// Foo(RValue other); // Move constructor. +// Foo& operator=(RValue rhs); // Move operator= +// }; +// +// Foo MakeFoo(); // Function that returns a Foo. +// +// Foo f; +// Foo f_copy(f); // ERROR: Foo(Foo&) is private in this context. +// Foo f_assign; +// f_assign = f; // ERROR: operator=(Foo&) is private in this context. +// +// +// Foo f(MakeFoo()); // R-value so alternate conversion executed. +// Foo f_copy(f.Pass()); // R-value so alternate conversion executed. +// f = f_copy.Pass(); // R-value so alternate conversion executed. +// +// +// IMPLEMENTATION SUBTLETIES WITH RValue +// +// The RValue struct is just a container for a pointer back to the original +// object. It should only ever be created as a temporary, and no external +// class should ever declare it or use it in a parameter. +// +// It is tempting to want to use the RValue type in function parameters, but +// excluding the limited usage here for the move constructor and move +// operator=, doing so would mean that the function could take both r-values +// and l-values equially which is unexpected. See COMPARED To Boost.Move for +// more details. +// +// An alternate, and incorrect, implementation of the RValue class used by +// Boost.Move makes RValue a fieldless child of the move-only type. RValue& +// is then used in place of RValue in the various operators. The RValue& is +// "created" by doing *reinterpret_cast(this). This has the appeal +// of never creating a temporary RValue struct even with optimizations +// disabled. Also, by virtue of inheritance you can treat the RValue +// reference as if it were the move-only type itself. Unfortunately, +// using the result of this reinterpret_cast<> is actually undefined behavior +// due to C++98 5.2.10.7. In certain compilers (e.g., NaCl) the optimizer +// will generate non-working code. +// +// In optimized builds, both implementations generate the same assembly so we +// choose the one that adheres to the standard. +// +// +// WHY HAVE typedef void MoveOnlyTypeForCPP03 +// +// Callback<>/Bind() needs to understand movable-but-not-copyable semantics +// to call .Pass() appropriately when it is expected to transfer the value. +// The cryptic typedef MoveOnlyTypeForCPP03 is added to make this check +// easy and automatic in helper templates for Callback<>/Bind(). +// See IsMoveOnlyType template and its usage in base/callback_internal.h +// for more details. +// +// +// COMPARED TO C++11 +// +// In C++11, you would implement this functionality using an r-value reference +// and our .Pass() method would be replaced with a call to std::move(). +// +// This emulation also has a deficiency where it uses up the single +// user-defined conversion allowed by C++ during initialization. This can +// cause problems in some API edge cases. For instance, in scoped_ptr, it is +// impossible to make a function "void Foo(scoped_ptr p)" accept a +// value of type scoped_ptr even if you add a constructor to +// scoped_ptr<> that would make it look like it should work. C++11 does not +// have this deficiency. +// +// +// COMPARED TO Boost.Move +// +// Our implementation similar to Boost.Move, but we keep the RValue struct +// private to the move-only type, and we don't use the reinterpret_cast<> hack. +// +// In Boost.Move, RValue is the boost::rv<> template. This type can be used +// when writing APIs like: +// +// void MyFunc(boost::rv& f) +// +// that can take advantage of rv<> to avoid extra copies of a type. However you +// would still be able to call this version of MyFunc with an l-value: +// +// Foo f; +// MyFunc(f); // Uh oh, we probably just destroyed |f| w/o calling Pass(). +// +// unless someone is very careful to also declare a parallel override like: +// +// void MyFunc(const Foo& f) +// +// that would catch the l-values first. This was declared unsafe in C++11 and +// a C++11 compiler will explicitly fail MyFunc(f). Unfortunately, we cannot +// ensure this in C++03. +// +// Since we have no need for writing such APIs yet, our implementation keeps +// RValue private and uses a .Pass() method to do the conversion instead of +// trying to write a version of "std::move()." Writing an API like std::move() +// would require the RValue struct to be public. +// +// +// CAVEATS +// +// If you include a move-only type as a field inside a class that does not +// explicitly declare a copy constructor, the containing class's implicit +// copy constructor will change from Containing(const Containing&) to +// Containing(Containing&). This can cause some unexpected errors. +// +// http://llvm.org/bugs/show_bug.cgi?id=11528 +// +// The workaround is to explicitly declare your copy constructor. +// +#define MOVE_ONLY_TYPE_FOR_CPP_03(type, rvalue_type) \ + private: \ + struct rvalue_type { \ + explicit rvalue_type(type* object) : object(object) {} \ + type* object; \ + }; \ + type(type&); \ + void operator=(type&); \ + public: \ + operator rvalue_type() { return rvalue_type(this); } \ + type Pass() { return type(rvalue_type(this)); } \ + typedef void MoveOnlyTypeForCPP03; \ + private: + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_MOVE_H_ diff --git a/vendor/cef3/include/base/cef_platform_thread.h b/vendor/cef3/include/base/cef_platform_thread.h new file mode 100644 index 00000000000..cda1dc45b73 --- /dev/null +++ b/vendor/cef3/include/base/cef_platform_thread.h @@ -0,0 +1,113 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// WARNING: You should *NOT* be using this class directly. PlatformThread is +// the low-level platform-specific abstraction to the OS's threading interface. +// You should instead be using a message-loop driven Thread, see thread.h. + +#ifndef CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ +#define CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ + +#if defined(BASE_THREADING_PLATFORM_THREAD_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/threading/platform_thread.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/internal/cef_thread_internal.h" + +namespace base { + +// Used for logging. Always an integer value. +typedef cef_platform_thread_id_t PlatformThreadId; + +// Used for thread checking and debugging. +// Meant to be as fast as possible. +// These are produced by PlatformThread::CurrentRef(), and used to later +// check if we are on the same thread or not by using ==. These are safe +// to copy between threads, but can't be copied to another process as they +// have no meaning there. Also, the internal identifier can be re-used +// after a thread dies, so a PlatformThreadRef cannot be reliably used +// to distinguish a new thread from an old, dead thread. +class PlatformThreadRef { + public: + typedef cef_platform_thread_handle_t RefType; + + PlatformThreadRef() + : id_(0) { + } + + explicit PlatformThreadRef(RefType id) + : id_(id) { + } + + bool operator==(PlatformThreadRef other) const { + return id_ == other.id_; + } + + bool is_null() const { + return id_ == 0; + } + private: + RefType id_; +}; + +// A namespace for low-level thread functions. +// Chromium uses a class with static methods but CEF uses an actual namespace +// to avoid linker problems with the sandbox libaries on Windows. +namespace PlatformThread { + +// Gets the current thread id, which may be useful for logging purposes. +inline PlatformThreadId CurrentId() { + return cef_get_current_platform_thread_id(); +} + +// Gets the current thread reference, which can be used to check if +// we're on the right thread quickly. +inline PlatformThreadRef CurrentRef() { + return PlatformThreadRef(cef_get_current_platform_thread_handle()); +} + +} // namespace PlatformThread + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_PLATFORM_THREAD_H_ diff --git a/vendor/cef3/include/base/cef_ref_counted.h b/vendor/cef3/include/base/cef_ref_counted.h new file mode 100644 index 00000000000..55d41e1b469 --- /dev/null +++ b/vendor/cef3/include/base/cef_ref_counted.h @@ -0,0 +1,386 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// + +#ifndef CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ +#define CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ +#pragma once + +#if defined(BASE_MEMORY_REF_COUNTED_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/memory/ref_counted.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include + +#include "include/base/cef_atomic_ref_count.h" +#include "include/base/cef_build.h" +#ifndef NDEBUG +#include "include/base/cef_logging.h" +#endif +#include "include/base/cef_thread_collision_warner.h" + +namespace base { + +namespace subtle { + +class RefCountedBase { + public: + bool HasOneRef() const { return ref_count_ == 1; } + + protected: + RefCountedBase() + : ref_count_(0) + #ifndef NDEBUG + , in_dtor_(false) + #endif + { + } + + ~RefCountedBase() { + #ifndef NDEBUG + DCHECK(in_dtor_) << "RefCounted object deleted without calling Release()"; + #endif + } + + + void AddRef() const { + // TODO(maruel): Add back once it doesn't assert 500 times/sec. + // Current thread books the critical section "AddRelease" + // without release it. + // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); + #ifndef NDEBUG + DCHECK(!in_dtor_); + #endif + ++ref_count_; + } + + // Returns true if the object should self-delete. + bool Release() const { + // TODO(maruel): Add back once it doesn't assert 500 times/sec. + // Current thread books the critical section "AddRelease" + // without release it. + // DFAKE_SCOPED_LOCK_THREAD_LOCKED(add_release_); + #ifndef NDEBUG + DCHECK(!in_dtor_); + #endif + if (--ref_count_ == 0) { + #ifndef NDEBUG + in_dtor_ = true; + #endif + return true; + } + return false; + } + + private: + mutable int ref_count_; +#ifndef NDEBUG + mutable bool in_dtor_; +#endif + + DFAKE_MUTEX(add_release_); + + DISALLOW_COPY_AND_ASSIGN(RefCountedBase); +}; + +class RefCountedThreadSafeBase { + public: + bool HasOneRef() const; + + protected: + RefCountedThreadSafeBase(); + ~RefCountedThreadSafeBase(); + + void AddRef() const; + + // Returns true if the object should self-delete. + bool Release() const; + + private: + mutable AtomicRefCount ref_count_; +#ifndef NDEBUG + mutable bool in_dtor_; +#endif + + DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafeBase); +}; + +} // namespace subtle + +// +// A base class for reference counted classes. Otherwise, known as a cheap +// knock-off of WebKit's RefCounted class. To use this guy just extend your +// class from it like so: +// +// class MyFoo : public base::RefCounted { +// ... +// private: +// friend class base::RefCounted; +// ~MyFoo(); +// }; +// +// You should always make your destructor private, to avoid any code deleting +// the object accidently while there are references to it. +template +class RefCounted : public subtle::RefCountedBase { + public: + RefCounted() {} + + void AddRef() const { + subtle::RefCountedBase::AddRef(); + } + + void Release() const { + if (subtle::RefCountedBase::Release()) { + delete static_cast(this); + } + } + + protected: + ~RefCounted() {} + + private: + DISALLOW_COPY_AND_ASSIGN(RefCounted); +}; + +// Forward declaration. +template class RefCountedThreadSafe; + +// Default traits for RefCountedThreadSafe. Deletes the object when its ref +// count reaches 0. Overload to delete it on a different thread etc. +template +struct DefaultRefCountedThreadSafeTraits { + static void Destruct(const T* x) { + // Delete through RefCountedThreadSafe to make child classes only need to be + // friend with RefCountedThreadSafe instead of this struct, which is an + // implementation detail. + RefCountedThreadSafe::DeleteInternal(x); + } +}; + +// +// A thread-safe variant of RefCounted +// +// class MyFoo : public base::RefCountedThreadSafe { +// ... +// }; +// +// If you're using the default trait, then you should add compile time +// asserts that no one else is deleting your object. i.e. +// private: +// friend class base::RefCountedThreadSafe; +// ~MyFoo(); +template > +class RefCountedThreadSafe : public subtle::RefCountedThreadSafeBase { + public: + RefCountedThreadSafe() {} + + void AddRef() const { + subtle::RefCountedThreadSafeBase::AddRef(); + } + + void Release() const { + if (subtle::RefCountedThreadSafeBase::Release()) { + Traits::Destruct(static_cast(this)); + } + } + + protected: + ~RefCountedThreadSafe() {} + + private: + friend struct DefaultRefCountedThreadSafeTraits; + static void DeleteInternal(const T* x) { delete x; } + + DISALLOW_COPY_AND_ASSIGN(RefCountedThreadSafe); +}; + +// +// A thread-safe wrapper for some piece of data so we can place other +// things in scoped_refptrs<>. +// +template +class RefCountedData + : public base::RefCountedThreadSafe< base::RefCountedData > { + public: + RefCountedData() : data() {} + RefCountedData(const T& in_value) : data(in_value) {} + + T data; + + private: + friend class base::RefCountedThreadSafe >; + ~RefCountedData() {} +}; + +} // namespace base + +// +// A smart pointer class for reference counted objects. Use this class instead +// of calling AddRef and Release manually on a reference counted object to +// avoid common memory leaks caused by forgetting to Release an object +// reference. Sample usage: +// +// class MyFoo : public RefCounted { +// ... +// }; +// +// void some_function() { +// scoped_refptr foo = new MyFoo(); +// foo->Method(param); +// // |foo| is released when this function returns +// } +// +// void some_other_function() { +// scoped_refptr foo = new MyFoo(); +// ... +// foo = NULL; // explicitly releases |foo| +// ... +// if (foo) +// foo->Method(param); +// } +// +// The above examples show how scoped_refptr acts like a pointer to T. +// Given two scoped_refptr classes, it is also possible to exchange +// references between the two objects, like so: +// +// { +// scoped_refptr a = new MyFoo(); +// scoped_refptr b; +// +// b.swap(a); +// // now, |b| references the MyFoo object, and |a| references NULL. +// } +// +// To make both |a| and |b| in the above example reference the same MyFoo +// object, simply use the assignment operator: +// +// { +// scoped_refptr a = new MyFoo(); +// scoped_refptr b; +// +// b = a; +// // now, |a| and |b| each own a reference to the same MyFoo object. +// } +// +template +class scoped_refptr { + public: + typedef T element_type; + + scoped_refptr() : ptr_(NULL) { + } + + scoped_refptr(T* p) : ptr_(p) { + if (ptr_) + ptr_->AddRef(); + } + + scoped_refptr(const scoped_refptr& r) : ptr_(r.ptr_) { + if (ptr_) + ptr_->AddRef(); + } + + template + scoped_refptr(const scoped_refptr& r) : ptr_(r.get()) { + if (ptr_) + ptr_->AddRef(); + } + + ~scoped_refptr() { + if (ptr_) + ptr_->Release(); + } + + T* get() const { return ptr_; } + + // Allow scoped_refptr to be used in boolean expression + // and comparison operations. + operator T*() const { return ptr_; } + + T* operator->() const { + assert(ptr_ != NULL); + return ptr_; + } + + scoped_refptr& operator=(T* p) { + // AddRef first so that self assignment should work + if (p) + p->AddRef(); + T* old_ptr = ptr_; + ptr_ = p; + if (old_ptr) + old_ptr->Release(); + return *this; + } + + scoped_refptr& operator=(const scoped_refptr& r) { + return *this = r.ptr_; + } + + template + scoped_refptr& operator=(const scoped_refptr& r) { + return *this = r.get(); + } + + void swap(T** pp) { + T* p = ptr_; + ptr_ = *pp; + *pp = p; + } + + void swap(scoped_refptr& r) { + swap(&r.ptr_); + } + + protected: + T* ptr_; +}; + +// Handy utility for creating a scoped_refptr out of a T* explicitly without +// having to retype all the template arguments +template +scoped_refptr make_scoped_refptr(T* t) { + return scoped_refptr(t); +} + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_REF_COUNTED_H_ diff --git a/vendor/cef3/include/base/cef_scoped_ptr.h b/vendor/cef3/include/base/cef_scoped_ptr.h new file mode 100644 index 00000000000..4318a09a771 --- /dev/null +++ b/vendor/cef3/include/base/cef_scoped_ptr.h @@ -0,0 +1,624 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Scopers help you manage ownership of a pointer, helping you easily manage a +// pointer within a scope, and automatically destroying the pointer at the end +// of a scope. There are two main classes you will use, which correspond to the +// operators new/delete and new[]/delete[]. +// +// Example usage (scoped_ptr): +// { +// scoped_ptr foo(new Foo("wee")); +// } // foo goes out of scope, releasing the pointer with it. +// +// { +// scoped_ptr foo; // No pointer managed. +// foo.reset(new Foo("wee")); // Now a pointer is managed. +// foo.reset(new Foo("wee2")); // Foo("wee") was destroyed. +// foo.reset(new Foo("wee3")); // Foo("wee2") was destroyed. +// foo->Method(); // Foo::Method() called. +// foo.get()->Method(); // Foo::Method() called. +// SomeFunc(foo.release()); // SomeFunc takes ownership, foo no longer +// // manages a pointer. +// foo.reset(new Foo("wee4")); // foo manages a pointer again. +// foo.reset(); // Foo("wee4") destroyed, foo no longer +// // manages a pointer. +// } // foo wasn't managing a pointer, so nothing was destroyed. +// +// Example usage (scoped_ptr): +// { +// scoped_ptr foo(new Foo[100]); +// foo.get()->Method(); // Foo::Method on the 0th element. +// foo[10].Method(); // Foo::Method on the 10th element. +// } +// +// These scopers also implement part of the functionality of C++11 unique_ptr +// in that they are "movable but not copyable." You can use the scopers in +// the parameter and return types of functions to signify ownership transfer +// in to and out of a function. When calling a function that has a scoper +// as the argument type, it must be called with the result of an analogous +// scoper's Pass() function or another function that generates a temporary; +// passing by copy will NOT work. Here is an example using scoped_ptr: +// +// void TakesOwnership(scoped_ptr arg) { +// // Do something with arg +// } +// scoped_ptr CreateFoo() { +// // No need for calling Pass() because we are constructing a temporary +// // for the return value. +// return scoped_ptr(new Foo("new")); +// } +// scoped_ptr PassThru(scoped_ptr arg) { +// return arg.Pass(); +// } +// +// { +// scoped_ptr ptr(new Foo("yay")); // ptr manages Foo("yay"). +// TakesOwnership(ptr.Pass()); // ptr no longer owns Foo("yay"). +// scoped_ptr ptr2 = CreateFoo(); // ptr2 owns the return Foo. +// scoped_ptr ptr3 = // ptr3 now owns what was in ptr2. +// PassThru(ptr2.Pass()); // ptr2 is correspondingly NULL. +// } +// +// Notice that if you do not call Pass() when returning from PassThru(), or +// when invoking TakesOwnership(), the code will not compile because scopers +// are not copyable; they only implement move semantics which require calling +// the Pass() function to signify a destructive transfer of state. CreateFoo() +// is different though because we are constructing a temporary on the return +// line and thus can avoid needing to call Pass(). +// +// Pass() properly handles upcast in initialization, i.e. you can use a +// scoped_ptr to initialize a scoped_ptr: +// +// scoped_ptr foo(new Foo()); +// scoped_ptr parent(foo.Pass()); +// +// PassAs<>() should be used to upcast return value in return statement: +// +// scoped_ptr CreateFoo() { +// scoped_ptr result(new FooChild()); +// return result.PassAs(); +// } +// +// Note that PassAs<>() is implemented only for scoped_ptr, but not for +// scoped_ptr. This is because casting array pointers may not be safe. + +#ifndef CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ +#define CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ +#pragma once + +#if defined(BASE_MEMORY_SCOPED_PTR_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/memory/scoped_ptr.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +// This is an implementation designed to match the anticipated future TR2 +// implementation of the scoped_ptr class. + +#include +#include +#include + +#include // For std::swap(). + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_move.h" +#include "include/base/cef_template_util.h" + +namespace base { + +namespace subtle { +class RefCountedBase; +class RefCountedThreadSafeBase; +} // namespace subtle + +// Function object which deletes its parameter, which must be a pointer. +// If C is an array type, invokes 'delete[]' on the parameter; otherwise, +// invokes 'delete'. The default deleter for scoped_ptr. +template +struct DefaultDeleter { + DefaultDeleter() {} + template DefaultDeleter(const DefaultDeleter& other) { + // IMPLEMENTATION NOTE: C++11 20.7.1.1.2p2 only provides this constructor + // if U* is implicitly convertible to T* and U is not an array type. + // + // Correct implementation should use SFINAE to disable this + // constructor. However, since there are no other 1-argument constructors, + // using a COMPILE_ASSERT() based on is_convertible<> and requiring + // complete types is simpler and will cause compile failures for equivalent + // misuses. + // + // Note, the is_convertible check also ensures that U is not an + // array. T is guaranteed to be a non-array, so any U* where U is an array + // cannot convert to T*. + enum { T_must_be_complete = sizeof(T) }; + enum { U_must_be_complete = sizeof(U) }; + COMPILE_ASSERT((base::is_convertible::value), + U_ptr_must_implicitly_convert_to_T_ptr); + } + inline void operator()(T* ptr) const { + enum { type_must_be_complete = sizeof(T) }; + delete ptr; + } +}; + +// Specialization of DefaultDeleter for array types. +template +struct DefaultDeleter { + inline void operator()(T* ptr) const { + enum { type_must_be_complete = sizeof(T) }; + delete[] ptr; + } + + private: + // Disable this operator for any U != T because it is undefined to execute + // an array delete when the static type of the array mismatches the dynamic + // type. + // + // References: + // C++98 [expr.delete]p3 + // http://cplusplus.github.com/LWG/lwg-defects.html#938 + template void operator()(U* array) const; +}; + +template +struct DefaultDeleter { + // Never allow someone to declare something like scoped_ptr. + COMPILE_ASSERT(sizeof(T) == -1, do_not_use_array_with_size_as_type); +}; + +// Function object which invokes 'free' on its parameter, which must be +// a pointer. Can be used to store malloc-allocated pointers in scoped_ptr: +// +// scoped_ptr foo_ptr( +// static_cast(malloc(sizeof(int)))); +struct FreeDeleter { + inline void operator()(void* ptr) const { + free(ptr); + } +}; + +namespace internal { + +template struct IsNotRefCounted { + enum { + value = !base::is_convertible::value && + !base::is_convertible:: + value + }; +}; + +// Minimal implementation of the core logic of scoped_ptr, suitable for +// reuse in both scoped_ptr and its specializations. +template +class scoped_ptr_impl { + public: + explicit scoped_ptr_impl(T* p) : data_(p) { } + + // Initializer for deleters that have data parameters. + scoped_ptr_impl(T* p, const D& d) : data_(p, d) {} + + // Templated constructor that destructively takes the value from another + // scoped_ptr_impl. + template + scoped_ptr_impl(scoped_ptr_impl* other) + : data_(other->release(), other->get_deleter()) { + // We do not support move-only deleters. We could modify our move + // emulation to have base::subtle::move() and base::subtle::forward() + // functions that are imperfect emulations of their C++11 equivalents, + // but until there's a requirement, just assume deleters are copyable. + } + + template + void TakeState(scoped_ptr_impl* other) { + // See comment in templated constructor above regarding lack of support + // for move-only deleters. + reset(other->release()); + get_deleter() = other->get_deleter(); + } + + ~scoped_ptr_impl() { + if (data_.ptr != NULL) { + // Not using get_deleter() saves one function call in non-optimized + // builds. + static_cast(data_)(data_.ptr); + } + } + + void reset(T* p) { + // This is a self-reset, which is no longer allowed: http://crbug.com/162971 + if (p != NULL && p == data_.ptr) + abort(); + + // Note that running data_.ptr = p can lead to undefined behavior if + // get_deleter()(get()) deletes this. In order to prevent this, reset() + // should update the stored pointer before deleting its old value. + // + // However, changing reset() to use that behavior may cause current code to + // break in unexpected ways. If the destruction of the owned object + // dereferences the scoped_ptr when it is destroyed by a call to reset(), + // then it will incorrectly dispatch calls to |p| rather than the original + // value of |data_.ptr|. + // + // During the transition period, set the stored pointer to NULL while + // deleting the object. Eventually, this safety check will be removed to + // prevent the scenario initially described from occuring and + // http://crbug.com/176091 can be closed. + T* old = data_.ptr; + data_.ptr = NULL; + if (old != NULL) + static_cast(data_)(old); + data_.ptr = p; + } + + T* get() const { return data_.ptr; } + + D& get_deleter() { return data_; } + const D& get_deleter() const { return data_; } + + void swap(scoped_ptr_impl& p2) { + // Standard swap idiom: 'using std::swap' ensures that std::swap is + // present in the overload set, but we call swap unqualified so that + // any more-specific overloads can be used, if available. + using std::swap; + swap(static_cast(data_), static_cast(p2.data_)); + swap(data_.ptr, p2.data_.ptr); + } + + T* release() { + T* old_ptr = data_.ptr; + data_.ptr = NULL; + return old_ptr; + } + + private: + // Needed to allow type-converting constructor. + template friend class scoped_ptr_impl; + + // Use the empty base class optimization to allow us to have a D + // member, while avoiding any space overhead for it when D is an + // empty class. See e.g. http://www.cantrip.org/emptyopt.html for a good + // discussion of this technique. + struct Data : public D { + explicit Data(T* ptr_in) : ptr(ptr_in) {} + Data(T* ptr_in, const D& other) : D(other), ptr(ptr_in) {} + T* ptr; + }; + + Data data_; + + DISALLOW_COPY_AND_ASSIGN(scoped_ptr_impl); +}; + +} // namespace internal + +} // namespace base + +// A scoped_ptr is like a T*, except that the destructor of scoped_ptr +// automatically deletes the pointer it holds (if any). +// That is, scoped_ptr owns the T object that it points to. +// Like a T*, a scoped_ptr may hold either NULL or a pointer to a T object. +// Also like T*, scoped_ptr is thread-compatible, and once you +// dereference it, you get the thread safety guarantees of T. +// +// The size of scoped_ptr is small. On most compilers, when using the +// DefaultDeleter, sizeof(scoped_ptr) == sizeof(T*). Custom deleters will +// increase the size proportional to whatever state they need to have. See +// comments inside scoped_ptr_impl<> for details. +// +// Current implementation targets having a strict subset of C++11's +// unique_ptr<> features. Known deficiencies include not supporting move-only +// deleteres, function pointers as deleters, and deleters with reference +// types. +template > +class scoped_ptr { + MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) + + COMPILE_ASSERT(base::internal::IsNotRefCounted::value, + T_is_refcounted_type_and_needs_scoped_refptr); + + public: + // The element and deleter types. + typedef T element_type; + typedef D deleter_type; + + // Constructor. Defaults to initializing with NULL. + scoped_ptr() : impl_(NULL) { } + + // Constructor. Takes ownership of p. + explicit scoped_ptr(element_type* p) : impl_(p) { } + + // Constructor. Allows initialization of a stateful deleter. + scoped_ptr(element_type* p, const D& d) : impl_(p, d) { } + + // Constructor. Allows construction from a scoped_ptr rvalue for a + // convertible type and deleter. + // + // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this constructor distinct + // from the normal move constructor. By C++11 20.7.1.2.1.21, this constructor + // has different post-conditions if D is a reference type. Since this + // implementation does not support deleters with reference type, + // we do not need a separate move constructor allowing us to avoid one + // use of SFINAE. You only need to care about this if you modify the + // implementation of scoped_ptr. + template + scoped_ptr(scoped_ptr other) : impl_(&other.impl_) { + COMPILE_ASSERT(!base::is_array::value, U_cannot_be_an_array); + } + + // Constructor. Move constructor for C++03 move emulation of this type. + scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } + + // operator=. Allows assignment from a scoped_ptr rvalue for a convertible + // type and deleter. + // + // IMPLEMENTATION NOTE: C++11 unique_ptr<> keeps this operator= distinct from + // the normal move assignment operator. By C++11 20.7.1.2.3.4, this templated + // form has different requirements on for move-only Deleters. Since this + // implementation does not support move-only Deleters, we do not need a + // separate move assignment operator allowing us to avoid one use of SFINAE. + // You only need to care about this if you modify the implementation of + // scoped_ptr. + template + scoped_ptr& operator=(scoped_ptr rhs) { + COMPILE_ASSERT(!base::is_array::value, U_cannot_be_an_array); + impl_.TakeState(&rhs.impl_); + return *this; + } + + // Reset. Deletes the currently owned object, if any. + // Then takes ownership of a new object, if given. + void reset(element_type* p = NULL) { impl_.reset(p); } + + // Accessors to get the owned object. + // operator* and operator-> will assert() if there is no current object. + element_type& operator*() const { + assert(impl_.get() != NULL); + return *impl_.get(); + } + element_type* operator->() const { + assert(impl_.get() != NULL); + return impl_.get(); + } + element_type* get() const { return impl_.get(); } + + // Access to the deleter. + deleter_type& get_deleter() { return impl_.get_deleter(); } + const deleter_type& get_deleter() const { return impl_.get_deleter(); } + + // Allow scoped_ptr to be used in boolean expressions, but not + // implicitly convertible to a real bool (which is dangerous). + // + // Note that this trick is only safe when the == and != operators + // are declared explicitly, as otherwise "scoped_ptr1 == + // scoped_ptr2" will compile but do the wrong thing (i.e., convert + // to Testable and then do the comparison). + private: + typedef base::internal::scoped_ptr_impl + scoped_ptr::*Testable; + + public: + operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } + + // Comparison operators. + // These return whether two scoped_ptr refer to the same object, not just to + // two different but equal objects. + bool operator==(const element_type* p) const { return impl_.get() == p; } + bool operator!=(const element_type* p) const { return impl_.get() != p; } + + // Swap two scoped pointers. + void swap(scoped_ptr& p2) { + impl_.swap(p2.impl_); + } + + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + element_type* release() WARN_UNUSED_RESULT { + return impl_.release(); + } + + // C++98 doesn't support functions templates with default parameters which + // makes it hard to write a PassAs() that understands converting the deleter + // while preserving simple calling semantics. + // + // Until there is a use case for PassAs() with custom deleters, just ignore + // the custom deleter. + template + scoped_ptr PassAs() { + return scoped_ptr(Pass()); + } + + private: + // Needed to reach into |impl_| in the constructor. + template friend class scoped_ptr; + base::internal::scoped_ptr_impl impl_; + + // Forbidden for API compatibility with std::unique_ptr. + explicit scoped_ptr(int disallow_construction_from_null); + + // Forbid comparison of scoped_ptr types. If U != T, it totally + // doesn't make sense, and if U == T, it still doesn't make sense + // because you should never have the same object owned by two different + // scoped_ptrs. + template bool operator==(scoped_ptr const& p2) const; + template bool operator!=(scoped_ptr const& p2) const; +}; + +template +class scoped_ptr { + MOVE_ONLY_TYPE_FOR_CPP_03(scoped_ptr, RValue) + + public: + // The element and deleter types. + typedef T element_type; + typedef D deleter_type; + + // Constructor. Defaults to initializing with NULL. + scoped_ptr() : impl_(NULL) { } + + // Constructor. Stores the given array. Note that the argument's type + // must exactly match T*. In particular: + // - it cannot be a pointer to a type derived from T, because it is + // inherently unsafe in the general case to access an array through a + // pointer whose dynamic type does not match its static type (eg., if + // T and the derived types had different sizes access would be + // incorrectly calculated). Deletion is also always undefined + // (C++98 [expr.delete]p3). If you're doing this, fix your code. + // - it cannot be NULL, because NULL is an integral expression, not a + // pointer to T. Use the no-argument version instead of explicitly + // passing NULL. + // - it cannot be const-qualified differently from T per unique_ptr spec + // (http://cplusplus.github.com/LWG/lwg-active.html#2118). Users wanting + // to work around this may use implicit_cast(). + // However, because of the first bullet in this comment, users MUST + // NOT use implicit_cast() to upcast the static type of the array. + explicit scoped_ptr(element_type* array) : impl_(array) { } + + // Constructor. Move constructor for C++03 move emulation of this type. + scoped_ptr(RValue rvalue) : impl_(&rvalue.object->impl_) { } + + // operator=. Move operator= for C++03 move emulation of this type. + scoped_ptr& operator=(RValue rhs) { + impl_.TakeState(&rhs.object->impl_); + return *this; + } + + // Reset. Deletes the currently owned array, if any. + // Then takes ownership of a new object, if given. + void reset(element_type* array = NULL) { impl_.reset(array); } + + // Accessors to get the owned array. + element_type& operator[](size_t i) const { + assert(impl_.get() != NULL); + return impl_.get()[i]; + } + element_type* get() const { return impl_.get(); } + + // Access to the deleter. + deleter_type& get_deleter() { return impl_.get_deleter(); } + const deleter_type& get_deleter() const { return impl_.get_deleter(); } + + // Allow scoped_ptr to be used in boolean expressions, but not + // implicitly convertible to a real bool (which is dangerous). + private: + typedef base::internal::scoped_ptr_impl + scoped_ptr::*Testable; + + public: + operator Testable() const { return impl_.get() ? &scoped_ptr::impl_ : NULL; } + + // Comparison operators. + // These return whether two scoped_ptr refer to the same object, not just to + // two different but equal objects. + bool operator==(element_type* array) const { return impl_.get() == array; } + bool operator!=(element_type* array) const { return impl_.get() != array; } + + // Swap two scoped pointers. + void swap(scoped_ptr& p2) { + impl_.swap(p2.impl_); + } + + // Release a pointer. + // The return value is the current pointer held by this object. + // If this object holds a NULL pointer, the return value is NULL. + // After this operation, this object will hold a NULL pointer, + // and will not own the object any more. + element_type* release() WARN_UNUSED_RESULT { + return impl_.release(); + } + + private: + // Force element_type to be a complete type. + enum { type_must_be_complete = sizeof(element_type) }; + + // Actually hold the data. + base::internal::scoped_ptr_impl impl_; + + // Disable initialization from any type other than element_type*, by + // providing a constructor that matches such an initialization, but is + // private and has no definition. This is disabled because it is not safe to + // call delete[] on an array whose static type does not match its dynamic + // type. + template explicit scoped_ptr(U* array); + explicit scoped_ptr(int disallow_construction_from_null); + + // Disable reset() from any type other than element_type*, for the same + // reasons as the constructor above. + template void reset(U* array); + void reset(int disallow_reset_from_null); + + // Forbid comparison of scoped_ptr types. If U != T, it totally + // doesn't make sense, and if U == T, it still doesn't make sense + // because you should never have the same object owned by two different + // scoped_ptrs. + template bool operator==(scoped_ptr const& p2) const; + template bool operator!=(scoped_ptr const& p2) const; +}; + +// Free functions +template +void swap(scoped_ptr& p1, scoped_ptr& p2) { + p1.swap(p2); +} + +template +bool operator==(T* p1, const scoped_ptr& p2) { + return p1 == p2.get(); +} + +template +bool operator!=(T* p1, const scoped_ptr& p2) { + return p1 != p2.get(); +} + +// A function to convert T* into scoped_ptr +// Doing e.g. make_scoped_ptr(new FooBarBaz(arg)) is a shorter notation +// for scoped_ptr >(new FooBarBaz(arg)) +template +scoped_ptr make_scoped_ptr(T* ptr) { + return scoped_ptr(ptr); +} + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_MEMORY_SCOPED_PTR_H_ diff --git a/vendor/cef3/include/base/cef_string16.h b/vendor/cef3/include/base/cef_string16.h new file mode 100644 index 00000000000..0d642b2dfa4 --- /dev/null +++ b/vendor/cef3/include/base/cef_string16.h @@ -0,0 +1,227 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2013 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_STRING16_H_ +#define CEF_INCLUDE_BASE_CEF_STRING16_H_ +#pragma once + +#if defined(BASE_STRINGS_STRING16_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/strings/string16.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. +// WHAT: +// A version of std::basic_string that provides 2-byte characters even when +// wchar_t is not implemented as a 2-byte type. You can access this class as +// string16. We also define char16, which string16 is based upon. +// +// WHY: +// On Windows, wchar_t is 2 bytes, and it can conveniently handle UTF-16/UCS-2 +// data. Plenty of existing code operates on strings encoded as UTF-16. +// +// On many other platforms, sizeof(wchar_t) is 4 bytes by default. We can make +// it 2 bytes by using the GCC flag -fshort-wchar. But then std::wstring fails +// at run time, because it calls some functions (like wcslen) that come from +// the system's native C library -- which was built with a 4-byte wchar_t! +// It's wasteful to use 4-byte wchar_t strings to carry UTF-16 data, and it's +// entirely improper on those systems where the encoding of wchar_t is defined +// as UTF-32. +// +// Here, we define string16, which is similar to std::wstring but replaces all +// libc functions with custom, 2-byte-char compatible routines. It is capable +// of carrying UTF-16-encoded data. + +#include +#include + +#include "include/base/cef_basictypes.h" + +#if defined(WCHAR_T_IS_UTF16) + +namespace base { + +typedef wchar_t char16; +typedef std::wstring string16; +typedef std::char_traits string16_char_traits; + +} // namespace base + +#elif defined(WCHAR_T_IS_UTF32) + +#include // For uint16_t + +#include "include/base/cef_macros.h" + +namespace base { + +typedef uint16_t char16; + +// char16 versions of the functions required by string16_char_traits; these +// are based on the wide character functions of similar names ("w" or "wcs" +// instead of "c16"). +int c16memcmp(const char16* s1, const char16* s2, size_t n); +size_t c16len(const char16* s); +const char16* c16memchr(const char16* s, char16 c, size_t n); +char16* c16memmove(char16* s1, const char16* s2, size_t n); +char16* c16memcpy(char16* s1, const char16* s2, size_t n); +char16* c16memset(char16* s, char16 c, size_t n); + +struct string16_char_traits { + typedef char16 char_type; + typedef int int_type; + + // int_type needs to be able to hold each possible value of char_type, and in + // addition, the distinct value of eof(). + COMPILE_ASSERT(sizeof(int_type) > sizeof(char_type), unexpected_type_width); + + typedef std::streamoff off_type; + typedef mbstate_t state_type; + typedef std::fpos pos_type; + + static void assign(char_type& c1, const char_type& c2) { + c1 = c2; + } + + static bool eq(const char_type& c1, const char_type& c2) { + return c1 == c2; + } + static bool lt(const char_type& c1, const char_type& c2) { + return c1 < c2; + } + + static int compare(const char_type* s1, const char_type* s2, size_t n) { + return c16memcmp(s1, s2, n); + } + + static size_t length(const char_type* s) { + return c16len(s); + } + + static const char_type* find(const char_type* s, size_t n, + const char_type& a) { + return c16memchr(s, a, n); + } + + static char_type* move(char_type* s1, const char_type* s2, int_type n) { + return c16memmove(s1, s2, n); + } + + static char_type* copy(char_type* s1, const char_type* s2, size_t n) { + return c16memcpy(s1, s2, n); + } + + static char_type* assign(char_type* s, size_t n, char_type a) { + return c16memset(s, a, n); + } + + static int_type not_eof(const int_type& c) { + return eq_int_type(c, eof()) ? 0 : c; + } + + static char_type to_char_type(const int_type& c) { + return char_type(c); + } + + static int_type to_int_type(const char_type& c) { + return int_type(c); + } + + static bool eq_int_type(const int_type& c1, const int_type& c2) { + return c1 == c2; + } + + static int_type eof() { + return static_cast(EOF); + } +}; + +typedef std::basic_string string16; + +extern std::ostream& operator<<(std::ostream& out, const string16& str); + +// This is required by googletest to print a readable output on test failures. +extern void PrintTo(const string16& str, std::ostream* out); + +} // namespace base + +// The string class will be explicitly instantiated only once, in string16.cc. +// +// std::basic_string<> in GNU libstdc++ contains a static data member, +// _S_empty_rep_storage, to represent empty strings. When an operation such +// as assignment or destruction is performed on a string, causing its existing +// data member to be invalidated, it must not be freed if this static data +// member is being used. Otherwise, it counts as an attempt to free static +// (and not allocated) data, which is a memory error. +// +// Generally, due to C++ template magic, _S_empty_rep_storage will be marked +// as a coalesced symbol, meaning that the linker will combine multiple +// instances into a single one when generating output. +// +// If a string class is used by multiple shared libraries, a problem occurs. +// Each library will get its own copy of _S_empty_rep_storage. When strings +// are passed across a library boundary for alteration or destruction, memory +// errors will result. GNU libstdc++ contains a configuration option, +// --enable-fully-dynamic-string (_GLIBCXX_FULLY_DYNAMIC_STRING), which +// disables the static data member optimization, but it's a good optimization +// and non-STL code is generally at the mercy of the system's STL +// configuration. Fully-dynamic strings are not the default for GNU libstdc++ +// libstdc++ itself or for the libstdc++ installations on the systems we care +// about, such as Mac OS X and relevant flavors of Linux. +// +// See also http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24196 . +// +// To avoid problems, string classes need to be explicitly instantiated only +// once, in exactly one library. All other string users see it via an "extern" +// declaration. This is precisely how GNU libstdc++ handles +// std::basic_string (string) and std::basic_string (wstring). +// +// This also works around a Mac OS X linker bug in ld64-85.2.1 (Xcode 3.1.2), +// in which the linker does not fully coalesce symbols when dead code +// stripping is enabled. This bug causes the memory errors described above +// to occur even when a std::basic_string<> does not cross shared library +// boundaries, such as in statically-linked executables. +// +// TODO(mark): File this bug with Apple and update this note with a bug number. + +extern template +class std::basic_string; + +#endif // WCHAR_T_IS_UTF32 + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_STRING16_H_ diff --git a/vendor/cef3/include/base/cef_template_util.h b/vendor/cef3/include/base/cef_template_util.h new file mode 100644 index 00000000000..dc82548a5c4 --- /dev/null +++ b/vendor/cef3/include/base/cef_template_util.h @@ -0,0 +1,192 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ +#define CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ +#pragma once + +#if defined(BASE_TEMPLATE_UTIL_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/template_util.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include // For size_t. + +#include "include/base/cef_build.h" + +namespace base { + +// template definitions from tr1 + +template +struct integral_constant { + static const T value = v; + typedef T value_type; + typedef integral_constant type; +}; + +template const T integral_constant::value; + +typedef integral_constant true_type; +typedef integral_constant false_type; + +template struct is_pointer : false_type {}; +template struct is_pointer : true_type {}; + +// Member function pointer detection up to four params. Add more as needed +// below. This is built-in to C++ 11, and we can remove this when we switch. +template +struct is_member_function_pointer : false_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + +template +struct is_member_function_pointer : true_type {}; +template +struct is_member_function_pointer : true_type {}; + + +template struct is_same : public false_type {}; +template struct is_same : true_type {}; + +template struct is_array : public false_type {}; +template struct is_array : public true_type {}; +template struct is_array : public true_type {}; + +template struct is_non_const_reference : false_type {}; +template struct is_non_const_reference : true_type {}; +template struct is_non_const_reference : false_type {}; + +template struct is_const : false_type {}; +template struct is_const : true_type {}; + +template struct is_void : false_type {}; +template <> struct is_void : true_type {}; + +namespace internal { + +// Types YesType and NoType are guaranteed such that sizeof(YesType) < +// sizeof(NoType). +typedef char YesType; + +struct NoType { + YesType dummy[2]; +}; + +// This class is an implementation detail for is_convertible, and you +// don't need to know how it works to use is_convertible. For those +// who care: we declare two different functions, one whose argument is +// of type To and one with a variadic argument list. We give them +// return types of different size, so we can use sizeof to trick the +// compiler into telling us which function it would have chosen if we +// had called it with an argument of type From. See Alexandrescu's +// _Modern C++ Design_ for more details on this sort of trick. + +struct ConvertHelper { + template + static YesType Test(To); + + template + static NoType Test(...); + + template + static From& Create(); +}; + +// Used to determine if a type is a struct/union/class. Inspired by Boost's +// is_class type_trait implementation. +struct IsClassHelper { + template + static YesType Test(void(C::*)(void)); + + template + static NoType Test(...); +}; + +} // namespace internal + +// Inherits from true_type if From is convertible to To, false_type otherwise. +// +// Note that if the type is convertible, this will be a true_type REGARDLESS +// of whether or not the conversion would emit a warning. +template +struct is_convertible + : integral_constant( + internal::ConvertHelper::Create())) == + sizeof(internal::YesType)> { +}; + +template +struct is_class + : integral_constant(0)) == + sizeof(internal::YesType)> { +}; + +template +struct enable_if {}; + +template +struct enable_if { typedef T type; }; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_TEMPLATE_UTIL_H_ diff --git a/vendor/cef3/include/base/cef_thread_checker.h b/vendor/cef3/include/base/cef_thread_checker.h new file mode 100644 index 00000000000..2fd4f271ada --- /dev/null +++ b/vendor/cef3/include/base/cef_thread_checker.h @@ -0,0 +1,125 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_THREAD_CHECKER_H_ +#define CEF_INCLUDE_BASE_THREAD_CHECKER_H_ +#pragma once + +#if defined(BASE_THREADING_THREAD_CHECKER_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/threading/thread_checker.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +// Apart from debug builds, we also enable the thread checker in +// builds with DCHECK_ALWAYS_ON so that trybots and waterfall bots +// with this define will get the same level of thread checking as +// debug bots. +// +// Note that this does not perfectly match situations where DCHECK is +// enabled. For example a non-official release build may have +// DCHECK_ALWAYS_ON undefined (and therefore ThreadChecker would be +// disabled) but have DCHECKs enabled at runtime. +#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#define ENABLE_THREAD_CHECKER 1 +#else +#define ENABLE_THREAD_CHECKER 0 +#endif + +#include "include/base/internal/cef_thread_checker_impl.h" + +namespace base { + +// Do nothing implementation, for use in release mode. +// +// Note: You should almost always use the ThreadChecker class to get the +// right version for your build configuration. +class ThreadCheckerDoNothing { + public: + bool CalledOnValidThread() const { + return true; + } + + void DetachFromThread() {} +}; + +// ThreadChecker is a helper class used to help verify that some methods of a +// class are called from the same thread. It provides identical functionality to +// base::NonThreadSafe, but it is meant to be held as a member variable, rather +// than inherited from base::NonThreadSafe. +// +// While inheriting from base::NonThreadSafe may give a clear indication about +// the thread-safety of a class, it may also lead to violations of the style +// guide with regard to multiple inheritance. The choice between having a +// ThreadChecker member and inheriting from base::NonThreadSafe should be based +// on whether: +// - Derived classes need to know the thread they belong to, as opposed to +// having that functionality fully encapsulated in the base class. +// - Derived classes should be able to reassign the base class to another +// thread, via DetachFromThread. +// +// If neither of these are true, then having a ThreadChecker member and calling +// CalledOnValidThread is the preferable solution. +// +// Example: +// class MyClass { +// public: +// void Foo() { +// DCHECK(thread_checker_.CalledOnValidThread()); +// ... (do stuff) ... +// } +// +// private: +// ThreadChecker thread_checker_; +// } +// +// In Release mode, CalledOnValidThread will always return true. +#if ENABLE_THREAD_CHECKER +class ThreadChecker : public ThreadCheckerImpl { +}; +#else +class ThreadChecker : public ThreadCheckerDoNothing { +}; +#endif // ENABLE_THREAD_CHECKER + +#undef ENABLE_THREAD_CHECKER + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_THREAD_CHECKER_H_ diff --git a/vendor/cef3/include/base/cef_thread_collision_warner.h b/vendor/cef3/include/base/cef_thread_collision_warner.h new file mode 100644 index 00000000000..bbc88759c09 --- /dev/null +++ b/vendor/cef3/include/base/cef_thread_collision_warner.h @@ -0,0 +1,287 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ +#define CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ +#pragma once + +#if defined(BASE_THREADING_THREAD_COLLISION_WARNER_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/threading/thread_collision_warner.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include + +#include "include/base/cef_atomicops.h" +#include "include/base/cef_basictypes.h" +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" + +// A helper class alongside macros to be used to verify assumptions about thread +// safety of a class. +// +// Example: Queue implementation non thread-safe but still usable if clients +// are synchronized somehow. +// +// In this case the macro DFAKE_SCOPED_LOCK has to be +// used, it checks that if a thread is inside the push/pop then +// noone else is still inside the pop/push +// +// class NonThreadSafeQueue { +// public: +// ... +// void push(int) { DFAKE_SCOPED_LOCK(push_pop_); ... } +// int pop() { DFAKE_SCOPED_LOCK(push_pop_); ... } +// ... +// private: +// DFAKE_MUTEX(push_pop_); +// }; +// +// +// Example: Queue implementation non thread-safe but still usable if clients +// are synchronized somehow, it calls a method to "protect" from +// a "protected" method +// +// In this case the macro DFAKE_SCOPED_RECURSIVE_LOCK +// has to be used, it checks that if a thread is inside the push/pop +// then noone else is still inside the pop/push +// +// class NonThreadSafeQueue { +// public: +// void push(int) { +// DFAKE_SCOPED_LOCK(push_pop_); +// ... +// } +// int pop() { +// DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); +// bar(); +// ... +// } +// void bar() { DFAKE_SCOPED_RECURSIVE_LOCK(push_pop_); ... } +// ... +// private: +// DFAKE_MUTEX(push_pop_); +// }; +// +// +// Example: Queue implementation not usable even if clients are synchronized, +// so only one thread in the class life cycle can use the two members +// push/pop. +// +// In this case the macro DFAKE_SCOPED_LOCK_THREAD_LOCKED pins the +// specified +// critical section the first time a thread enters push or pop, from +// that time on only that thread is allowed to execute push or pop. +// +// class NonThreadSafeQueue { +// public: +// ... +// void push(int) { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... } +// int pop() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(push_pop_); ... } +// ... +// private: +// DFAKE_MUTEX(push_pop_); +// }; +// +// +// Example: Class that has to be contructed/destroyed on same thread, it has +// a "shareable" method (with external synchronization) and a not +// shareable method (even with external synchronization). +// +// In this case 3 Critical sections have to be defined +// +// class ExoticClass { +// public: +// ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } +// ~ExoticClass() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } +// +// void Shareable() { DFAKE_SCOPED_LOCK(shareable_section_); ... } +// void NotShareable() { DFAKE_SCOPED_LOCK_THREAD_LOCKED(ctor_dtor_); ... } +// ... +// private: +// DFAKE_MUTEX(ctor_dtor_); +// DFAKE_MUTEX(shareable_section_); +// }; + + +#if !defined(NDEBUG) + +// Defines a class member that acts like a mutex. It is used only as a +// verification tool. +#define DFAKE_MUTEX(obj) \ + mutable base::ThreadCollisionWarner obj +// Asserts the call is never called simultaneously in two threads. Used at +// member function scope. +#define DFAKE_SCOPED_LOCK(obj) \ + base::ThreadCollisionWarner::ScopedCheck s_check_##obj(&obj) +// Asserts the call is never called simultaneously in two threads. Used at +// member function scope. Same as DFAKE_SCOPED_LOCK but allows recursive locks. +#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) \ + base::ThreadCollisionWarner::ScopedRecursiveCheck sr_check_##obj(&obj) +// Asserts the code is always executed in the same thread. +#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) \ + base::ThreadCollisionWarner::Check check_##obj(&obj) + +#else + +#define DFAKE_MUTEX(obj) typedef void InternalFakeMutexType##obj +#define DFAKE_SCOPED_LOCK(obj) ((void)0) +#define DFAKE_SCOPED_RECURSIVE_LOCK(obj) ((void)0) +#define DFAKE_SCOPED_LOCK_THREAD_LOCKED(obj) ((void)0) + +#endif + +namespace base { + +// The class ThreadCollisionWarner uses an Asserter to notify the collision +// AsserterBase is the interfaces and DCheckAsserter is the default asserter +// used. During the unit tests is used another class that doesn't "DCHECK" +// in case of collision (check thread_collision_warner_unittests.cc) +struct AsserterBase { + virtual ~AsserterBase() {} + virtual void warn() = 0; +}; + +struct DCheckAsserter : public AsserterBase { + virtual ~DCheckAsserter() {} + virtual void warn() OVERRIDE; +}; + +class ThreadCollisionWarner { + public: + // The parameter asserter is there only for test purpose + explicit ThreadCollisionWarner(AsserterBase* asserter = new DCheckAsserter()) + : valid_thread_id_(0), + counter_(0), + asserter_(asserter) {} + + ~ThreadCollisionWarner() { + delete asserter_; + } + + // This class is meant to be used through the macro + // DFAKE_SCOPED_LOCK_THREAD_LOCKED + // it doesn't leave the critical section, as opposed to ScopedCheck, + // because the critical section being pinned is allowed to be used only + // from one thread + class Check { + public: + explicit Check(ThreadCollisionWarner* warner) + : warner_(warner) { + warner_->EnterSelf(); + } + + ~Check() {} + + private: + ThreadCollisionWarner* warner_; + + DISALLOW_COPY_AND_ASSIGN(Check); + }; + + // This class is meant to be used through the macro + // DFAKE_SCOPED_LOCK + class ScopedCheck { + public: + explicit ScopedCheck(ThreadCollisionWarner* warner) + : warner_(warner) { + warner_->Enter(); + } + + ~ScopedCheck() { + warner_->Leave(); + } + + private: + ThreadCollisionWarner* warner_; + + DISALLOW_COPY_AND_ASSIGN(ScopedCheck); + }; + + // This class is meant to be used through the macro + // DFAKE_SCOPED_RECURSIVE_LOCK + class ScopedRecursiveCheck { + public: + explicit ScopedRecursiveCheck(ThreadCollisionWarner* warner) + : warner_(warner) { + warner_->EnterSelf(); + } + + ~ScopedRecursiveCheck() { + warner_->Leave(); + } + + private: + ThreadCollisionWarner* warner_; + + DISALLOW_COPY_AND_ASSIGN(ScopedRecursiveCheck); + }; + + private: + // This method stores the current thread identifier and does a DCHECK + // if a another thread has already done it, it is safe if same thread + // calls this multiple time (recursion allowed). + void EnterSelf(); + + // Same as EnterSelf but recursion is not allowed. + void Enter(); + + // Removes the thread_id stored in order to allow other threads to + // call EnterSelf or Enter. + void Leave(); + + // This stores the thread id that is inside the critical section, if the + // value is 0 then no thread is inside. + volatile subtle::Atomic32 valid_thread_id_; + + // Counter to trace how many time a critical section was "pinned" + // (when allowed) in order to unpin it when counter_ reaches 0. + volatile subtle::Atomic32 counter_; + + // Here only for class unit tests purpose, during the test I need to not + // DCHECK but notify the collision with something else. + AsserterBase* asserter_; + + DISALLOW_COPY_AND_ASSIGN(ThreadCollisionWarner); +}; + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_THREAD_COLLISION_WARNER_H_ diff --git a/vendor/cef3/include/base/cef_trace_event.h b/vendor/cef3/include/base/cef_trace_event.h new file mode 100644 index 00000000000..a24146cd055 --- /dev/null +++ b/vendor/cef3/include/base/cef_trace_event.h @@ -0,0 +1,427 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/// +// Trace events are for tracking application performance and resource usage. +// Macros are provided to track: +// Begin and end of function calls +// Counters +// +// Events are issued against categories. Whereas LOG's categories are statically +// defined, TRACE categories are created implicitly with a string. For example: +// TRACE_EVENT_INSTANT0("MY_SUBSYSTEM", "SomeImportantEvent") +// +// Events can be INSTANT, or can be pairs of BEGIN and END in the same scope: +// TRACE_EVENT_BEGIN0("MY_SUBSYSTEM", "SomethingCostly") +// doSomethingCostly() +// TRACE_EVENT_END0("MY_SUBSYSTEM", "SomethingCostly") +// Note: Our tools can't always determine the correct BEGIN/END pairs unless +// these are used in the same scope. Use ASYNC_BEGIN/ASYNC_END macros if you +// need them to be in separate scopes. +// +// A common use case is to trace entire function scopes. This issues a trace +// BEGIN and END automatically: +// void doSomethingCostly() { +// TRACE_EVENT0("MY_SUBSYSTEM", "doSomethingCostly"); +// ... +// } +// +// Additional parameters can be associated with an event: +// void doSomethingCostly2(int howMuch) { +// TRACE_EVENT1("MY_SUBSYSTEM", "doSomethingCostly", +// "howMuch", howMuch); +// ... +// } +// +// The trace system will automatically add to this information the current +// process id, thread id, and a timestamp in microseconds. +// +// To trace an asynchronous procedure such as an IPC send/receive, use +// ASYNC_BEGIN and ASYNC_END: +// [single threaded sender code] +// static int send_count = 0; +// ++send_count; +// TRACE_EVENT_ASYNC_BEGIN0("ipc", "message", send_count); +// Send(new MyMessage(send_count)); +// [receive code] +// void OnMyMessage(send_count) { +// TRACE_EVENT_ASYNC_END0("ipc", "message", send_count); +// } +// The third parameter is a unique ID to match ASYNC_BEGIN/ASYNC_END pairs. +// ASYNC_BEGIN and ASYNC_END can occur on any thread of any traced process. +// Pointers can be used for the ID parameter, and they will be mangled +// internally so that the same pointer on two different processes will not +// match. For example: +// class MyTracedClass { +// public: +// MyTracedClass() { +// TRACE_EVENT_ASYNC_BEGIN0("category", "MyTracedClass", this); +// } +// ~MyTracedClass() { +// TRACE_EVENT_ASYNC_END0("category", "MyTracedClass", this); +// } +// } +// +// The trace event also supports counters, which is a way to track a quantity +// as it varies over time. Counters are created with the following macro: +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter", g_myCounterValue); +// +// Counters are process-specific. The macro itself can be issued from any +// thread, however. +// +// Sometimes, you want to track two counters at once. You can do this with two +// counter macros: +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter0", g_myCounterValue[0]); +// TRACE_COUNTER1("MY_SUBSYSTEM", "myCounter1", g_myCounterValue[1]); +// Or you can do it with a combined macro: +// TRACE_COUNTER2("MY_SUBSYSTEM", "myCounter", +// "bytesPinned", g_myCounterValue[0], +// "bytesAllocated", g_myCounterValue[1]); +// This indicates to the tracing UI that these counters should be displayed +// in a single graph, as a summed area chart. +// +// Since counters are in a global namespace, you may want to disembiguate with a +// unique ID, by using the TRACE_COUNTER_ID* variations. +// +// By default, trace collection is compiled in, but turned off at runtime. +// Collecting trace data is the responsibility of the embedding application. In +// CEF's case, calling BeginTracing will turn on tracing on all active +// processes. +// +// +// Memory scoping note: +// Tracing copies the pointers, not the string content, of the strings passed +// in for category, name, and arg_names. Thus, the following code will cause +// problems: +// char* str = strdup("impprtantName"); +// TRACE_EVENT_INSTANT0("SUBSYSTEM", str); // BAD! +// free(str); // Trace system now has dangling pointer +// +// To avoid this issue with the |name| and |arg_name| parameters, use the +// TRACE_EVENT_COPY_XXX overloads of the macros at additional runtime +// overhead. +// Notes: The category must always be in a long-lived char* (i.e. static const). +// The |arg_values|, when used, are always deep copied with the _COPY +// macros. +// +// +// Thread Safety: +// All macros are thread safe and can be used from any process. +/// + +#ifndef CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ +#define CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ +#pragma once + +#if defined(TRACE_EVENT0) +// Do nothing if the macros provided by this header already exist. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/debug/trace_event.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/internal/cef_trace_event_internal.h" + +// Records a pair of begin and end events called "name" for the current +// scope, with 0, 1 or 2 associated arguments. If the category is not +// enabled, then this does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT0(category, name) \ + cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false); \ + CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) +#define TRACE_EVENT1(category, name, arg1_name, arg1_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false); \ + CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) +#define TRACE_EVENT2(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val, false); \ + CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) + +// Implementation detail: trace event macros create temporary variable names. +// These macros give each temporary variable a unique name based on the line +// number to prevent name collisions. +#define CEF_INTERNAL_TRACE_EVENT_UID3(a,b) \ + cef_trace_event_unique_##a##b +#define CEF_INTERNAL_TRACE_EVENT_UID2(a,b) \ + CEF_INTERNAL_TRACE_EVENT_UID3(a,b) +#define CEF_INTERNAL_TRACE_EVENT_UID(name_prefix) \ + CEF_INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) + +// Implementation detail: internal macro to end end event when the scope ends. +#define CEF_INTERNAL_TRACE_END_ON_SCOPE_CLOSE(category, name) \ + cef_trace_event::CefTraceEndOnScopeClose \ + CEF_INTERNAL_TRACE_EVENT_UID(profileScope)(category, name) + +// Records a single event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_INSTANT0(category, name) \ + cef_trace_event_instant(category, name, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_INSTANT1(category, name, arg1_name, arg1_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, false) +#define TRACE_EVENT_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) +#define TRACE_EVENT_COPY_INSTANT0(category, name) \ + cef_trace_event_instant(category, name, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_INSTANT1(category, name, arg1_name, arg1_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, NULL, 0, true) +#define TRACE_EVENT_COPY_INSTANT2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_instant(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, true) + +// Records a single BEGIN event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_BEGIN0(category, name) \ + cef_trace_event_begin(category, name, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_BEGIN1(category, name, arg1_name, arg1_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, false) +#define TRACE_EVENT_BEGIN2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) +#define TRACE_EVENT_COPY_BEGIN0(category, name) \ + cef_trace_event_begin(category, name, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_BEGIN1(category, name, arg1_name, arg1_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, NULL, 0, true) +#define TRACE_EVENT_COPY_BEGIN2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_begin(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, true) + +// Records a single END event for "name" immediately. If the category +// is not enabled, then this does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_EVENT_END0(category, name) \ + cef_trace_event_end(category, name, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_END1(category, name, arg1_name, arg1_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, false) +#define TRACE_EVENT_END2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, false) +#define TRACE_EVENT_COPY_END0(category, name) \ + cef_trace_event_end(category, name, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_END1(category, name, arg1_name, arg1_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, NULL, 0, true) +#define TRACE_EVENT_COPY_END2(category, name, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_end(category, name, arg1_name, arg1_val, arg2_name, \ + arg2_val, true) + +// Records the value of a counter called "name" immediately. Value +// must be representable as a 32 bit integer. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_COUNTER1(category, name, value) \ + cef_trace_counter(category, name, NULL, value, NULL, 0, false) +#define TRACE_COPY_COUNTER1(category, name, value) \ + cef_trace_counter(category, name, NULL, value, NULL, 0, true) + +// Records the values of a multi-parted counter called "name" immediately. +// The UI will treat value1 and value2 as parts of a whole, displaying their +// values as a stacked-bar chart. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +#define TRACE_COUNTER2(category, name, value1_name, value1_val, \ + value2_name, value2_val) \ + cef_trace_counter(category, name, value1_name, value1_val, value2_name, \ + value2_val, false) +#define TRACE_COPY_COUNTER2(category, name, value1_name, value1_val, \ + value2_name, value2_val) \ + cef_trace_counter(category, name, value1_name, value1_val, value2_name, \ + value2_val, true) + +// Records the value of a counter called "name" immediately. Value +// must be representable as a 32 bit integer. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to disambiguate counters with the same name. It must either +// be a pointer or an integer value up to 64 bits. If it's a pointer, the +// bits will be xored with a hash of the process ID so that the same pointer +// on two different processes will not collide. +#define TRACE_COUNTER_ID1(category, name, id, value) \ + cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, false) +#define TRACE_COPY_COUNTER_ID1(category, name, id, value) \ + cef_trace_counter_id(category, name, id, NULL, value, NULL, 0, true) + +// Records the values of a multi-parted counter called "name" immediately. +// The UI will treat value1 and value2 as parts of a whole, displaying their +// values as a stacked-bar chart. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to disambiguate counters with the same name. It must either +// be a pointer or an integer value up to 64 bits. If it's a pointer, the +// bits will be xored with a hash of the process ID so that the same pointer +// on two different processes will not collide. +#define TRACE_COUNTER_ID2(category, name, id, value1_name, value1_val, \ + value2_name, value2_val) \ + cef_trace_counter_id(category, name, id, value1_name, value1_val, \ + value2_name, value2_val, false) +#define TRACE_COPY_COUNTER_ID2(category, name, id, value1_name, \ + value1_val, value2_name, value2_val) \ + cef_trace_counter_id(category, name, id, value1_name, value1_val, \ + value2_name, value2_val, true) + + +// Records a single ASYNC_BEGIN event called "name" immediately, with 0, 1 or 2 +// associated arguments. If the category is not enabled, then this +// does nothing. +// - category and name strings must have application lifetime (statics or +// literals). They may not include " chars. +// - |id| is used to match the ASYNC_BEGIN event with the ASYNC_END event. +// ASYNC events are considered to match if their category, name and id values +// all match. |id| must either be a pointer or an integer value up to 64 +// bits. If it's a pointer, the bits will be xored with a hash of the process +// ID sothat the same pointer on two different processes will not collide. +// An asynchronous operation can consist of multiple phases. The first phase is +// defined by the ASYNC_BEGIN calls. Additional phases can be defined using the +// ASYNC_STEP_BEGIN macros. When the operation completes, call ASYNC_END. +// An async operation can span threads and processes, but all events in that +// operation must use the same |name| and |id|. Each event can have its own +// args. +#define TRACE_EVENT_ASYNC_BEGIN0(category, name, id) \ + cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_ASYNC_BEGIN1(category, name, id, arg1_name, arg1_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \ + 0, false) +#define TRACE_EVENT_ASYNC_BEGIN2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, false) +#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category, name, id) \ + cef_trace_event_async_begin(category, name, id, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category, name, id, arg1_name, \ + arg1_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, NULL, \ + 0, true) +#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category, name, id, arg1_name, \ + arg1_val, arg2_name, arg2_val) \ + cef_trace_event_async_begin(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, true) + +// Records a single ASYNC_STEP_INTO event for |step| immediately. If the +// category is not enabled, then this does nothing. The |name| and |id| must +// match the ASYNC_BEGIN event above. The |step| param identifies this step +// within the async event. This should be called at the beginning of the next +// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any +// ASYNC_STEP_PAST events. +#define TRACE_EVENT_ASYNC_STEP_INTO0(category, name, id, step) \ + cef_trace_event_async_step_into(category, name, id, step, NULL, 0, false) +#define TRACE_EVENT_ASYNC_STEP_INTO1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, false) +#define TRACE_EVENT_COPY_ASYNC_STEP_INTO0(category, name, id, step) \ + cef_trace_event_async_step_into(category, name, id, step, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_STEP_INTO1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_into(category, name, id, step, arg1_name, \ + arg1_val, true) + +// Records a single ASYNC_STEP_PAST event for |step| immediately. If the +// category is not enabled, then this does nothing. The |name| and |id| must +// match the ASYNC_BEGIN event above. The |step| param identifies this step +// within the async event. This should be called at the beginning of the next +// phase of an asynchronous operation. The ASYNC_BEGIN event must not have any +// ASYNC_STEP_INTO events. +#define TRACE_EVENT_ASYNC_STEP_PAST0(category, name, id, step) \ + cef_trace_event_async_step_past(category, name, id, step, NULL, 0, false) +#define TRACE_EVENT_ASYNC_STEP_PAST1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, false) +#define TRACE_EVENT_COPY_ASYNC_STEP_PAST0(category, name, id, step) \ + cef_trace_event_async_step_past(category, name, id, step, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_STEP_PAST1(category, name, id, step, \ + arg1_name, arg1_val) \ + cef_trace_event_async_step_past(category, name, id, step, arg1_name, \ + arg1_val, true) + +// Records a single ASYNC_END event for "name" immediately. If the category +// is not enabled, then this does nothing. +#define TRACE_EVENT_ASYNC_END0(category, name, id) \ + cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, false) +#define TRACE_EVENT_ASYNC_END1(category, name, id, arg1_name, arg1_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \ + false) +#define TRACE_EVENT_ASYNC_END2(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, false) +#define TRACE_EVENT_COPY_ASYNC_END0(category, name, id) \ + cef_trace_event_async_end(category, name, id, NULL, 0, NULL, 0, true) +#define TRACE_EVENT_COPY_ASYNC_END1(category, name, id, arg1_name, \ + arg1_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, NULL, 0, \ + true) +#define TRACE_EVENT_COPY_ASYNC_END2(category, name, id, arg1_name, \ + arg1_val, arg2_name, arg2_val) \ + cef_trace_event_async_end(category, name, id, arg1_name, arg1_val, \ + arg2_name, arg2_val, true) + +namespace cef_trace_event { + +// Used by TRACE_EVENTx macro. Do not use directly. +class CefTraceEndOnScopeClose { + public: + CefTraceEndOnScopeClose(const char* category, const char* name) + : category_(category), name_(name) { + } + ~CefTraceEndOnScopeClose() { + cef_trace_event_end(category_, name_, NULL, 0, NULL, 0, false); + } + + private: + const char* category_; + const char* name_; +}; + +} // cef_trace_event + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_TRACE_EVENT_H_ diff --git a/vendor/cef3/include/base/cef_tuple.h b/vendor/cef3/include/base/cef_tuple.h new file mode 100644 index 00000000000..b33eae9b0b4 --- /dev/null +++ b/vendor/cef3/include/base/cef_tuple.h @@ -0,0 +1,1333 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2011 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// A Tuple is a generic templatized container, similar in concept to std::pair. +// There are classes Tuple0 to Tuple6, cooresponding to the number of elements +// it contains. The convenient MakeTuple() function takes 0 to 6 arguments, +// and will construct and return the appropriate Tuple object. The functions +// DispatchToMethod and DispatchToFunction take a function pointer or instance +// and method pointer, and unpack a tuple into arguments to the call. +// +// Tuple elements are copied by value, and stored in the tuple. See the unit +// tests for more details of how/when the values are copied. +// +// Example usage: +// // These two methods of creating a Tuple are identical. +// Tuple2 tuple_a(1, "wee"); +// Tuple2 tuple_b = MakeTuple(1, "wee"); +// +// void SomeFunc(int a, const char* b) { } +// DispatchToFunction(&SomeFunc, tuple_a); // SomeFunc(1, "wee") +// DispatchToFunction( +// &SomeFunc, MakeTuple(10, "foo")); // SomeFunc(10, "foo") +// +// struct { void SomeMeth(int a, int b, int c) { } } foo; +// DispatchToMethod(&foo, &Foo::SomeMeth, MakeTuple(1, 2, 3)); +// // foo->SomeMeth(1, 2, 3); + +#ifndef CEF_INCLUDE_BASE_CEF_TUPLE_H_ +#define CEF_INCLUDE_BASE_CEF_TUPLE_H_ +#pragma once + +#if defined(BASE_TUPLE_H__) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/tuple.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_bind_helpers.h" + +// Traits ---------------------------------------------------------------------- +// +// A simple traits class for tuple arguments. +// +// ValueType: the bare, nonref version of a type (same as the type for nonrefs). +// RefType: the ref version of a type (same as the type for refs). +// ParamType: what type to pass to functions (refs should not be constified). + +template +struct TupleTraits { + typedef P ValueType; + typedef P& RefType; + typedef const P& ParamType; +}; + +template +struct TupleTraits { + typedef P ValueType; + typedef P& RefType; + typedef P& ParamType; +}; + +template +struct TupleTypes { }; + +// Tuple ----------------------------------------------------------------------- +// +// This set of classes is useful for bundling 0 or more heterogeneous data types +// into a single variable. The advantage of this is that it greatly simplifies +// function objects that need to take an arbitrary number of parameters; see +// RunnableMethod and IPC::MessageWithTuple. +// +// Tuple0 is supplied to act as a 'void' type. It can be used, for example, +// when dispatching to a function that accepts no arguments (see the +// Dispatchers below). +// Tuple1 is rarely useful. One such use is when A is non-const ref that you +// want filled by the dispatchee, and the tuple is merely a container for that +// output (a "tier"). See MakeRefTuple and its usages. + +struct Tuple0 { + typedef Tuple0 ValueTuple; + typedef Tuple0 RefTuple; + typedef Tuple0 ParamTuple; +}; + +template +struct Tuple1 { + public: + typedef A TypeA; + + Tuple1() {} + explicit Tuple1(typename TupleTraits::ParamType a) : a(a) {} + + A a; +}; + +template +struct Tuple2 { + public: + typedef A TypeA; + typedef B TypeB; + + Tuple2() {} + Tuple2(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b) + : a(a), b(b) { + } + + A a; + B b; +}; + +template +struct Tuple3 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + + Tuple3() {} + Tuple3(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c) + : a(a), b(b), c(c){ + } + + A a; + B b; + C c; +}; + +template +struct Tuple4 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + + Tuple4() {} + Tuple4(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d) + : a(a), b(b), c(c), d(d) { + } + + A a; + B b; + C c; + D d; +}; + +template +struct Tuple5 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + + Tuple5() {} + Tuple5(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e) + : a(a), b(b), c(c), d(d), e(e) { + } + + A a; + B b; + C c; + D d; + E e; +}; + +template +struct Tuple6 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + typedef F TypeF; + + Tuple6() {} + Tuple6(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f) + : a(a), b(b), c(c), d(d), e(e), f(f) { + } + + A a; + B b; + C c; + D d; + E e; + F f; +}; + +template +struct Tuple7 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + typedef F TypeF; + typedef G TypeG; + + Tuple7() {} + Tuple7(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f, + typename TupleTraits::ParamType g) + : a(a), b(b), c(c), d(d), e(e), f(f), g(g) { + } + + A a; + B b; + C c; + D d; + E e; + F f; + G g; +}; + +template +struct Tuple8 { + public: + typedef A TypeA; + typedef B TypeB; + typedef C TypeC; + typedef D TypeD; + typedef E TypeE; + typedef F TypeF; + typedef G TypeG; + typedef H TypeH; + + Tuple8() {} + Tuple8(typename TupleTraits::ParamType a, + typename TupleTraits::ParamType b, + typename TupleTraits::ParamType c, + typename TupleTraits::ParamType d, + typename TupleTraits::ParamType e, + typename TupleTraits::ParamType f, + typename TupleTraits::ParamType g, + typename TupleTraits::ParamType h) + : a(a), b(b), c(c), d(d), e(e), f(f), g(g), h(h) { + } + + A a; + B b; + C c; + D d; + E e; + F f; + G g; + H h; +}; + +// Tuple types ---------------------------------------------------------------- +// +// Allows for selection of ValueTuple/RefTuple/ParamTuple without needing the +// definitions of class types the tuple takes as parameters. + +template <> +struct TupleTypes< Tuple0 > { + typedef Tuple0 ValueTuple; + typedef Tuple0 RefTuple; + typedef Tuple0 ParamTuple; +}; + +template +struct TupleTypes< Tuple1 > { + typedef Tuple1::ValueType> ValueTuple; + typedef Tuple1::RefType> RefTuple; + typedef Tuple1::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple2 > { + typedef Tuple2::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple2::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple2::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple3 > { + typedef Tuple3::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple3::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple3::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple4 > { + typedef Tuple4::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple4::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple4::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple5 > { + typedef Tuple5::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple5::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple5::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple6 > { + typedef Tuple6::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple6::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple6::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple7 > { + typedef Tuple7::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple7::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple7::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +template +struct TupleTypes< Tuple8 > { + typedef Tuple8::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType, + typename TupleTraits::ValueType> ValueTuple; +typedef Tuple8::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType, + typename TupleTraits::RefType> RefTuple; + typedef Tuple8::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType, + typename TupleTraits::ParamType> ParamTuple; +}; + +// Tuple creators ------------------------------------------------------------- +// +// Helper functions for constructing tuples while inferring the template +// argument types. + +inline Tuple0 MakeTuple() { + return Tuple0(); +} + +template +inline Tuple1 MakeTuple(const A& a) { + return Tuple1(a); +} + +template +inline Tuple2 MakeTuple(const A& a, const B& b) { + return Tuple2(a, b); +} + +template +inline Tuple3 MakeTuple(const A& a, const B& b, const C& c) { + return Tuple3(a, b, c); +} + +template +inline Tuple4 MakeTuple(const A& a, const B& b, const C& c, + const D& d) { + return Tuple4(a, b, c, d); +} + +template +inline Tuple5 MakeTuple(const A& a, const B& b, const C& c, + const D& d, const E& e) { + return Tuple5(a, b, c, d, e); +} + +template +inline Tuple6 MakeTuple(const A& a, const B& b, const C& c, + const D& d, const E& e, const F& f) { + return Tuple6(a, b, c, d, e, f); +} + +template +inline Tuple7 MakeTuple(const A& a, const B& b, const C& c, + const D& d, const E& e, const F& f, + const G& g) { + return Tuple7(a, b, c, d, e, f, g); +} + +template +inline Tuple8 MakeTuple(const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g, const H& h) { + return Tuple8(a, b, c, d, e, f, g, h); +} + +// The following set of helpers make what Boost refers to as "Tiers" - a tuple +// of references. + +template +inline Tuple1 MakeRefTuple(A& a) { + return Tuple1(a); +} + +template +inline Tuple2 MakeRefTuple(A& a, B& b) { + return Tuple2(a, b); +} + +template +inline Tuple3 MakeRefTuple(A& a, B& b, C& c) { + return Tuple3(a, b, c); +} + +template +inline Tuple4 MakeRefTuple(A& a, B& b, C& c, D& d) { + return Tuple4(a, b, c, d); +} + +template +inline Tuple5 MakeRefTuple(A& a, B& b, C& c, D& d, E& e) { + return Tuple5(a, b, c, d, e); +} + +template +inline Tuple6 MakeRefTuple(A& a, B& b, C& c, D& d, E& e, + F& f) { + return Tuple6(a, b, c, d, e, f); +} + +template +inline Tuple7 MakeRefTuple(A& a, B& b, C& c, D& d, + E& e, F& f, G& g) { + return Tuple7(a, b, c, d, e, f, g); +} + +template +inline Tuple8 MakeRefTuple(A& a, B& b, C& c, + D& d, E& e, F& f, + G& g, H& h) { + return Tuple8(a, b, c, d, e, f, g, h); +} + +// Dispatchers ---------------------------------------------------------------- +// +// Helper functions that call the given method on an object, with the unpacked +// tuple arguments. Notice that they all have the same number of arguments, +// so you need only write: +// DispatchToMethod(object, &Object::method, args); +// This is very useful for templated dispatchers, since they don't need to know +// what type |args| is. + +// Non-Static Dispatchers with no out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, const Tuple0& arg) { + (obj->*method)(); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, const A& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, const Tuple1& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a)); +} + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple2& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e), + base::internal::UnwrapTraits::Unwrap(arg.f)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple7& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e), + base::internal::UnwrapTraits::Unwrap(arg.f), + base::internal::UnwrapTraits::Unwrap(arg.g)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple8& arg) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e), + base::internal::UnwrapTraits::Unwrap(arg.f), + base::internal::UnwrapTraits::Unwrap(arg.g), + base::internal::UnwrapTraits::Unwrap(arg.h)); +} + +// Static Dispatchers with no out params. + +template +inline void DispatchToFunction(Function function, const Tuple0& arg) { + (*function)(); +} + +template +inline void DispatchToFunction(Function function, const A& arg) { + (*function)(arg); +} + +template +inline void DispatchToFunction(Function function, const Tuple1& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a)); +} + +template +inline void DispatchToFunction(Function function, const Tuple2& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b)); +} + +template +inline void DispatchToFunction(Function function, const Tuple3& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple4& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple5& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple6& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e), + base::internal::UnwrapTraits::Unwrap(arg.f)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple7& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e), + base::internal::UnwrapTraits::Unwrap(arg.f), + base::internal::UnwrapTraits::Unwrap(arg.g)); +} + +template +inline void DispatchToFunction(Function function, + const Tuple8& arg) { + (*function)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e), + base::internal::UnwrapTraits::Unwrap(arg.f), + base::internal::UnwrapTraits::Unwrap(arg.g), + base::internal::UnwrapTraits::Unwrap(arg.h)); +} + +// Dispatchers with 0 out param (as a Tuple0). + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple0& arg, Tuple0*) { + (obj->*method)(); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, const A& arg, Tuple0*) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg)); +} + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple1& arg, Tuple0*) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a)); +} + +template +inline void DispatchToMethod(ObjT* obj, + Method method, + const Tuple2& arg, Tuple0*) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& arg, Tuple0*) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& arg, Tuple0*) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& arg, Tuple0*) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e)); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& arg, Tuple0*) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(arg.a), + base::internal::UnwrapTraits::Unwrap(arg.b), + base::internal::UnwrapTraits::Unwrap(arg.c), + base::internal::UnwrapTraits::Unwrap(arg.d), + base::internal::UnwrapTraits::Unwrap(arg.e), + base::internal::UnwrapTraits::Unwrap(arg.f)); +} + +// Dispatchers with 1 out param. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple1* out) { + (obj->*method)(&out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple1* out) { + (obj->*method)(in, &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple1* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple1* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple1* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple1* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple1* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + &out->a); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple1* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + base::internal::UnwrapTraits::Unwrap(in.f), + &out->a); +} + +// Dispatchers with 2 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple2* out) { + (obj->*method)(&out->a, &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple2* out) { + (obj->*method)(in, &out->a, &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple2* out) { + (obj->*method)( + base::internal::UnwrapTraits::Unwrap(in.a), &out->a, &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple2* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple2* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple2* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple2* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple2* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + base::internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b); +} + +// Dispatchers with 3 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple3* out) { + (obj->*method)(&out->a, &out->b, &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple3* out) { + (obj->*method)(in, &out->a, &out->b, &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple3* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple3* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple3* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple3* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple3* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b, + &out->c); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple3* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + base::internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b, + &out->c); +} + +// Dispatchers with 4 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple4* out) { + (obj->*method)(&out->a, &out->b, &out->c, &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple4* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple4* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple4* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple4* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple4* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple4* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b, + &out->c, + &out->d); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple4* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + base::internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b, + &out->c, + &out->d); +} + +// Dispatchers with 5 out params. + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple0& in, + Tuple5* out) { + (obj->*method)(&out->a, &out->b, &out->c, &out->d, &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const InA& in, + Tuple5* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple1& in, + Tuple5* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple2& in, + Tuple5* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple3& in, + Tuple5* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple4& in, + Tuple5* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple5& in, + Tuple5* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +template +inline void DispatchToMethod(ObjT* obj, Method method, + const Tuple6& in, + Tuple5* out) { + (obj->*method)(base::internal::UnwrapTraits::Unwrap(in.a), + base::internal::UnwrapTraits::Unwrap(in.b), + base::internal::UnwrapTraits::Unwrap(in.c), + base::internal::UnwrapTraits::Unwrap(in.d), + base::internal::UnwrapTraits::Unwrap(in.e), + base::internal::UnwrapTraits::Unwrap(in.f), + &out->a, + &out->b, + &out->c, + &out->d, + &out->e); +} + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_TUPLE_H_ diff --git a/vendor/cef3/include/base/cef_weak_ptr.h b/vendor/cef3/include/base/cef_weak_ptr.h new file mode 100644 index 00000000000..6d8e2dbe784 --- /dev/null +++ b/vendor/cef3/include/base/cef_weak_ptr.h @@ -0,0 +1,382 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. Portions copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Weak pointers are pointers to an object that do not affect its lifetime, +// and which may be invalidated (i.e. reset to NULL) by the object, or its +// owner, at any time, most commonly when the object is about to be deleted. + +// Weak pointers are useful when an object needs to be accessed safely by one +// or more objects other than its owner, and those callers can cope with the +// object vanishing and e.g. tasks posted to it being silently dropped. +// Reference-counting such an object would complicate the ownership graph and +// make it harder to reason about the object's lifetime. + +// EXAMPLE: +// +// class Controller { +// public: +// void SpawnWorker() { Worker::StartNew(weak_factory_.GetWeakPtr()); } +// void WorkComplete(const Result& result) { ... } +// private: +// // Member variables should appear before the WeakPtrFactory, to ensure +// // that any WeakPtrs to Controller are invalidated before its members +// // variable's destructors are executed, rendering them invalid. +// WeakPtrFactory weak_factory_; +// }; +// +// class Worker { +// public: +// static void StartNew(const WeakPtr& controller) { +// Worker* worker = new Worker(controller); +// // Kick off asynchronous processing... +// } +// private: +// Worker(const WeakPtr& controller) +// : controller_(controller) {} +// void DidCompleteAsynchronousProcessing(const Result& result) { +// if (controller_) +// controller_->WorkComplete(result); +// } +// WeakPtr controller_; +// }; +// +// With this implementation a caller may use SpawnWorker() to dispatch multiple +// Workers and subsequently delete the Controller, without waiting for all +// Workers to have completed. + +// ------------------------- IMPORTANT: Thread-safety ------------------------- + +// Weak pointers may be passed safely between threads, but must always be +// dereferenced and invalidated on the same thread otherwise checking the +// pointer would be racey. +// +// To ensure correct use, the first time a WeakPtr issued by a WeakPtrFactory +// is dereferenced, the factory and its WeakPtrs become bound to the calling +// thread, and cannot be dereferenced or invalidated on any other thread. Bound +// WeakPtrs can still be handed off to other threads, e.g. to use to post tasks +// back to object on the bound thread. +// +// Invalidating the factory's WeakPtrs un-binds it from the thread, allowing it +// to be passed for a different thread to use or delete it. + +#ifndef CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ +#define CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ +#pragma once + +#if defined(BASE_MEMORY_WEAK_PTR_H_) +// Do nothing if the Chromium header has already been included. +// This can happen in cases where Chromium code is used directly by the +// client application. When using Chromium code directly always include +// the Chromium header first to avoid type conflicts. +#elif defined(BUILDING_CEF_SHARED) +// When building CEF include the Chromium header directly. +#include "base/memory/weak_ptr.h" +#else // !BUILDING_CEF_SHARED +// The following is substantially similar to the Chromium implementation. +// If the Chromium implementation diverges the below implementation should be +// updated to match. + +#include "include/base/cef_basictypes.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_ref_counted.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_thread_checker.h" + +namespace base { + +template class SupportsWeakPtr; +template class WeakPtr; + +namespace internal { +// These classes are part of the WeakPtr implementation. +// DO NOT USE THESE CLASSES DIRECTLY YOURSELF. + +class WeakReference { + public: + // Although Flag is bound to a specific thread, it may be deleted from another + // via base::WeakPtr::~WeakPtr(). + class Flag : public RefCountedThreadSafe { + public: + Flag(); + + void Invalidate(); + bool IsValid() const; + + private: + friend class base::RefCountedThreadSafe; + + ~Flag(); + + // The current Chromium implementation uses SequenceChecker instead of + // ThreadChecker to support SequencedWorkerPools. CEF does not yet expose + // the concept of SequencedWorkerPools. + ThreadChecker thread_checker_; + bool is_valid_; + }; + + WeakReference(); + explicit WeakReference(const Flag* flag); + ~WeakReference(); + + bool is_valid() const; + + private: + scoped_refptr flag_; +}; + +class WeakReferenceOwner { + public: + WeakReferenceOwner(); + ~WeakReferenceOwner(); + + WeakReference GetRef() const; + + bool HasRefs() const { + return flag_.get() && !flag_->HasOneRef(); + } + + void Invalidate(); + + private: + mutable scoped_refptr flag_; +}; + +// This class simplifies the implementation of WeakPtr's type conversion +// constructor by avoiding the need for a public accessor for ref_. A +// WeakPtr cannot access the private members of WeakPtr, so this +// base class gives us a way to access ref_ in a protected fashion. +class WeakPtrBase { + public: + WeakPtrBase(); + ~WeakPtrBase(); + + protected: + explicit WeakPtrBase(const WeakReference& ref); + + WeakReference ref_; +}; + +// This class provides a common implementation of common functions that would +// otherwise get instantiated separately for each distinct instantiation of +// SupportsWeakPtr<>. +class SupportsWeakPtrBase { + public: + // A safe static downcast of a WeakPtr to WeakPtr. This + // conversion will only compile if there is exists a Base which inherits + // from SupportsWeakPtr. See base::AsWeakPtr() below for a helper + // function that makes calling this easier. + template + static WeakPtr StaticAsWeakPtr(Derived* t) { + typedef + is_convertible convertible; + COMPILE_ASSERT(convertible::value, + AsWeakPtr_argument_inherits_from_SupportsWeakPtr); + return AsWeakPtrImpl(t, *t); + } + + private: + // This template function uses type inference to find a Base of Derived + // which is an instance of SupportsWeakPtr. We can then safely + // static_cast the Base* to a Derived*. + template + static WeakPtr AsWeakPtrImpl( + Derived* t, const SupportsWeakPtr&) { + WeakPtr ptr = t->Base::AsWeakPtr(); + return WeakPtr(ptr.ref_, static_cast(ptr.ptr_)); + } +}; + +} // namespace internal + +template class WeakPtrFactory; + +// The WeakPtr class holds a weak reference to |T*|. +// +// This class is designed to be used like a normal pointer. You should always +// null-test an object of this class before using it or invoking a method that +// may result in the underlying object being destroyed. +// +// EXAMPLE: +// +// class Foo { ... }; +// WeakPtr foo; +// if (foo) +// foo->method(); +// +template +class WeakPtr : public internal::WeakPtrBase { + public: + WeakPtr() : ptr_(NULL) { + } + + // Allow conversion from U to T provided U "is a" T. Note that this + // is separate from the (implicit) copy constructor. + template + WeakPtr(const WeakPtr& other) : WeakPtrBase(other), ptr_(other.ptr_) { + } + + T* get() const { return ref_.is_valid() ? ptr_ : NULL; } + + T& operator*() const { + DCHECK(get() != NULL); + return *get(); + } + T* operator->() const { + DCHECK(get() != NULL); + return get(); + } + + // Allow WeakPtr to be used in boolean expressions, but not + // implicitly convertible to a real bool (which is dangerous). + // + // Note that this trick is only safe when the == and != operators + // are declared explicitly, as otherwise "weak_ptr1 == weak_ptr2" + // will compile but do the wrong thing (i.e., convert to Testable + // and then do the comparison). + private: + typedef T* WeakPtr::*Testable; + + public: + operator Testable() const { return get() ? &WeakPtr::ptr_ : NULL; } + + void reset() { + ref_ = internal::WeakReference(); + ptr_ = NULL; + } + + private: + // Explicitly declare comparison operators as required by the bool + // trick, but keep them private. + template bool operator==(WeakPtr const&) const; + template bool operator!=(WeakPtr const&) const; + + friend class internal::SupportsWeakPtrBase; + template friend class WeakPtr; + friend class SupportsWeakPtr; + friend class WeakPtrFactory; + + WeakPtr(const internal::WeakReference& ref, T* ptr) + : WeakPtrBase(ref), + ptr_(ptr) { + } + + // This pointer is only valid when ref_.is_valid() is true. Otherwise, its + // value is undefined (as opposed to NULL). + T* ptr_; +}; + +// A class may be composed of a WeakPtrFactory and thereby +// control how it exposes weak pointers to itself. This is helpful if you only +// need weak pointers within the implementation of a class. This class is also +// useful when working with primitive types. For example, you could have a +// WeakPtrFactory that is used to pass around a weak reference to a bool. +template +class WeakPtrFactory { + public: + explicit WeakPtrFactory(T* ptr) : ptr_(ptr) { + } + + ~WeakPtrFactory() { + ptr_ = NULL; + } + + WeakPtr GetWeakPtr() { + DCHECK(ptr_); + return WeakPtr(weak_reference_owner_.GetRef(), ptr_); + } + + // Call this method to invalidate all existing weak pointers. + void InvalidateWeakPtrs() { + DCHECK(ptr_); + weak_reference_owner_.Invalidate(); + } + + // Call this method to determine if any weak pointers exist. + bool HasWeakPtrs() const { + DCHECK(ptr_); + return weak_reference_owner_.HasRefs(); + } + + private: + internal::WeakReferenceOwner weak_reference_owner_; + T* ptr_; + DISALLOW_IMPLICIT_CONSTRUCTORS(WeakPtrFactory); +}; + +// A class may extend from SupportsWeakPtr to let others take weak pointers to +// it. This avoids the class itself implementing boilerplate to dispense weak +// pointers. However, since SupportsWeakPtr's destructor won't invalidate +// weak pointers to the class until after the derived class' members have been +// destroyed, its use can lead to subtle use-after-destroy issues. +template +class SupportsWeakPtr : public internal::SupportsWeakPtrBase { + public: + SupportsWeakPtr() {} + + WeakPtr AsWeakPtr() { + return WeakPtr(weak_reference_owner_.GetRef(), static_cast(this)); + } + + protected: + ~SupportsWeakPtr() {} + + private: + internal::WeakReferenceOwner weak_reference_owner_; + DISALLOW_COPY_AND_ASSIGN(SupportsWeakPtr); +}; + +// Helper function that uses type deduction to safely return a WeakPtr +// when Derived doesn't directly extend SupportsWeakPtr, instead it +// extends a Base that extends SupportsWeakPtr. +// +// EXAMPLE: +// class Base : public base::SupportsWeakPtr {}; +// class Derived : public Base {}; +// +// Derived derived; +// base::WeakPtr ptr = base::AsWeakPtr(&derived); +// +// Note that the following doesn't work (invalid type conversion) since +// Derived::AsWeakPtr() is WeakPtr SupportsWeakPtr::AsWeakPtr(), +// and there's no way to safely cast WeakPtr to WeakPtr at +// the caller. +// +// base::WeakPtr ptr = derived.AsWeakPtr(); // Fails. + +template +WeakPtr AsWeakPtr(Derived* t) { + return internal::SupportsWeakPtrBase::StaticAsWeakPtr(t); +} + +} // namespace base + +#endif // !BUILDING_CEF_SHARED + +#endif // CEF_INCLUDE_BASE_CEF_WEAK_PTR_H_ diff --git a/vendor/cef3/include/base/internal/cef_atomicops_x86_msvc.h b/vendor/cef3/include/base/internal/cef_atomicops_x86_msvc.h new file mode 100644 index 00000000000..12bb0f468b9 --- /dev/null +++ b/vendor/cef3/include/base/internal/cef_atomicops_x86_msvc.h @@ -0,0 +1,224 @@ +// Copyright (c) 2008 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_atomicops.h +// instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_X86_MSVC_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_X86_MSVC_H_ + +#include + +#include + +#include "include/base/cef_macros.h" + +#if defined(ARCH_CPU_64_BITS) +// windows.h #defines this (only on x64). This causes problems because the +// public API also uses MemoryBarrier at the public name for this fence. So, on +// X64, undef it, and call its documented +// (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684208.aspx) +// implementation directly. +#undef MemoryBarrier +#endif + +namespace base { +namespace subtle { + +inline Atomic32 NoBarrier_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value) { + LONG result = _InterlockedCompareExchange( + reinterpret_cast(ptr), + static_cast(new_value), + static_cast(old_value)); + return static_cast(result); +} + +inline Atomic32 NoBarrier_AtomicExchange(volatile Atomic32* ptr, + Atomic32 new_value) { + LONG result = _InterlockedExchange( + reinterpret_cast(ptr), + static_cast(new_value)); + return static_cast(result); +} + +inline Atomic32 Barrier_AtomicIncrement(volatile Atomic32* ptr, + Atomic32 increment) { + return _InterlockedExchangeAdd( + reinterpret_cast(ptr), + static_cast(increment)) + increment; +} + +inline Atomic32 NoBarrier_AtomicIncrement(volatile Atomic32* ptr, + Atomic32 increment) { + return Barrier_AtomicIncrement(ptr, increment); +} + +#if !(defined(_MSC_VER) && _MSC_VER >= 1400) +#error "We require at least vs2005 for MemoryBarrier" +#endif +inline void MemoryBarrier() { +#if defined(ARCH_CPU_64_BITS) + // See #undef and note at the top of this file. + __faststorefence(); +#else + // We use MemoryBarrier from WinNT.h + ::MemoryBarrier(); +#endif +} + +inline Atomic32 Acquire_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + +inline Atomic32 Release_CompareAndSwap(volatile Atomic32* ptr, + Atomic32 old_value, + Atomic32 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + +inline void NoBarrier_Store(volatile Atomic32* ptr, Atomic32 value) { + *ptr = value; +} + +inline void Acquire_Store(volatile Atomic32* ptr, Atomic32 value) { + NoBarrier_AtomicExchange(ptr, value); + // acts as a barrier in this implementation +} + +inline void Release_Store(volatile Atomic32* ptr, Atomic32 value) { + *ptr = value; // works w/o barrier for current Intel chips as of June 2005 + // See comments in Atomic64 version of Release_Store() below. +} + +inline Atomic32 NoBarrier_Load(volatile const Atomic32* ptr) { + return *ptr; +} + +inline Atomic32 Acquire_Load(volatile const Atomic32* ptr) { + Atomic32 value = *ptr; + return value; +} + +inline Atomic32 Release_Load(volatile const Atomic32* ptr) { + MemoryBarrier(); + return *ptr; +} + +#if defined(_WIN64) + +// 64-bit low-level operations on 64-bit platform. + +COMPILE_ASSERT(sizeof(Atomic64) == sizeof(PVOID), atomic_word_is_atomic); + +inline Atomic64 NoBarrier_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + PVOID result = InterlockedCompareExchangePointer( + reinterpret_cast(ptr), + reinterpret_cast(new_value), reinterpret_cast(old_value)); + return reinterpret_cast(result); +} + +inline Atomic64 NoBarrier_AtomicExchange(volatile Atomic64* ptr, + Atomic64 new_value) { + PVOID result = InterlockedExchangePointer( + reinterpret_cast(ptr), + reinterpret_cast(new_value)); + return reinterpret_cast(result); +} + +inline Atomic64 Barrier_AtomicIncrement(volatile Atomic64* ptr, + Atomic64 increment) { + return InterlockedExchangeAdd64( + reinterpret_cast(ptr), + static_cast(increment)) + increment; +} + +inline Atomic64 NoBarrier_AtomicIncrement(volatile Atomic64* ptr, + Atomic64 increment) { + return Barrier_AtomicIncrement(ptr, increment); +} + +inline void NoBarrier_Store(volatile Atomic64* ptr, Atomic64 value) { + *ptr = value; +} + +inline void Acquire_Store(volatile Atomic64* ptr, Atomic64 value) { + NoBarrier_AtomicExchange(ptr, value); + // acts as a barrier in this implementation +} + +inline void Release_Store(volatile Atomic64* ptr, Atomic64 value) { + *ptr = value; // works w/o barrier for current Intel chips as of June 2005 + + // When new chips come out, check: + // IA-32 Intel Architecture Software Developer's Manual, Volume 3: + // System Programming Guide, Chatper 7: Multiple-processor management, + // Section 7.2, Memory Ordering. + // Last seen at: + // http://developer.intel.com/design/pentium4/manuals/index_new.htm +} + +inline Atomic64 NoBarrier_Load(volatile const Atomic64* ptr) { + return *ptr; +} + +inline Atomic64 Acquire_Load(volatile const Atomic64* ptr) { + Atomic64 value = *ptr; + return value; +} + +inline Atomic64 Release_Load(volatile const Atomic64* ptr) { + MemoryBarrier(); + return *ptr; +} + +inline Atomic64 Acquire_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + +inline Atomic64 Release_CompareAndSwap(volatile Atomic64* ptr, + Atomic64 old_value, + Atomic64 new_value) { + return NoBarrier_CompareAndSwap(ptr, old_value, new_value); +} + + +#endif // defined(_WIN64) + +} // namespace base::subtle +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_X86_MSVC_H_ diff --git a/vendor/cef3/include/base/internal/cef_bind_internal.h b/vendor/cef3/include/base/internal/cef_bind_internal.h new file mode 100644 index 00000000000..725405a057f --- /dev/null +++ b/vendor/cef3/include/base/internal/cef_bind_internal.h @@ -0,0 +1,2811 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_bind.h instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_H_ + +#include "include/base/cef_bind_helpers.h" +#include "include/base/cef_build.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_weak_ptr.h" +#include "include/base/internal/cef_callback_internal.h" +#include "include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h" + +#if defined(OS_WIN) +#include "include/base/internal/cef_bind_internal_win.h" +#endif + +namespace base { +namespace internal { + +// See base/callback.h for user documentation. +// +// +// CONCEPTS: +// Runnable -- A type (really a type class) that has a single Run() method +// and a RunType typedef that corresponds to the type of Run(). +// A Runnable can declare that it should treated like a method +// call by including a typedef named IsMethod. The value of +// this typedef is NOT inspected, only the existence. When a +// Runnable declares itself a method, Bind() will enforce special +// refcounting + WeakPtr handling semantics for the first +// parameter which is expected to be an object. +// Functor -- A copyable type representing something that should be called. +// All function pointers, Callback<>, and Runnables are functors +// even if the invocation syntax differs. +// RunType -- A function type (as opposed to function _pointer_ type) for +// a Run() function. Usually just a convenience typedef. +// (Bound)ArgsType -- A function type that is being (ab)used to store the +// types of set of arguments. The "return" type is always +// void here. We use this hack so that we do not need +// a new type name for each arity of type. (eg., +// BindState1, BindState2). This makes forward +// declarations and friending much much easier. +// +// Types: +// RunnableAdapter<> -- Wraps the various "function" pointer types into an +// object that adheres to the Runnable interface. +// There are |3*ARITY| RunnableAdapter types. +// FunctionTraits<> -- Type traits that unwrap a function signature into a +// a set of easier to use typedefs. Used mainly for +// compile time asserts. +// There are |ARITY| FunctionTraits types. +// ForceVoidReturn<> -- Helper class for translating function signatures to +// equivalent forms with a "void" return type. +// There are |ARITY| ForceVoidReturn types. +// FunctorTraits<> -- Type traits used determine the correct RunType and +// RunnableType for a Functor. This is where function +// signature adapters are applied. +// There are |ARITY| ForceVoidReturn types. +// MakeRunnable<> -- Takes a Functor and returns an object in the Runnable +// type class that represents the underlying Functor. +// There are |O(1)| MakeRunnable types. +// InvokeHelper<> -- Take a Runnable + arguments and actully invokes it. +// Handle the differing syntaxes needed for WeakPtr<> support, +// and for ignoring return values. This is separate from +// Invoker to avoid creating multiple version of Invoker<> +// which grows at O(n^2) with the arity. +// There are |k*ARITY| InvokeHelper types. +// Invoker<> -- Unwraps the curried parameters and executes the Runnable. +// There are |(ARITY^2 + ARITY)/2| Invoketypes. +// BindState<> -- Stores the curried parameters, and is the main entry point +// into the Bind() system, doing most of the type resolution. +// There are ARITY BindState types. + +// RunnableAdapter<> +// +// The RunnableAdapter<> templates provide a uniform interface for invoking +// a function pointer, method pointer, or const method pointer. The adapter +// exposes a Run() method with an appropriate signature. Using this wrapper +// allows for writing code that supports all three pointer types without +// undue repetition. Without it, a lot of code would need to be repeated 3 +// times. +// +// For method pointers and const method pointers the first argument to Run() +// is considered to be the received of the method. This is similar to STL's +// mem_fun(). +// +// This class also exposes a RunType typedef that is the function type of the +// Run() function. +// +// If and only if the wrapper contains a method or const method pointer, an +// IsMethod typedef is exposed. The existence of this typedef (NOT the value) +// marks that the wrapper should be considered a method wrapper. + +template +class RunnableAdapter; + +// Function: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(); + + explicit RunnableAdapter(R(*function)()) + : function_(function) { + } + + R Run() { + return function_(); + } + + private: + R (*function_)(); +}; + +// Method: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)()) + : method_(method) { + } + + R Run(T* object) { + return (object->*method_)(); + } + + private: + R (T::*method_)(); +}; + +// Const Method: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)() const) + : method_(method) { + } + + R Run(const T* object) { + return (object->*method_)(); + } + + private: + R (T::*method_)() const; +}; + +// Function: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1); + + explicit RunnableAdapter(R(*function)(A1)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1) { + return function_(CallbackForward(a1)); + } + + private: + R (*function_)(A1); +}; + +// Method: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1) { + return (object->*method_)(CallbackForward(a1)); + } + + private: + R (T::*method_)(A1); +}; + +// Const Method: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1) { + return (object->*method_)(CallbackForward(a1)); + } + + private: + R (T::*method_)(A1) const; +}; + +// Function: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2); + + explicit RunnableAdapter(R(*function)(A1, A2)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return function_(CallbackForward(a1), CallbackForward(a2)); + } + + private: + R (*function_)(A1, A2); +}; + +// Method: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); + } + + private: + R (T::*method_)(A1, A2); +}; + +// Const Method: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2)); + } + + private: + R (T::*method_)(A1, A2) const; +}; + +// Function: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3); + + explicit RunnableAdapter(R(*function)(A1, A2, A3)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } + + private: + R (*function_)(A1, A2, A3); +}; + +// Method: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } + + private: + R (T::*method_)(A1, A2, A3); +}; + +// Const Method: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } + + private: + R (T::*method_)(A1, A2, A3) const; +}; + +// Function: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } + + private: + R (*function_)(A1, A2, A3, A4); +}; + +// Method: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } + + private: + R (T::*method_)(A1, A2, A3, A4); +}; + +// Const Method: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } + + private: + R (T::*method_)(A1, A2, A3, A4) const; +}; + +// Function: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } + + private: + R (*function_)(A1, A2, A3, A4, A5); +}; + +// Method: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5); +}; + +// Const Method: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5) const; +}; + +// Function: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6); +}; + +// Method: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6); +}; + +// Const Method: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6) const; +}; + +// Function: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(*function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return function_(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } + + private: + R (*function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// Method: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(T*, A1, A2, A3, A4, A5, A6, A7); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7)) + : method_(method) { + } + + R Run(T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// Const Method: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(const T*, A1, A2, A3, A4, A5, A6, A7); + typedef true_type IsMethod; + + explicit RunnableAdapter(R(T::*method)(A1, A2, A3, A4, A5, A6, A7) const) + : method_(method) { + } + + R Run(const T* object, typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return (object->*method_)(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } + + private: + R (T::*method_)(A1, A2, A3, A4, A5, A6, A7) const; +}; + + +// FunctionTraits<> +// +// Breaks a function signature apart into typedefs for easier introspection. +template +struct FunctionTraits; + +template +struct FunctionTraits { + typedef R ReturnType; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; +}; + +template +struct FunctionTraits { + typedef R ReturnType; + typedef A1 A1Type; + typedef A2 A2Type; + typedef A3 A3Type; + typedef A4 A4Type; + typedef A5 A5Type; + typedef A6 A6Type; + typedef A7 A7Type; +}; + + +// ForceVoidReturn<> +// +// Set of templates that support forcing the function return type to void. +template +struct ForceVoidReturn; + +template +struct ForceVoidReturn { + typedef void(RunType)(); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4, A5); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4, A5, A6); +}; + +template +struct ForceVoidReturn { + typedef void(RunType)(A1, A2, A3, A4, A5, A6, A7); +}; + + +// FunctorTraits<> +// +// See description at top of file. +template +struct FunctorTraits { + typedef RunnableAdapter RunnableType; + typedef typename RunnableType::RunType RunType; +}; + +template +struct FunctorTraits > { + typedef typename FunctorTraits::RunnableType RunnableType; + typedef typename ForceVoidReturn< + typename RunnableType::RunType>::RunType RunType; +}; + +template +struct FunctorTraits > { + typedef Callback RunnableType; + typedef typename Callback::RunType RunType; +}; + + +// MakeRunnable<> +// +// Converts a passed in functor to a RunnableType using type inference. + +template +typename FunctorTraits::RunnableType MakeRunnable(const T& t) { + return RunnableAdapter(t); +} + +template +typename FunctorTraits::RunnableType +MakeRunnable(const IgnoreResultHelper& t) { + return MakeRunnable(t.functor_); +} + +template +const typename FunctorTraits >::RunnableType& +MakeRunnable(const Callback& t) { + DCHECK(!t.is_null()); + return t; +} + + +// InvokeHelper<> +// +// There are 3 logical InvokeHelper<> specializations: normal, void-return, +// WeakCalls. +// +// The normal type just calls the underlying runnable. +// +// We need a InvokeHelper to handle void return types in order to support +// IgnoreResult(). Normally, if the Runnable's RunType had a void return, +// the template system would just accept "return functor.Run()" ignoring +// the fact that a void function is being used with return. This piece of +// sugar breaks though when the Runnable's RunType is not void. Thus, we +// need a partial specialization to change the syntax to drop the "return" +// from the invocation call. +// +// WeakCalls similarly need special syntax that is applied to the first +// argument to check if they should no-op themselves. +template +struct InvokeHelper; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable) { + return runnable.Run(); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable) { + runnable.Run(); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1) { + return runnable.Run(CallbackForward(a1)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1) { + runnable.Run(CallbackForward(a1)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get()); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2) { + runnable.Run(CallbackForward(a1), CallbackForward(a2)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4, A5 a5) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4, A5 a5, A6 a6) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6)); + } +}; + +template +struct InvokeHelper { + static ReturnType MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, + A5 a5, A6 a6, A7 a7) { + return runnable.Run(CallbackForward(a1), CallbackForward(a2), + CallbackForward(a3), CallbackForward(a4), CallbackForward(a5), + CallbackForward(a6), CallbackForward(a7)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, + A6 a6, A7 a7) { + runnable.Run(CallbackForward(a1), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); + } +}; + +template +struct InvokeHelper { + static void MakeItSo(Runnable runnable, BoundWeakPtr weak_ptr, A2 a2, A3 a3, + A4 a4, A5 a5, A6 a6, A7 a7) { + if (!weak_ptr.get()) { + return; + } + runnable.Run(weak_ptr.get(), CallbackForward(a2), CallbackForward(a3), + CallbackForward(a4), CallbackForward(a5), CallbackForward(a6), + CallbackForward(a7)); + } +}; + +#if !defined(_MSC_VER) + +template +struct InvokeHelper { + // WeakCalls are only supported for functions with a void return type. + // Otherwise, the function result would be undefined if the the WeakPtr<> + // is invalidated. + COMPILE_ASSERT(is_void::value, + weak_ptrs_can_only_bind_to_methods_without_return_values); +}; + +#endif + +// Invoker<> +// +// See description at the top of the file. +template +struct Invoker; + +// Arity 0 -> 0. +template +struct Invoker<0, StorageType, R()> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper + ::MakeItSo(storage->runnable_); + } +}; + +// Arity 1 -> 1. +template +struct Invoker<0, StorageType, R(X1)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1)> + ::MakeItSo(storage->runnable_, CallbackForward(x1)); + } +}; + +// Arity 1 -> 0. +template +struct Invoker<1, StorageType, R(X1)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1)); + } +}; + +// Arity 2 -> 2. +template +struct Invoker<0, StorageType, R(X1, X2)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2)); + } +}; + +// Arity 2 -> 1. +template +struct Invoker<1, StorageType, R(X1, X2)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2)); + } +}; + +// Arity 2 -> 0. +template +struct Invoker<2, StorageType, R(X1, X2)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2)); + } +}; + +// Arity 3 -> 3. +template +struct Invoker<0, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 3 -> 2. +template +struct Invoker<1, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 3 -> 1. +template +struct Invoker<2, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 3 -> 0. +template +struct Invoker<3, StorageType, R(X1, X2, X3)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3)); + } +}; + +// Arity 4 -> 4. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 3. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 2. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 1. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 4 -> 0. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4)); + } +}; + +// Arity 5 -> 5. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 4. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 3. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 2. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4, X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4, + typename CallbackParamTraits::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 1. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X5); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x5) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper::ForwardType x5)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 5 -> 0. +template +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5)); + } +}; + +// Arity 6 -> 6. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 5. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 4. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 3. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 2. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X5, X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper::ForwardType x5, + typename CallbackParamTraits::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 1. +template +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X6); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x6) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper::ForwardType x6)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 6 -> 0. +template +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6)); + } +}; + +// Arity 7 -> 7. +template +struct Invoker<0, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X1, X2, X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + + return InvokeHelper::ForwardType x1, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 6. +template +struct Invoker<1, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X2, X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + return InvokeHelper::ForwardType x2, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 5. +template +struct Invoker<2, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X3, X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + return InvokeHelper::ForwardType x3, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 4. +template +struct Invoker<3, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X4, X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + return InvokeHelper::ForwardType x4, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 3. +template +struct Invoker<4, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X5, X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + return InvokeHelper::ForwardType x5, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 2. +template +struct Invoker<5, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X6, X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x6, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + return InvokeHelper::ForwardType x6, + typename CallbackParamTraits::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 1. +template +struct Invoker<6, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*, + typename CallbackParamTraits::ForwardType); + + typedef R(UnboundRunType)(X7); + + static R Run(BindStateBase* base, + typename CallbackParamTraits::ForwardType x7) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + return InvokeHelper::ForwardType x7)> + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + +// Arity 7 -> 0. +template +struct Invoker<7, StorageType, R(X1, X2, X3, X4, X5, X6, X7)> { + typedef R(RunType)(BindStateBase*); + + typedef R(UnboundRunType)(); + + static R Run(BindStateBase* base) { + StorageType* storage = static_cast(base); + + // Local references to make debugger stepping easier. If in a debugger, + // you really want to warp ahead and step through the + // InvokeHelper<>::MakeItSo() call below. + typedef typename StorageType::Bound1UnwrapTraits Bound1UnwrapTraits; + typedef typename StorageType::Bound2UnwrapTraits Bound2UnwrapTraits; + typedef typename StorageType::Bound3UnwrapTraits Bound3UnwrapTraits; + typedef typename StorageType::Bound4UnwrapTraits Bound4UnwrapTraits; + typedef typename StorageType::Bound5UnwrapTraits Bound5UnwrapTraits; + typedef typename StorageType::Bound6UnwrapTraits Bound6UnwrapTraits; + typedef typename StorageType::Bound7UnwrapTraits Bound7UnwrapTraits; + + typename Bound1UnwrapTraits::ForwardType x1 = + Bound1UnwrapTraits::Unwrap(storage->p1_); + typename Bound2UnwrapTraits::ForwardType x2 = + Bound2UnwrapTraits::Unwrap(storage->p2_); + typename Bound3UnwrapTraits::ForwardType x3 = + Bound3UnwrapTraits::Unwrap(storage->p3_); + typename Bound4UnwrapTraits::ForwardType x4 = + Bound4UnwrapTraits::Unwrap(storage->p4_); + typename Bound5UnwrapTraits::ForwardType x5 = + Bound5UnwrapTraits::Unwrap(storage->p5_); + typename Bound6UnwrapTraits::ForwardType x6 = + Bound6UnwrapTraits::Unwrap(storage->p6_); + typename Bound7UnwrapTraits::ForwardType x7 = + Bound7UnwrapTraits::Unwrap(storage->p7_); + return InvokeHelper + ::MakeItSo(storage->runnable_, CallbackForward(x1), + CallbackForward(x2), CallbackForward(x3), + CallbackForward(x4), CallbackForward(x5), + CallbackForward(x6), CallbackForward(x7)); + } +}; + + +// BindState<> +// +// This stores all the state passed into Bind() and is also where most +// of the template resolution magic occurs. +// +// Runnable is the functor we are binding arguments to. +// RunType is type of the Run() function that the Invoker<> should use. +// Normally, this is the same as the RunType of the Runnable, but it can +// be different if an adapter like IgnoreResult() has been used. +// +// BoundArgsType contains the storage type for all the bound arguments by +// (ab)using a function type. +template +struct BindState; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef false_type IsWeakCall; + typedef Invoker<0, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + explicit BindState(const Runnable& runnable) + : runnable_(runnable) { + } + + virtual ~BindState() { } + + RunnableType runnable_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<1, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1) + : runnable_(runnable), + p1_(p1) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<2, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2) + : runnable_(runnable), + p1_(p1), + p2_(p2) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<3, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<4, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<5, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + typedef UnwrapTraits Bound5UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<6, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + typedef UnwrapTraits Bound5UnwrapTraits; + typedef UnwrapTraits Bound6UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; +}; + +template +struct BindState : public BindStateBase { + typedef Runnable RunnableType; + typedef IsWeakMethod::value, P1> IsWeakCall; + typedef Invoker<7, BindState, RunType> InvokerType; + typedef typename InvokerType::UnboundRunType UnboundRunType; + + // Convenience typedefs for bound argument types. + typedef UnwrapTraits Bound1UnwrapTraits; + typedef UnwrapTraits Bound2UnwrapTraits; + typedef UnwrapTraits Bound3UnwrapTraits; + typedef UnwrapTraits Bound4UnwrapTraits; + typedef UnwrapTraits Bound5UnwrapTraits; + typedef UnwrapTraits Bound6UnwrapTraits; + typedef UnwrapTraits Bound7UnwrapTraits; + + BindState(const Runnable& runnable, const P1& p1, const P2& p2, const P3& p3, + const P4& p4, const P5& p5, const P6& p6, const P7& p7) + : runnable_(runnable), + p1_(p1), + p2_(p2), + p3_(p3), + p4_(p4), + p5_(p5), + p6_(p6), + p7_(p7) { + MaybeRefcount::value, P1>::AddRef(p1_); + } + + virtual ~BindState() { MaybeRefcount::value, + P1>::Release(p1_); } + + RunnableType runnable_; + P1 p1_; + P2 p2_; + P3 p3_; + P4 p4_; + P5 p5_; + P6 p6_; + P7 p7_; +}; + +} // namespace internal +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_H_ diff --git a/vendor/cef3/include/base/internal/cef_bind_internal_win.h b/vendor/cef3/include/base/internal/cef_bind_internal_win.h new file mode 100644 index 00000000000..9fde646499d --- /dev/null +++ b/vendor/cef3/include/base/internal/cef_bind_internal_win.h @@ -0,0 +1,390 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_bind.h instead. + +// Specializations of RunnableAdapter<> for Windows specific calling +// conventions. Please see base/bind_internal.h for more info. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ + +// In the x64 architecture in Windows, __fastcall, __stdcall, etc, are all +// the same as __cdecl which would turn the following specializations into +// multiple definitions. +#if !defined(ARCH_CPU_X86_64) + +namespace base { +namespace internal { + +template +class RunnableAdapter; + +// __stdcall Function: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(); + + explicit RunnableAdapter(R(__stdcall *function)()) + : function_(function) { + } + + R Run() { + return function_(); + } + + private: + R (__stdcall *function_)(); +}; + +// __fastcall Function: Arity 0. +template +class RunnableAdapter { + public: + typedef R (RunType)(); + + explicit RunnableAdapter(R(__fastcall *function)()) + : function_(function) { + } + + R Run() { + return function_(); + } + + private: + R (__fastcall *function_)(); +}; + +// __stdcall Function: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1); + + explicit RunnableAdapter(R(__stdcall *function)(A1)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1) { + return function_(a1); + } + + private: + R (__stdcall *function_)(A1); +}; + +// __fastcall Function: Arity 1. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1); + + explicit RunnableAdapter(R(__fastcall *function)(A1)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1) { + return function_(a1); + } + + private: + R (__fastcall *function_)(A1); +}; + +// __stdcall Function: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return function_(a1, a2); + } + + private: + R (__stdcall *function_)(A1, A2); +}; + +// __fastcall Function: Arity 2. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2) { + return function_(a1, a2); + } + + private: + R (__fastcall *function_)(A1, A2); +}; + +// __stdcall Function: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return function_(a1, a2, a3); + } + + private: + R (__stdcall *function_)(A1, A2, A3); +}; + +// __fastcall Function: Arity 3. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3) { + return function_(a1, a2, a3); + } + + private: + R (__fastcall *function_)(A1, A2, A3); +}; + +// __stdcall Function: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return function_(a1, a2, a3, a4); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4); +}; + +// __fastcall Function: Arity 4. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4) { + return function_(a1, a2, a3, a4); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4); +}; + +// __stdcall Function: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return function_(a1, a2, a3, a4, a5); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5); +}; + +// __fastcall Function: Arity 5. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5) { + return function_(a1, a2, a3, a4, a5); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5); +}; + +// __stdcall Function: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return function_(a1, a2, a3, a4, a5, a6); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6); +}; + +// __fastcall Function: Arity 6. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6) { + return function_(a1, a2, a3, a4, a5, a6); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6); +}; + +// __stdcall Function: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(__stdcall *function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return function_(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (__stdcall *function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +// __fastcall Function: Arity 7. +template +class RunnableAdapter { + public: + typedef R (RunType)(A1, A2, A3, A4, A5, A6, A7); + + explicit RunnableAdapter(R(__fastcall *function)(A1, A2, A3, A4, A5, A6, A7)) + : function_(function) { + } + + R Run(typename CallbackParamTraits::ForwardType a1, + typename CallbackParamTraits::ForwardType a2, + typename CallbackParamTraits::ForwardType a3, + typename CallbackParamTraits::ForwardType a4, + typename CallbackParamTraits::ForwardType a5, + typename CallbackParamTraits::ForwardType a6, + typename CallbackParamTraits::ForwardType a7) { + return function_(a1, a2, a3, a4, a5, a6, a7); + } + + private: + R (__fastcall *function_)(A1, A2, A3, A4, A5, A6, A7); +}; + +} // namespace internal +} // namespace base + +#endif // !defined(ARCH_CPU_X86_64) + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_BIND_INTERNAL_WIN_H_ diff --git a/vendor/cef3/include/base/internal/cef_callback_internal.h b/vendor/cef3/include/base/internal/cef_callback_internal.h new file mode 100644 index 00000000000..c2faf93cbef --- /dev/null +++ b/vendor/cef3/include/base/internal/cef_callback_internal.h @@ -0,0 +1,205 @@ +// Copyright (c) 2012 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_bind.h or +// base/cef_callback.h instead. + +// This file contains utility functions and classes that help the +// implementation, and management of the Callback objects. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_ + +#include + +#include "include/base/cef_ref_counted.h" +#include "include/base/cef_scoped_ptr.h" + +template +class ScopedVector; + +namespace base { +namespace internal { + +// BindStateBase is used to provide an opaque handle that the Callback +// class can use to represent a function object with bound arguments. It +// behaves as an existential type that is used by a corresponding +// DoInvoke function to perform the function execution. This allows +// us to shield the Callback class from the types of the bound argument via +// "type erasure." +class BindStateBase : public RefCountedThreadSafe { + protected: + friend class RefCountedThreadSafe; + virtual ~BindStateBase() {} +}; + +// Holds the Callback methods that don't require specialization to reduce +// template bloat. +class CallbackBase { + public: + // Returns true if Callback is null (doesn't refer to anything). + bool is_null() const { return bind_state_.get() == NULL; } + + // Returns the Callback into an uninitialized state. + void Reset(); + + protected: + // In C++, it is safe to cast function pointers to function pointers of + // another type. It is not okay to use void*. We create a InvokeFuncStorage + // that that can store our function pointer, and then cast it back to + // the original type on usage. + typedef void(*InvokeFuncStorage)(void); + + // Returns true if this callback equals |other|. |other| may be null. + bool Equals(const CallbackBase& other) const; + + // Allow initializing of |bind_state_| via the constructor to avoid default + // initialization of the scoped_refptr. We do not also initialize + // |polymorphic_invoke_| here because doing a normal assignment in the + // derived Callback templates makes for much nicer compiler errors. + explicit CallbackBase(BindStateBase* bind_state); + + // Force the destructor to be instantiated inside this translation unit so + // that our subclasses will not get inlined versions. Avoids more template + // bloat. + ~CallbackBase(); + + scoped_refptr bind_state_; + InvokeFuncStorage polymorphic_invoke_; +}; + +// A helper template to determine if given type is non-const move-only-type, +// i.e. if a value of the given type should be passed via .Pass() in a +// destructive way. +template struct IsMoveOnlyType { + template + static YesType Test(const typename U::MoveOnlyTypeForCPP03*); + + template + static NoType Test(...); + + static const bool value = sizeof(Test(0)) == sizeof(YesType) && + !is_const::value; +}; + +// This is a typetraits object that's used to take an argument type, and +// extract a suitable type for storing and forwarding arguments. +// +// In particular, it strips off references, and converts arrays to +// pointers for storage; and it avoids accidentally trying to create a +// "reference of a reference" if the argument is a reference type. +// +// This array type becomes an issue for storage because we are passing bound +// parameters by const reference. In this case, we end up passing an actual +// array type in the initializer list which C++ does not allow. This will +// break passing of C-string literals. +template ::value> +struct CallbackParamTraits { + typedef const T& ForwardType; + typedef T StorageType; +}; + +// The Storage should almost be impossible to trigger unless someone manually +// specifies type of the bind parameters. However, in case they do, +// this will guard against us accidentally storing a reference parameter. +// +// The ForwardType should only be used for unbound arguments. +template +struct CallbackParamTraits { + typedef T& ForwardType; + typedef T StorageType; +}; + +// Note that for array types, we implicitly add a const in the conversion. This +// means that it is not possible to bind array arguments to functions that take +// a non-const pointer. Trying to specialize the template based on a "const +// T[n]" does not seem to match correctly, so we are stuck with this +// restriction. +template +struct CallbackParamTraits { + typedef const T* ForwardType; + typedef const T* StorageType; +}; + +// See comment for CallbackParamTraits. +template +struct CallbackParamTraits { + typedef const T* ForwardType; + typedef const T* StorageType; +}; + +// Parameter traits for movable-but-not-copyable scopers. +// +// Callback<>/Bind() understands movable-but-not-copyable semantics where +// the type cannot be copied but can still have its state destructively +// transferred (aka. moved) to another instance of the same type by calling a +// helper function. When used with Bind(), this signifies transferal of the +// object's state to the target function. +// +// For these types, the ForwardType must not be a const reference, or a +// reference. A const reference is inappropriate, and would break const +// correctness, because we are implementing a destructive move. A non-const +// reference cannot be used with temporaries which means the result of a +// function or a cast would not be usable with Callback<> or Bind(). +template +struct CallbackParamTraits { + typedef T ForwardType; + typedef T StorageType; +}; + +// CallbackForward() is a very limited simulation of C++11's std::forward() +// used by the Callback/Bind system for a set of movable-but-not-copyable +// types. It is needed because forwarding a movable-but-not-copyable +// argument to another function requires us to invoke the proper move +// operator to create a rvalue version of the type. The supported types are +// whitelisted below as overloads of the CallbackForward() function. The +// default template compiles out to be a no-op. +// +// In C++11, std::forward would replace all uses of this function. However, it +// is impossible to implement a general std::forward with C++11 due to a lack +// of rvalue references. +// +// In addition to Callback/Bind, this is used by PostTaskAndReplyWithResult to +// simulate std::forward() and forward the result of one Callback as a +// parameter to another callback. This is to support Callbacks that return +// the movable-but-not-copyable types whitelisted above. +template +typename enable_if::value, T>::type& CallbackForward(T& t) { + return t; +} + +template +typename enable_if::value, T>::type CallbackForward(T& t) { + return t.Pass(); +} + +} // namespace internal +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_CALLBACK_INTERNAL_H_ diff --git a/vendor/cef3/include/base/internal/cef_lock_impl.h b/vendor/cef3/include/base/internal/cef_lock_impl.h new file mode 100644 index 00000000000..bd708c20df9 --- /dev/null +++ b/vendor/cef3/include/base/internal/cef_lock_impl.h @@ -0,0 +1,87 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_lock.h instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_ + +#include "include/base/cef_build.h" + +#if defined(OS_WIN) +#include +#elif defined(OS_POSIX) +#include +#endif + +#include "include/base/cef_macros.h" + +namespace base { +namespace internal { + +// This class implements the underlying platform-specific spin-lock mechanism +// used for the Lock class. Most users should not use LockImpl directly, but +// should instead use Lock. +class LockImpl { + public: +#if defined(OS_WIN) + typedef CRITICAL_SECTION NativeHandle; +#elif defined(OS_POSIX) + typedef pthread_mutex_t NativeHandle; +#endif + + LockImpl(); + ~LockImpl(); + + // If the lock is not held, take it and return true. If the lock is already + // held by something else, immediately return false. + bool Try(); + + // Take the lock, blocking until it is available if necessary. + void Lock(); + + // Release the lock. This must only be called by the lock's holder: after + // a successful call to Try, or a call to Lock. + void Unlock(); + + // Return the native underlying lock. + // TODO(awalker): refactor lock and condition variables so that this is + // unnecessary. + NativeHandle* native_handle() { return &native_handle_; } + + private: + NativeHandle native_handle_; + + DISALLOW_COPY_AND_ASSIGN(LockImpl); +}; + +} // namespace internal +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_LOCK_IMPL_H_ diff --git a/vendor/cef3/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h b/vendor/cef3/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h new file mode 100644 index 00000000000..c643a9ecd47 --- /dev/null +++ b/vendor/cef3/include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h @@ -0,0 +1,154 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_callback.h instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_ +#define CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_ + +#include "include/base/cef_build.h" +#include "include/base/cef_ref_counted.h" +#include "include/base/cef_template_util.h" +#include "include/base/cef_tuple.h" + +// It is dangerous to post a task with a T* argument where T is a subtype of +// RefCounted(Base|ThreadSafeBase), since by the time the parameter is used, the +// object may already have been deleted since it was not held with a +// scoped_refptr. Example: http://crbug.com/27191 +// The following set of traits are designed to generate a compile error +// whenever this antipattern is attempted. + +namespace base { + +namespace internal { + +template +struct NeedsScopedRefptrButGetsRawPtr { +#if defined(OS_WIN) + enum { + value = base::false_type::value + }; +#else + enum { + // Human readable translation: you needed to be a scoped_refptr if you are a + // raw pointer type and are convertible to a RefCounted(Base|ThreadSafeBase) + // type. + value = (is_pointer::value && + (is_convertible::value || + is_convertible::value)) + }; +#endif +}; + +template +struct ParamsUseScopedRefptrCorrectly { + enum { value = 0 }; +}; + +template <> +struct ParamsUseScopedRefptrCorrectly { + enum { value = 1 }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !NeedsScopedRefptrButGetsRawPtr::value }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +template +struct ParamsUseScopedRefptrCorrectly > { + enum { value = !(NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value || + NeedsScopedRefptrButGetsRawPtr::value) }; +}; + +} // namespace internal + +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_CEF_RAW_SCOPED_REFPTR_MISMATCH_CHECKER_H_ diff --git a/vendor/cef3/include/base/internal/cef_thread_checker_impl.h b/vendor/cef3/include/base/internal/cef_thread_checker_impl.h new file mode 100644 index 00000000000..e74bcf8acd1 --- /dev/null +++ b/vendor/cef3/include/base/internal/cef_thread_checker_impl.h @@ -0,0 +1,70 @@ +// Copyright (c) 2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Do not include this header file directly. Use base/cef_thread_checker.h +// instead. + +#ifndef CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_ +#define CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_ + +#include "include/base/cef_lock.h" +#include "include/base/cef_platform_thread.h" + +namespace base { + +// Real implementation of ThreadChecker, for use in debug mode, or +// for temporary use in release mode (e.g. to CHECK on a threading issue +// seen only in the wild). +// +// Note: You should almost always use the ThreadChecker class to get the +// right version for your build configuration. +class ThreadCheckerImpl { + public: + ThreadCheckerImpl(); + ~ThreadCheckerImpl(); + + bool CalledOnValidThread() const; + + // Changes the thread that is checked for in CalledOnValidThread. This may + // be useful when an object may be created on one thread and then used + // exclusively on another thread. + void DetachFromThread(); + + private: + void EnsureThreadIdAssigned() const; + + mutable base::Lock lock_; + // This is mutable so that CalledOnValidThread can set it. + // It's guarded by |lock_|. + mutable PlatformThreadRef valid_thread_id_; +}; + +} // namespace base + +#endif // CEF_INCLUDE_BASE_INTERNAL_THREAD_CHECKER_IMPL_H_ diff --git a/vendor/cef3/include/capi/cef_app_capi.h b/vendor/cef3/include/capi/cef_app_capi.h new file mode 100644 index 00000000000..06e0da24596 --- /dev/null +++ b/vendor/cef3/include/capi/cef_app_capi.h @@ -0,0 +1,182 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_process_handler_capi.h" +#include "include/capi/cef_command_line_capi.h" +#include "include/capi/cef_render_process_handler_capi.h" +#include "include/capi/cef_resource_bundle_handler_capi.h" +#include "include/capi/cef_scheme_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_app_t; + +/// +// Implement this structure to provide handler implementations. Methods will be +// called by the process and/or thread indicated. +/// +typedef struct _cef_app_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Provides an opportunity to view and/or modify command-line arguments before + // processing by CEF and Chromium. The |process_type| value will be NULL for + // the browser process. Do not keep a reference to the cef_command_line_t + // object passed to this function. The CefSettings.command_line_args_disabled + // value can be used to start with an NULL command-line object. Any values + // specified in CefSettings that equate to command-line arguments will be set + // before this function is called. Be cautious when using this function to + // modify command-line arguments for non-browser processes as this may result + // in undefined behavior including crashes. + /// + void (CEF_CALLBACK *on_before_command_line_processing)( + struct _cef_app_t* self, const cef_string_t* process_type, + struct _cef_command_line_t* command_line); + + /// + // Provides an opportunity to register custom schemes. Do not keep a reference + // to the |registrar| object. This function is called on the main thread for + // each process and the registered schemes should be the same across all + // processes. + /// + void (CEF_CALLBACK *on_register_custom_schemes)(struct _cef_app_t* self, + struct _cef_scheme_registrar_t* registrar); + + /// + // Return the handler for resource bundle events. If + // CefSettings.pack_loading_disabled is true (1) a handler must be returned. + // If no handler is returned resources will be loaded from pack files. This + // function is called by the browser and render processes on multiple threads. + /// + struct _cef_resource_bundle_handler_t* ( + CEF_CALLBACK *get_resource_bundle_handler)(struct _cef_app_t* self); + + /// + // Return the handler for functionality specific to the browser process. This + // function is called on multiple threads in the browser process. + /// + struct _cef_browser_process_handler_t* ( + CEF_CALLBACK *get_browser_process_handler)(struct _cef_app_t* self); + + /// + // Return the handler for functionality specific to the render process. This + // function is called on the render process main thread. + /// + struct _cef_render_process_handler_t* ( + CEF_CALLBACK *get_render_process_handler)(struct _cef_app_t* self); +} cef_app_t; + + +/// +// This function should be called from the application entry point function to +// execute a secondary process. It can be used to run secondary processes from +// the browser client executable (default behavior) or from a separate +// executable specified by the CefSettings.browser_subprocess_path value. If +// called for the browser process (identified by no "type" command-line value) +// it will return immediately with a value of -1. If called for a recognized +// secondary process it will block until the process should exit and then return +// the process exit code. The |application| parameter may be NULL. The +// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see +// cef_sandbox_win.h for details). +/// +CEF_EXPORT int cef_execute_process(const struct _cef_main_args_t* args, + cef_app_t* application, void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to initialize +// the CEF browser process. The |application| parameter may be NULL. A return +// value of true (1) indicates that it succeeded and false (0) indicates that it +// failed. The |windows_sandbox_info| parameter is only used on Windows and may +// be NULL (see cef_sandbox_win.h for details). +/// +CEF_EXPORT int cef_initialize(const struct _cef_main_args_t* args, + const struct _cef_settings_t* settings, cef_app_t* application, + void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to shut down +// the CEF browser process before the application exits. +/// +CEF_EXPORT void cef_shutdown(); + +/// +// Perform a single iteration of CEF message loop processing. This function is +// used to integrate the CEF message loop into an existing application message +// loop. Care must be taken to balance performance against excessive CPU usage. +// This function should only be called on the main application thread and only +// if cef_initialize() is called with a CefSettings.multi_threaded_message_loop +// value of false (0). This function will not block. +/// +CEF_EXPORT void cef_do_message_loop_work(); + +/// +// Run the CEF message loop. Use this function instead of an application- +// provided message loop to get the best balance between performance and CPU +// usage. This function should only be called on the main application thread and +// only if cef_initialize() is called with a +// CefSettings.multi_threaded_message_loop value of false (0). This function +// will block until a quit message is received by the system. +/// +CEF_EXPORT void cef_run_message_loop(); + +/// +// Quit the CEF message loop that was started by calling cef_run_message_loop(). +// This function should only be called on the main application thread and only +// if cef_run_message_loop() was used. +/// +CEF_EXPORT void cef_quit_message_loop(); + +/// +// Set to true (1) before calling Windows APIs like TrackPopupMenu that enter a +// modal message loop. Set to false (0) after exiting the modal message loop. +/// +CEF_EXPORT void cef_set_osmodal_loop(int osModalLoop); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_APP_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_auth_callback_capi.h b/vendor/cef3/include/capi/cef_auth_callback_capi.h new file mode 100644 index 00000000000..e62131ab390 --- /dev/null +++ b/vendor/cef3/include/capi/cef_auth_callback_capi.h @@ -0,0 +1,75 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of authentication +// requests. +/// +typedef struct _cef_auth_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the authentication request. + /// + void (CEF_CALLBACK *cont)(struct _cef_auth_callback_t* self, + const cef_string_t* username, const cef_string_t* password); + + /// + // Cancel the authentication request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_auth_callback_t* self); +} cef_auth_callback_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_AUTH_CALLBACK_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_base_capi.h b/vendor/cef3/include/capi/cef_base_capi.h new file mode 100644 index 00000000000..edeef3c0e22 --- /dev/null +++ b/vendor/cef3/include/capi/cef_base_capi.h @@ -0,0 +1,89 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ + +#include + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_string_map.h" +#include "include/internal/cef_string_multimap.h" +#include "include/internal/cef_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// Structure defining the reference count implementation functions. All +// framework structures must include the cef_base_t structure first. +/// +typedef struct _cef_base_t { + /// + // Size of the data structure. + /// + size_t size; + + /// + // Called to increment the reference count for the object. Should be called + // for every new copy of a pointer to a given object. + /// + void (CEF_CALLBACK *add_ref)(struct _cef_base_t* self); + + /// + // Called to decrement the reference count for the object. If the reference + // count falls to 0 the object should self-delete. Returns true (1) if the + // resulting reference count is 0. + /// + int (CEF_CALLBACK *release)(struct _cef_base_t* self); + + /// + // Returns true (1) if the current reference count is 1. + /// + int (CEF_CALLBACK *has_one_ref)(struct _cef_base_t* self); +} cef_base_t; + + +// Check that the structure |s|, which is defined with a cef_base_t member named +// |base|, is large enough to contain the specified member |f|. +#define CEF_MEMBER_EXISTS(s, f) \ + ((intptr_t)&((s)->f) - (intptr_t)(s) + sizeof((s)->f) <= (s)->base.size) + +#define CEF_MEMBER_MISSING(s, f) (!CEF_MEMBER_EXISTS(s, f) || !((s)->f)) + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_BASE_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_browser_capi.h b/vendor/cef3/include/capi/cef_browser_capi.h new file mode 100644 index 00000000000..982f6e0ed54 --- /dev/null +++ b/vendor/cef3/include/capi/cef_browser_capi.h @@ -0,0 +1,613 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_drag_data_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_navigation_entry_capi.h" +#include "include/capi/cef_process_message_capi.h" +#include "include/capi/cef_request_context_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_browser_host_t; +struct _cef_client_t; + +/// +// Structure used to represent a browser window. When used in the browser +// process the functions of this structure may be called on any thread unless +// otherwise indicated in the comments. When used in the render process the +// functions of this structure may only be called on the main thread. +/// +typedef struct _cef_browser_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the browser host object. This function can only be called in the + // browser process. + /// + struct _cef_browser_host_t* (CEF_CALLBACK *get_host)( + struct _cef_browser_t* self); + + /// + // Returns true (1) if the browser can navigate backwards. + /// + int (CEF_CALLBACK *can_go_back)(struct _cef_browser_t* self); + + /// + // Navigate backwards. + /// + void (CEF_CALLBACK *go_back)(struct _cef_browser_t* self); + + /// + // Returns true (1) if the browser can navigate forwards. + /// + int (CEF_CALLBACK *can_go_forward)(struct _cef_browser_t* self); + + /// + // Navigate forwards. + /// + void (CEF_CALLBACK *go_forward)(struct _cef_browser_t* self); + + /// + // Returns true (1) if the browser is currently loading. + /// + int (CEF_CALLBACK *is_loading)(struct _cef_browser_t* self); + + /// + // Reload the current page. + /// + void (CEF_CALLBACK *reload)(struct _cef_browser_t* self); + + /// + // Reload the current page ignoring any cached data. + /// + void (CEF_CALLBACK *reload_ignore_cache)(struct _cef_browser_t* self); + + /// + // Stop loading the page. + /// + void (CEF_CALLBACK *stop_load)(struct _cef_browser_t* self); + + /// + // Returns the globally unique identifier for this browser. + /// + int (CEF_CALLBACK *get_identifier)(struct _cef_browser_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_browser_t* self, + struct _cef_browser_t* that); + + /// + // Returns true (1) if the window is a popup window. + /// + int (CEF_CALLBACK *is_popup)(struct _cef_browser_t* self); + + /// + // Returns true (1) if a document has been loaded in the browser. + /// + int (CEF_CALLBACK *has_document)(struct _cef_browser_t* self); + + /// + // Returns the main (top-level) frame for the browser window. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_main_frame)( + struct _cef_browser_t* self); + + /// + // Returns the focused frame for the browser window. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_focused_frame)( + struct _cef_browser_t* self); + + /// + // Returns the frame with the specified identifier, or NULL if not found. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_frame_byident)( + struct _cef_browser_t* self, int64 identifier); + + /// + // Returns the frame with the specified name, or NULL if not found. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_browser_t* self, + const cef_string_t* name); + + /// + // Returns the number of frames that currently exist. + /// + size_t (CEF_CALLBACK *get_frame_count)(struct _cef_browser_t* self); + + /// + // Returns the identifiers of all existing frames. + /// + void (CEF_CALLBACK *get_frame_identifiers)(struct _cef_browser_t* self, + size_t* identifiersCount, int64* identifiers); + + /// + // Returns the names of all existing frames. + /// + void (CEF_CALLBACK *get_frame_names)(struct _cef_browser_t* self, + cef_string_list_t names); + + // + // Send a message to the specified |target_process|. Returns true (1) if the + // message was sent successfully. + /// + int (CEF_CALLBACK *send_process_message)(struct _cef_browser_t* self, + cef_process_id_t target_process, + struct _cef_process_message_t* message); +} cef_browser_t; + + +/// +// Callback structure for cef_browser_host_t::RunFileDialog. The functions of +// this structure will be called on the browser process UI thread. +/// +typedef struct _cef_run_file_dialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called asynchronously after the file dialog is dismissed. If the selection + // was successful |file_paths| will be a single value or a list of values + // depending on the dialog mode. If the selection was cancelled |file_paths| + // will be NULL. + /// + void (CEF_CALLBACK *cont)(struct _cef_run_file_dialog_callback_t* self, + struct _cef_browser_host_t* browser_host, cef_string_list_t file_paths); +} cef_run_file_dialog_callback_t; + + +/// +// Callback structure for cef_browser_host_t::GetNavigationEntries. The +// functions of this structure will be called on the browser process UI thread. +/// +typedef struct _cef_navigation_entry_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be executed. Do not keep a reference to |entry| outside of + // this callback. Return true (1) to continue visiting entries or false (0) to + // stop. |current| is true (1) if this entry is the currently loaded + // navigation entry. |index| is the 0-based index of this entry and |total| is + // the total number of entries. + /// + int (CEF_CALLBACK *visit)(struct _cef_navigation_entry_visitor_t* self, + struct _cef_navigation_entry_t* entry, int current, int index, + int total); +} cef_navigation_entry_visitor_t; + + +/// +// Structure used to represent the browser process aspects of a browser window. +// The functions of this structure can only be called in the browser process. +// They may be called on any thread in that process unless otherwise indicated +// in the comments. +/// +typedef struct _cef_browser_host_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the hosted browser object. + /// + struct _cef_browser_t* (CEF_CALLBACK *get_browser)( + struct _cef_browser_host_t* self); + + /// + // Request that the browser close. The JavaScript 'onbeforeunload' event will + // be fired. If |force_close| is false (0) the event handler, if any, will be + // allowed to prompt the user and the user can optionally cancel the close. If + // |force_close| is true (1) the prompt will not be displayed and the close + // will proceed. Results in a call to cef_life_span_handler_t::do_close() if + // the event handler allows the close or if |force_close| is true (1). See + // cef_life_span_handler_t::do_close() documentation for additional usage + // information. + /// + void (CEF_CALLBACK *close_browser)(struct _cef_browser_host_t* self, + int force_close); + + /// + // Set whether the browser is focused. + /// + void (CEF_CALLBACK *set_focus)(struct _cef_browser_host_t* self, int focus); + + /// + // Set whether the window containing the browser is visible + // (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X. + /// + void (CEF_CALLBACK *set_window_visibility)(struct _cef_browser_host_t* self, + int visible); + + /// + // Retrieve the window handle for this browser. + /// + cef_window_handle_t (CEF_CALLBACK *get_window_handle)( + struct _cef_browser_host_t* self); + + /// + // Retrieve the window handle of the browser that opened this browser. Will + // return NULL for non-popup windows. This function can be used in combination + // with custom handling of modal windows. + /// + cef_window_handle_t (CEF_CALLBACK *get_opener_window_handle)( + struct _cef_browser_host_t* self); + + /// + // Returns the client for this browser. + /// + struct _cef_client_t* (CEF_CALLBACK *get_client)( + struct _cef_browser_host_t* self); + + /// + // Returns the request context for this browser. + /// + struct _cef_request_context_t* (CEF_CALLBACK *get_request_context)( + struct _cef_browser_host_t* self); + + /// + // Get the current zoom level. The default zoom level is 0.0. This function + // can only be called on the UI thread. + /// + double (CEF_CALLBACK *get_zoom_level)(struct _cef_browser_host_t* self); + + /// + // Change the zoom level to the specified value. Specify 0.0 to reset the zoom + // level. If called on the UI thread the change will be applied immediately. + // Otherwise, the change will be applied asynchronously on the UI thread. + /// + void (CEF_CALLBACK *set_zoom_level)(struct _cef_browser_host_t* self, + double zoomLevel); + + /// + // Call to run a file chooser dialog. Only a single file chooser dialog may be + // pending at any given time. |mode| represents the type of dialog to display. + // |title| to the title to be used for the dialog and may be NULL to show the + // default title ("Open" or "Save" depending on the mode). |default_file_name| + // is the default file name to select in the dialog. |accept_types| is a list + // of valid lower-cased MIME types or file extensions specified in an input + // element and is used to restrict selectable files to such types. |callback| + // will be executed after the dialog is dismissed or immediately if another + // dialog is already pending. The dialog will be initiated asynchronously on + // the UI thread. + /// + void (CEF_CALLBACK *run_file_dialog)(struct _cef_browser_host_t* self, + cef_file_dialog_mode_t mode, const cef_string_t* title, + const cef_string_t* default_file_name, cef_string_list_t accept_types, + struct _cef_run_file_dialog_callback_t* callback); + + /// + // Download the file at |url| using cef_download_handler_t. + /// + void (CEF_CALLBACK *start_download)(struct _cef_browser_host_t* self, + const cef_string_t* url); + + /// + // Print the current browser contents. + /// + void (CEF_CALLBACK *print)(struct _cef_browser_host_t* self); + + /// + // Search for |searchText|. |identifier| can be used to have multiple searches + // running simultaniously. |forward| indicates whether to search forward or + // backward within the page. |matchCase| indicates whether the search should + // be case-sensitive. |findNext| indicates whether this is the first request + // or a follow-up. + /// + void (CEF_CALLBACK *find)(struct _cef_browser_host_t* self, int identifier, + const cef_string_t* searchText, int forward, int matchCase, + int findNext); + + /// + // Cancel all searches that are currently going on. + /// + void (CEF_CALLBACK *stop_finding)(struct _cef_browser_host_t* self, + int clearSelection); + + /// + // Open developer tools in its own window. If |inspect_element_at| is non- + // NULL the element at the specified (x,y) location will be inspected. + /// + void (CEF_CALLBACK *show_dev_tools)(struct _cef_browser_host_t* self, + const struct _cef_window_info_t* windowInfo, + struct _cef_client_t* client, + const struct _cef_browser_settings_t* settings, + const cef_point_t* inspect_element_at); + + /// + // Explicitly close the developer tools window if one exists for this browser + // instance. + /// + void (CEF_CALLBACK *close_dev_tools)(struct _cef_browser_host_t* self); + + /// + // Retrieve a snapshot of current navigation entries as values sent to the + // specified visitor. If |current_only| is true (1) only the current + // navigation entry will be sent, otherwise all navigation entries will be + // sent. + /// + /// + void (CEF_CALLBACK *get_navigation_entries)(struct _cef_browser_host_t* self, + struct _cef_navigation_entry_visitor_t* visitor, int current_only); + + /// + // Set whether mouse cursor change is disabled. + /// + void (CEF_CALLBACK *set_mouse_cursor_change_disabled)( + struct _cef_browser_host_t* self, int disabled); + + /// + // Returns true (1) if mouse cursor change is disabled. + /// + int (CEF_CALLBACK *is_mouse_cursor_change_disabled)( + struct _cef_browser_host_t* self); + + /// + // If a misspelled word is currently selected in an editable node calling this + // function will replace it with the specified |word|. + /// + void (CEF_CALLBACK *replace_misspelling)(struct _cef_browser_host_t* self, + const cef_string_t* word); + + /// + // Add the specified |word| to the spelling dictionary. + /// + void (CEF_CALLBACK *add_word_to_dictionary)(struct _cef_browser_host_t* self, + const cef_string_t* word); + + /// + // Returns true (1) if window rendering is disabled. + /// + int (CEF_CALLBACK *is_window_rendering_disabled)( + struct _cef_browser_host_t* self); + + /// + // Notify the browser that the widget has been resized. The browser will first + // call cef_render_handler_t::GetViewRect to get the new size and then call + // cef_render_handler_t::OnPaint asynchronously with the updated regions. This + // function is only used when window rendering is disabled. + /// + void (CEF_CALLBACK *was_resized)(struct _cef_browser_host_t* self); + + /// + // Notify the browser that it has been hidden or shown. Layouting and + // cef_render_handler_t::OnPaint notification will stop when the browser is + // hidden. This function is only used when window rendering is disabled. + /// + void (CEF_CALLBACK *was_hidden)(struct _cef_browser_host_t* self, int hidden); + + /// + // Send a notification to the browser that the screen info has changed. The + // browser will then call cef_render_handler_t::GetScreenInfo to update the + // screen information with the new values. This simulates moving the webview + // window from one display to another, or changing the properties of the + // current display. This function is only used when window rendering is + // disabled. + /// + void (CEF_CALLBACK *notify_screen_info_changed)( + struct _cef_browser_host_t* self); + + /// + // Invalidate the view. The browser will call cef_render_handler_t::OnPaint + // asynchronously. This function is only used when window rendering is + // disabled. + /// + void (CEF_CALLBACK *invalidate)(struct _cef_browser_host_t* self, + cef_paint_element_type_t type); + + /// + // Send a key event to the browser. + /// + void (CEF_CALLBACK *send_key_event)(struct _cef_browser_host_t* self, + const struct _cef_key_event_t* event); + + /// + // Send a mouse click event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + void (CEF_CALLBACK *send_mouse_click_event)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, cef_mouse_button_type_t type, + int mouseUp, int clickCount); + + /// + // Send a mouse move event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + void (CEF_CALLBACK *send_mouse_move_event)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, int mouseLeave); + + /// + // Send a mouse wheel event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. The |deltaX| and |deltaY| + // values represent the movement delta in the X and Y directions respectively. + // In order to scroll inside select popups with window rendering disabled + // cef_render_handler_t::GetScreenPoint should be implemented properly. + /// + void (CEF_CALLBACK *send_mouse_wheel_event)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, int deltaX, int deltaY); + + /// + // Send a focus event to the browser. + /// + void (CEF_CALLBACK *send_focus_event)(struct _cef_browser_host_t* self, + int setFocus); + + /// + // Send a capture lost event to the browser. + /// + void (CEF_CALLBACK *send_capture_lost_event)( + struct _cef_browser_host_t* self); + + /// + // Notify the browser that the window hosting it is about to be moved or + // resized. This function is only used on Windows and Linux. + /// + void (CEF_CALLBACK *notify_move_or_resize_started)( + struct _cef_browser_host_t* self); + + /// + // Get the NSTextInputContext implementation for enabling IME on Mac when + // window rendering is disabled. + /// + cef_text_input_context_t (CEF_CALLBACK *get_nstext_input_context)( + struct _cef_browser_host_t* self); + + /// + // Handles a keyDown event prior to passing it through the NSTextInputClient + // machinery. + /// + void (CEF_CALLBACK *handle_key_event_before_text_input_client)( + struct _cef_browser_host_t* self, cef_event_handle_t keyEvent); + + /// + // Performs any additional actions after NSTextInputClient handles the event. + /// + void (CEF_CALLBACK *handle_key_event_after_text_input_client)( + struct _cef_browser_host_t* self, cef_event_handle_t keyEvent); + + /// + // Call this function when the user drags the mouse into the web view (before + // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). |drag_data| + // should not contain file contents as this type of data is not allowed to be + // dragged into the web view. File contents can be removed using + // cef_drag_data_t::ResetFileContents (for example, if |drag_data| comes from + // cef_render_handler_t::StartDragging). This function is only used when + // window rendering is disabled. + /// + void (CEF_CALLBACK *drag_target_drag_enter)(struct _cef_browser_host_t* self, + struct _cef_drag_data_t* drag_data, + const struct _cef_mouse_event_t* event, + cef_drag_operations_mask_t allowed_ops); + + /// + // Call this function each time the mouse is moved across the web view during + // a drag operation (after calling DragTargetDragEnter and before calling + // DragTargetDragLeave/DragTargetDrop). This function is only used when window + // rendering is disabled. + /// + void (CEF_CALLBACK *drag_target_drag_over)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event, + cef_drag_operations_mask_t allowed_ops); + + /// + // Call this function when the user drags the mouse out of the web view (after + // calling DragTargetDragEnter). This function is only used when window + // rendering is disabled. + /// + void (CEF_CALLBACK *drag_target_drag_leave)(struct _cef_browser_host_t* self); + + /// + // Call this function when the user completes the drag operation by dropping + // the object onto the web view (after calling DragTargetDragEnter). The + // object being dropped is |drag_data|, given as an argument to the previous + // DragTargetDragEnter call. This function is only used when window rendering + // is disabled. + /// + void (CEF_CALLBACK *drag_target_drop)(struct _cef_browser_host_t* self, + const struct _cef_mouse_event_t* event); + + /// + // Call this function when the drag operation started by a + // cef_render_handler_t::StartDragging call has ended either in a drop or by + // being cancelled. |x| and |y| are mouse coordinates relative to the upper- + // left corner of the view. If the web view is both the drag source and the + // drag target then all DragTarget* functions should be called before + // DragSource* mthods. This function is only used when window rendering is + // disabled. + /// + void (CEF_CALLBACK *drag_source_ended_at)(struct _cef_browser_host_t* self, + int x, int y, cef_drag_operations_mask_t op); + + /// + // Call this function when the drag operation started by a + // cef_render_handler_t::StartDragging call has completed. This function may + // be called immediately without first calling DragSourceEndedAt to cancel a + // drag operation. If the web view is both the drag source and the drag target + // then all DragTarget* functions should be called before DragSource* mthods. + // This function is only used when window rendering is disabled. + /// + void (CEF_CALLBACK *drag_source_system_drag_ended)( + struct _cef_browser_host_t* self); +} cef_browser_host_t; + + +/// +// Create a new browser window using the window parameters specified by +// |windowInfo|. All values will be copied internally and the actual window will +// be created on the UI thread. If |request_context| is NULL the global request +// context will be used. This function can be called on any browser process +// thread and will not block. +/// +CEF_EXPORT int cef_browser_host_create_browser( + const cef_window_info_t* windowInfo, struct _cef_client_t* client, + const cef_string_t* url, const struct _cef_browser_settings_t* settings, + struct _cef_request_context_t* request_context); + +/// +// Create a new browser window using the window parameters specified by +// |windowInfo|. If |request_context| is NULL the global request context will be +// used. This function can only be called on the browser process UI thread. +/// +CEF_EXPORT cef_browser_t* cef_browser_host_create_browser_sync( + const cef_window_info_t* windowInfo, struct _cef_client_t* client, + const cef_string_t* url, const struct _cef_browser_settings_t* settings, + struct _cef_request_context_t* request_context); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_browser_process_handler_capi.h b/vendor/cef3/include/capi/cef_browser_process_handler_capi.h new file mode 100644 index 00000000000..099c7e989a7 --- /dev/null +++ b/vendor/cef3/include/capi/cef_browser_process_handler_capi.h @@ -0,0 +1,104 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_command_line_capi.h" +#include "include/capi/cef_print_handler_capi.h" +#include "include/capi/cef_values_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement browser process callbacks. The functions of this +// structure will be called on the browser process main thread unless otherwise +// indicated. +/// +typedef struct _cef_browser_process_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the browser process UI thread immediately after the CEF context + // has been initialized. + /// + void (CEF_CALLBACK *on_context_initialized)( + struct _cef_browser_process_handler_t* self); + + /// + // Called before a child process is launched. Will be called on the browser + // process UI thread when launching a render process and on the browser + // process IO thread when launching a GPU or plugin process. Provides an + // opportunity to modify the child process command line. Do not keep a + // reference to |command_line| outside of this function. + /// + void (CEF_CALLBACK *on_before_child_process_launch)( + struct _cef_browser_process_handler_t* self, + struct _cef_command_line_t* command_line); + + /// + // Called on the browser process IO thread after the main thread has been + // created for a new render process. Provides an opportunity to specify extra + // information that will be passed to + // cef_render_process_handler_t::on_render_thread_created() in the render + // process. Do not keep a reference to |extra_info| outside of this function. + /// + void (CEF_CALLBACK *on_render_process_thread_created)( + struct _cef_browser_process_handler_t* self, + struct _cef_list_value_t* extra_info); + + /// + // Return the handler for printing on Linux. If a print handler is not + // provided then printing will not be supported on the Linux platform. + /// + struct _cef_print_handler_t* (CEF_CALLBACK *get_print_handler)( + struct _cef_browser_process_handler_t* self); +} cef_browser_process_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_callback_capi.h b/vendor/cef3/include/capi/cef_callback_capi.h new file mode 100644 index 00000000000..232f8226292 --- /dev/null +++ b/vendor/cef3/include/capi/cef_callback_capi.h @@ -0,0 +1,89 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Generic callback structure used for asynchronous continuation. +/// +typedef struct _cef_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue processing. + /// + void (CEF_CALLBACK *cont)(struct _cef_callback_t* self); + + /// + // Cancel processing. + /// + void (CEF_CALLBACK *cancel)(struct _cef_callback_t* self); +} cef_callback_t; + + +/// +// Generic callback structure used for asynchronous completion. +/// +typedef struct _cef_completion_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called once the task is complete. + /// + void (CEF_CALLBACK *on_complete)(struct _cef_completion_callback_t* self); +} cef_completion_callback_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_CALLBACK_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_client_capi.h b/vendor/cef3/include/capi/cef_client_capi.h new file mode 100644 index 00000000000..b5148497151 --- /dev/null +++ b/vendor/cef3/include/capi/cef_client_capi.h @@ -0,0 +1,169 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_context_menu_handler_capi.h" +#include "include/capi/cef_dialog_handler_capi.h" +#include "include/capi/cef_display_handler_capi.h" +#include "include/capi/cef_download_handler_capi.h" +#include "include/capi/cef_drag_handler_capi.h" +#include "include/capi/cef_focus_handler_capi.h" +#include "include/capi/cef_geolocation_handler_capi.h" +#include "include/capi/cef_jsdialog_handler_capi.h" +#include "include/capi/cef_keyboard_handler_capi.h" +#include "include/capi/cef_life_span_handler_capi.h" +#include "include/capi/cef_load_handler_capi.h" +#include "include/capi/cef_process_message_capi.h" +#include "include/capi/cef_render_handler_capi.h" +#include "include/capi/cef_request_handler_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to provide handler implementations. +/// +typedef struct _cef_client_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Return the handler for context menus. If no handler is provided the default + // implementation will be used. + /// + struct _cef_context_menu_handler_t* (CEF_CALLBACK *get_context_menu_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for dialogs. If no handler is provided the default + // implementation will be used. + /// + struct _cef_dialog_handler_t* (CEF_CALLBACK *get_dialog_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser display state events. + /// + struct _cef_display_handler_t* (CEF_CALLBACK *get_display_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for download events. If no handler is returned downloads + // will not be allowed. + /// + struct _cef_download_handler_t* (CEF_CALLBACK *get_download_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for drag events. + /// + struct _cef_drag_handler_t* (CEF_CALLBACK *get_drag_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for focus events. + /// + struct _cef_focus_handler_t* (CEF_CALLBACK *get_focus_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for geolocation permissions requests. If no handler is + // provided geolocation access will be denied by default. + /// + struct _cef_geolocation_handler_t* (CEF_CALLBACK *get_geolocation_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for JavaScript dialogs. If no handler is provided the + // default implementation will be used. + /// + struct _cef_jsdialog_handler_t* (CEF_CALLBACK *get_jsdialog_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for keyboard events. + /// + struct _cef_keyboard_handler_t* (CEF_CALLBACK *get_keyboard_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser life span events. + /// + struct _cef_life_span_handler_t* (CEF_CALLBACK *get_life_span_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser load status events. + /// + struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for off-screen rendering events. + /// + struct _cef_render_handler_t* (CEF_CALLBACK *get_render_handler)( + struct _cef_client_t* self); + + /// + // Return the handler for browser request events. + /// + struct _cef_request_handler_t* (CEF_CALLBACK *get_request_handler)( + struct _cef_client_t* self); + + /// + // Called when a new message is received from a different process. Return true + // (1) if the message was handled or false (0) otherwise. Do not keep a + // reference to or attempt to access the message outside of this callback. + /// + int (CEF_CALLBACK *on_process_message_received)(struct _cef_client_t* self, + struct _cef_browser_t* browser, cef_process_id_t source_process, + struct _cef_process_message_t* message); +} cef_client_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_command_line_capi.h b/vendor/cef3/include/capi/cef_command_line_capi.h new file mode 100644 index 00000000000..83e28cd3c7f --- /dev/null +++ b/vendor/cef3/include/capi/cef_command_line_capi.h @@ -0,0 +1,213 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to create and/or parse command line arguments. Arguments with +// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches +// will always precede any arguments without switch prefixes. Switches can +// optionally have a value specified using the '=' delimiter (e.g. +// "-switch=value"). An argument of "--" will terminate switch parsing with all +// subsequent tokens, regardless of prefix, being interpreted as non-switch +// arguments. Switch names are considered case-insensitive. This structure can +// be used before cef_initialize() is called. +/// +typedef struct _cef_command_line_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_command_line_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_command_line_t* self); + + /// + // Returns a writable copy of this object. + /// + struct _cef_command_line_t* (CEF_CALLBACK *copy)( + struct _cef_command_line_t* self); + + /// + // Initialize the command line with the specified |argc| and |argv| values. + // The first argument must be the name of the program. This function is only + // supported on non-Windows platforms. + /// + void (CEF_CALLBACK *init_from_argv)(struct _cef_command_line_t* self, + int argc, const char* const* argv); + + /// + // Initialize the command line with the string returned by calling + // GetCommandLineW(). This function is only supported on Windows. + /// + void (CEF_CALLBACK *init_from_string)(struct _cef_command_line_t* self, + const cef_string_t* command_line); + + /// + // Reset the command-line switches and arguments but leave the program + // component unchanged. + /// + void (CEF_CALLBACK *reset)(struct _cef_command_line_t* self); + + /// + // Retrieve the original command line string as a vector of strings. The argv + // array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } + /// + void (CEF_CALLBACK *get_argv)(struct _cef_command_line_t* self, + cef_string_list_t argv); + + /// + // Constructs and returns the represented command line string. Use this + // function cautiously because quoting behavior is unclear. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_command_line_string)( + struct _cef_command_line_t* self); + + /// + // Get the program part of the command line string (the first item). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_program)( + struct _cef_command_line_t* self); + + /// + // Set the program part of the command line string (the first item). + /// + void (CEF_CALLBACK *set_program)(struct _cef_command_line_t* self, + const cef_string_t* program); + + /// + // Returns true (1) if the command line has switches. + /// + int (CEF_CALLBACK *has_switches)(struct _cef_command_line_t* self); + + /// + // Returns true (1) if the command line contains the given switch. + /// + int (CEF_CALLBACK *has_switch)(struct _cef_command_line_t* self, + const cef_string_t* name); + + /// + // Returns the value associated with the given switch. If the switch has no + // value or isn't present this function returns the NULL string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_switch_value)( + struct _cef_command_line_t* self, const cef_string_t* name); + + /// + // Returns the map of switch names and values. If a switch has no value an + // NULL string is returned. + /// + void (CEF_CALLBACK *get_switches)(struct _cef_command_line_t* self, + cef_string_map_t switches); + + /// + // Add a switch to the end of the command line. If the switch has no value + // pass an NULL value string. + /// + void (CEF_CALLBACK *append_switch)(struct _cef_command_line_t* self, + const cef_string_t* name); + + /// + // Add a switch with the specified value to the end of the command line. + /// + void (CEF_CALLBACK *append_switch_with_value)( + struct _cef_command_line_t* self, const cef_string_t* name, + const cef_string_t* value); + + /// + // True if there are remaining command line arguments. + /// + int (CEF_CALLBACK *has_arguments)(struct _cef_command_line_t* self); + + /// + // Get the remaining command line arguments. + /// + void (CEF_CALLBACK *get_arguments)(struct _cef_command_line_t* self, + cef_string_list_t arguments); + + /// + // Add an argument to the end of the command line. + /// + void (CEF_CALLBACK *append_argument)(struct _cef_command_line_t* self, + const cef_string_t* argument); + + /// + // Insert a command before the current command. Common for debuggers, like + // "valgrind" or "gdb --args". + /// + void (CEF_CALLBACK *prepend_wrapper)(struct _cef_command_line_t* self, + const cef_string_t* wrapper); +} cef_command_line_t; + + +/// +// Create a new cef_command_line_t instance. +/// +CEF_EXPORT cef_command_line_t* cef_command_line_create(); + +/// +// Returns the singleton global cef_command_line_t object. The returned object +// will be read-only. +/// +CEF_EXPORT cef_command_line_t* cef_command_line_get_global(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_COMMAND_LINE_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_context_menu_handler_capi.h b/vendor/cef3/include/capi/cef_context_menu_handler_capi.h new file mode 100644 index 00000000000..598295aade5 --- /dev/null +++ b/vendor/cef3/include/capi/cef_context_menu_handler_capi.h @@ -0,0 +1,249 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_menu_model_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_context_menu_params_t; + +/// +// Implement this structure to handle context menu events. The functions of this +// structure will be called on the UI thread. +/// +typedef struct _cef_context_menu_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called before a context menu is displayed. |params| provides information + // about the context menu state. |model| initially contains the default + // context menu. The |model| can be cleared to show no context menu or + // modified to show a custom menu. Do not keep references to |params| or + // |model| outside of this callback. + /// + void (CEF_CALLBACK *on_before_context_menu)( + struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + struct _cef_menu_model_t* model); + + /// + // Called to execute a command selected from the context menu. Return true (1) + // if the command was handled or false (0) for the default implementation. See + // cef_menu_id_t for the command ids that have default implementations. All + // user-defined command ids should be between MENU_ID_USER_FIRST and + // MENU_ID_USER_LAST. |params| will have the same values as what was passed to + // on_before_context_menu(). Do not keep a reference to |params| outside of + // this callback. + /// + int (CEF_CALLBACK *on_context_menu_command)( + struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + int command_id, cef_event_flags_t event_flags); + + /// + // Called when the context menu is dismissed irregardless of whether the menu + // was NULL or a command was selected. + /// + void (CEF_CALLBACK *on_context_menu_dismissed)( + struct _cef_context_menu_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame); +} cef_context_menu_handler_t; + + +/// +// Provides information about the context menu state. The ethods of this +// structure can only be accessed on browser process the UI thread. +/// +typedef struct _cef_context_menu_params_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the X coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + int (CEF_CALLBACK *get_xcoord)(struct _cef_context_menu_params_t* self); + + /// + // Returns the Y coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + int (CEF_CALLBACK *get_ycoord)(struct _cef_context_menu_params_t* self); + + /// + // Returns flags representing the type of node that the context menu was + // invoked on. + /// + cef_context_menu_type_flags_t (CEF_CALLBACK *get_type_flags)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the URL of the link, if any, that encloses the node that the + // context menu was invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the link URL, if any, to be used ONLY for "copy link address". We + // don't validate this field in the frontend process. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_unfiltered_link_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the source URL, if any, for the element that the context menu was + // invoked on. Example of elements with source URLs are img, audio, and video. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_source_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns true (1) if the context menu was invoked on an image which has non- + // NULL contents. + /// + int (CEF_CALLBACK *has_image_contents)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the URL of the top level page that the context menu was invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_page_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the URL of the subframe that the context menu was invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_frame_url)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the character encoding of the subframe that the context menu was + // invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_frame_charset)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the type of context node that the context menu was invoked on. + /// + cef_context_menu_media_type_t (CEF_CALLBACK *get_media_type)( + struct _cef_context_menu_params_t* self); + + /// + // Returns flags representing the actions supported by the media element, if + // any, that the context menu was invoked on. + /// + cef_context_menu_media_state_flags_t (CEF_CALLBACK *get_media_state_flags)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the text of the selection, if any, that the context menu was + // invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_text)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the text of the misspelled word, if any, that the context menu was + // invoked on. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_misspelled_word)( + struct _cef_context_menu_params_t* self); + + /// + // Returns the hash of the misspelled word, if any, that the context menu was + // invoked on. + /// + int (CEF_CALLBACK *get_misspelling_hash)( + struct _cef_context_menu_params_t* self); + + /// + // Returns true (1) if suggestions exist, false (0) otherwise. Fills in + // |suggestions| from the spell check service for the misspelled word if there + // is one. + /// + int (CEF_CALLBACK *get_dictionary_suggestions)( + struct _cef_context_menu_params_t* self, cef_string_list_t suggestions); + + /// + // Returns true (1) if the context menu was invoked on an editable node. + /// + int (CEF_CALLBACK *is_editable)(struct _cef_context_menu_params_t* self); + + /// + // Returns true (1) if the context menu was invoked on an editable node where + // spell-check is enabled. + /// + int (CEF_CALLBACK *is_spell_check_enabled)( + struct _cef_context_menu_params_t* self); + + /// + // Returns flags representing the actions supported by the editable node, if + // any, that the context menu was invoked on. + /// + cef_context_menu_edit_state_flags_t (CEF_CALLBACK *get_edit_state_flags)( + struct _cef_context_menu_params_t* self); +} cef_context_menu_params_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_cookie_capi.h b/vendor/cef3/include/capi/cef_cookie_capi.h new file mode 100644 index 00000000000..eeca1837fdb --- /dev/null +++ b/vendor/cef3/include/capi/cef_cookie_capi.h @@ -0,0 +1,176 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_callback_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_cookie_visitor_t; + +/// +// Structure used for managing cookies. The functions of this structure may be +// called on any thread unless otherwise indicated. +/// +typedef struct _cef_cookie_manager_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Set the schemes supported by this manager. By default only "http" and + // "https" schemes are supported. Must be called before any cookies are + // accessed. + /// + void (CEF_CALLBACK *set_supported_schemes)(struct _cef_cookie_manager_t* self, + cef_string_list_t schemes); + + /// + // Visit all cookies. The returned cookies are ordered by longest path, then + // by earliest creation date. Returns false (0) if cookies cannot be accessed. + /// + int (CEF_CALLBACK *visit_all_cookies)(struct _cef_cookie_manager_t* self, + struct _cef_cookie_visitor_t* visitor); + + /// + // Visit a subset of cookies. The results are filtered by the given url + // scheme, host, domain and path. If |includeHttpOnly| is true (1) HTTP-only + // cookies will also be included in the results. The returned cookies are + // ordered by longest path, then by earliest creation date. Returns false (0) + // if cookies cannot be accessed. + /// + int (CEF_CALLBACK *visit_url_cookies)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, int includeHttpOnly, + struct _cef_cookie_visitor_t* visitor); + + /// + // Sets a cookie given a valid URL and explicit user-provided cookie + // attributes. This function expects each attribute to be well-formed. It will + // check for disallowed characters (e.g. the ';' character is disallowed + // within the cookie value attribute) and will return false (0) without + // setting the cookie if such characters are found. This function must be + // called on the IO thread. + /// + int (CEF_CALLBACK *set_cookie)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, const struct _cef_cookie_t* cookie); + + /// + // Delete all cookies that match the specified parameters. If both |url| and + // values |cookie_name| are specified all host and domain cookies matching + // both will be deleted. If only |url| is specified all host cookies (but not + // domain cookies) irrespective of path will be deleted. If |url| is NULL all + // cookies for all hosts and domains will be deleted. Returns false (0) if a + // non- NULL invalid URL is specified or if cookies cannot be accessed. This + // function must be called on the IO thread. + /// + int (CEF_CALLBACK *delete_cookies)(struct _cef_cookie_manager_t* self, + const cef_string_t* url, const cef_string_t* cookie_name); + + /// + // Sets the directory path that will be used for storing cookie data. If + // |path| is NULL data will be stored in memory only. Otherwise, data will be + // stored at the specified |path|. To persist session cookies (cookies without + // an expiry date or validity interval) set |persist_session_cookies| to true + // (1). Session cookies are generally intended to be transient and most Web + // browsers do not persist them. Returns false (0) if cookies cannot be + // accessed. + /// + int (CEF_CALLBACK *set_storage_path)(struct _cef_cookie_manager_t* self, + const cef_string_t* path, int persist_session_cookies); + + /// + // Flush the backing store (if any) to disk and execute the specified + // |callback| on the IO thread when done. Returns false (0) if cookies cannot + // be accessed. + /// + int (CEF_CALLBACK *flush_store)(struct _cef_cookie_manager_t* self, + struct _cef_completion_callback_t* callback); +} cef_cookie_manager_t; + + +/// +// Returns the global cookie manager. By default data will be stored at +// CefSettings.cache_path if specified or in memory otherwise. +/// +CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(); + +/// +// Creates a new cookie manager. If |path| is NULL data will be stored in memory +// only. Otherwise, data will be stored at the specified |path|. To persist +// session cookies (cookies without an expiry date or validity interval) set +// |persist_session_cookies| to true (1). Session cookies are generally intended +// to be transient and most Web browsers do not persist them. Returns NULL if +// creation fails. +/// +CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager( + const cef_string_t* path, int persist_session_cookies); + + +/// +// Structure to implement for visiting cookie values. The functions of this +// structure will always be called on the IO thread. +/// +typedef struct _cef_cookie_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called once for each cookie. |count| is the 0-based + // index for the current cookie. |total| is the total number of cookies. Set + // |deleteCookie| to true (1) to delete the cookie currently being visited. + // Return false (0) to stop visiting cookies. This function may never be + // called if no cookies are found. + /// + int (CEF_CALLBACK *visit)(struct _cef_cookie_visitor_t* self, + const struct _cef_cookie_t* cookie, int count, int total, + int* deleteCookie); +} cef_cookie_visitor_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_dialog_handler_capi.h b/vendor/cef3/include/capi/cef_dialog_handler_capi.h new file mode 100644 index 00000000000..a8165bd6541 --- /dev/null +++ b/vendor/cef3/include/capi/cef_dialog_handler_capi.h @@ -0,0 +1,106 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure for asynchronous continuation of file dialog requests. +/// +typedef struct _cef_file_dialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the file selection with the specified |file_paths|. This may be a + // single value or a list of values depending on the dialog mode. An NULL + // value is treated the same as calling cancel(). + /// + void (CEF_CALLBACK *cont)(struct _cef_file_dialog_callback_t* self, + cef_string_list_t file_paths); + + /// + // Cancel the file selection. + /// + void (CEF_CALLBACK *cancel)(struct _cef_file_dialog_callback_t* self); +} cef_file_dialog_callback_t; + + +/// +// Implement this structure to handle dialog events. The functions of this +// structure will be called on the browser process UI thread. +/// +typedef struct _cef_dialog_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to run a file chooser dialog. |mode| represents the type of dialog + // to display. |title| to the title to be used for the dialog and may be NULL + // to show the default title ("Open" or "Save" depending on the mode). + // |default_file_name| is the default file name to select in the dialog. + // |accept_types| is a list of valid lower-cased MIME types or file extensions + // specified in an input element and is used to restrict selectable files to + // such types. To display a custom dialog return true (1) and execute + // |callback| either inline or at a later time. To display the default dialog + // return false (0). + /// + int (CEF_CALLBACK *on_file_dialog)(struct _cef_dialog_handler_t* self, + struct _cef_browser_t* browser, cef_file_dialog_mode_t mode, + const cef_string_t* title, const cef_string_t* default_file_name, + cef_string_list_t accept_types, + struct _cef_file_dialog_callback_t* callback); +} cef_dialog_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DIALOG_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_display_handler_capi.h b/vendor/cef3/include/capi/cef_display_handler_capi.h new file mode 100644 index 00000000000..2b7906bf12b --- /dev/null +++ b/vendor/cef3/include/capi/cef_display_handler_capi.h @@ -0,0 +1,105 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to browser display state. +// The functions of this structure will be called on the UI thread. +/// +typedef struct _cef_display_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when a frame's address has changed. + /// + void (CEF_CALLBACK *on_address_change)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* url); + + /// + // Called when the page title changes. + /// + void (CEF_CALLBACK *on_title_change)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* title); + + /// + // Called when the browser is about to display a tooltip. |text| contains the + // text that will be displayed in the tooltip. To handle the display of the + // tooltip yourself return true (1). Otherwise, you can optionally modify + // |text| and then return false (0) to allow the browser to display the + // tooltip. When window rendering is disabled the application is responsible + // for drawing tooltips and the return value is ignored. + /// + int (CEF_CALLBACK *on_tooltip)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, cef_string_t* text); + + /// + // Called when the browser receives a status message. |value| contains the + // text that will be displayed in the status message. + /// + void (CEF_CALLBACK *on_status_message)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* value); + + /// + // Called to display a console message. Return true (1) to stop the message + // from being output to the console. + /// + int (CEF_CALLBACK *on_console_message)(struct _cef_display_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* message, + const cef_string_t* source, int line); +} cef_display_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DISPLAY_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_dom_capi.h b/vendor/cef3/include/capi/cef_dom_capi.h new file mode 100644 index 00000000000..ee329e2073e --- /dev/null +++ b/vendor/cef3/include/capi/cef_dom_capi.h @@ -0,0 +1,353 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_domdocument_t; +struct _cef_domnode_t; + +/// +// Structure to implement for visiting the DOM. The functions of this structure +// will be called on the render process main thread. +/// +typedef struct _cef_domvisitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method executed for visiting the DOM. The document object passed to this + // function represents a snapshot of the DOM at the time this function is + // executed. DOM objects are only valid for the scope of this function. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this function. + /// + void (CEF_CALLBACK *visit)(struct _cef_domvisitor_t* self, + struct _cef_domdocument_t* document); +} cef_domvisitor_t; + + +/// +// Structure used to represent a DOM document. The functions of this structure +// should only be called on the render process main thread thread. +/// +typedef struct _cef_domdocument_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the document type. + /// + cef_dom_document_type_t (CEF_CALLBACK *get_type)( + struct _cef_domdocument_t* self); + + /// + // Returns the root document node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_document)( + struct _cef_domdocument_t* self); + + /// + // Returns the BODY node of an HTML document. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_body)( + struct _cef_domdocument_t* self); + + /// + // Returns the HEAD node of an HTML document. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_head)( + struct _cef_domdocument_t* self); + + /// + // Returns the title of an HTML document. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_title)( + struct _cef_domdocument_t* self); + + /// + // Returns the document element with the specified ID value. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_element_by_id)( + struct _cef_domdocument_t* self, const cef_string_t* id); + + /// + // Returns the node that currently has keyboard focus. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_focused_node)( + struct _cef_domdocument_t* self); + + /// + // Returns true (1) if a portion of the document is selected. + /// + int (CEF_CALLBACK *has_selection)(struct _cef_domdocument_t* self); + + /// + // Returns the selection start node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_selection_start_node)( + struct _cef_domdocument_t* self); + + /// + // Returns the selection offset within the start node. + /// + int (CEF_CALLBACK *get_selection_start_offset)( + struct _cef_domdocument_t* self); + + /// + // Returns the selection end node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_selection_end_node)( + struct _cef_domdocument_t* self); + + /// + // Returns the selection offset within the end node. + /// + int (CEF_CALLBACK *get_selection_end_offset)(struct _cef_domdocument_t* self); + + /// + // Returns the contents of this selection as markup. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_as_markup)( + struct _cef_domdocument_t* self); + + /// + // Returns the contents of this selection as text. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_selection_as_text)( + struct _cef_domdocument_t* self); + + /// + // Returns the base URL for the document. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_base_url)( + struct _cef_domdocument_t* self); + + /// + // Returns a complete URL based on the document base URL and the specified + // partial URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_complete_url)( + struct _cef_domdocument_t* self, const cef_string_t* partialURL); +} cef_domdocument_t; + + +/// +// Structure used to represent a DOM node. The functions of this structure +// should only be called on the render process main thread. +/// +typedef struct _cef_domnode_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the type for this node. + /// + cef_dom_node_type_t (CEF_CALLBACK *get_type)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is a text node. + /// + int (CEF_CALLBACK *is_text)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is an element node. + /// + int (CEF_CALLBACK *is_element)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is an editable node. + /// + int (CEF_CALLBACK *is_editable)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this is a form control element node. + /// + int (CEF_CALLBACK *is_form_control_element)(struct _cef_domnode_t* self); + + /// + // Returns the type of this form control element node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_form_control_element_type)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_domnode_t* self, + struct _cef_domnode_t* that); + + /// + // Returns the name of this node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_domnode_t* self); + + /// + // Returns the value of this node. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_value)(struct _cef_domnode_t* self); + + /// + // Set the value of this node. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_value)(struct _cef_domnode_t* self, + const cef_string_t* value); + + /// + // Returns the contents of this node as markup. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_as_markup)( + struct _cef_domnode_t* self); + + /// + // Returns the document associated with this node. + /// + struct _cef_domdocument_t* (CEF_CALLBACK *get_document)( + struct _cef_domnode_t* self); + + /// + // Returns the parent node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_parent)( + struct _cef_domnode_t* self); + + /// + // Returns the previous sibling node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_previous_sibling)( + struct _cef_domnode_t* self); + + /// + // Returns the next sibling node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_next_sibling)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this node has child nodes. + /// + int (CEF_CALLBACK *has_children)(struct _cef_domnode_t* self); + + /// + // Return the first child node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_first_child)( + struct _cef_domnode_t* self); + + /// + // Returns the last child node. + /// + struct _cef_domnode_t* (CEF_CALLBACK *get_last_child)( + struct _cef_domnode_t* self); + + + // The following functions are valid only for element nodes. + + /// + // Returns the tag name of this element. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_tag_name)( + struct _cef_domnode_t* self); + + /// + // Returns true (1) if this element has attributes. + /// + int (CEF_CALLBACK *has_element_attributes)(struct _cef_domnode_t* self); + + /// + // Returns true (1) if this element has an attribute named |attrName|. + /// + int (CEF_CALLBACK *has_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName); + + /// + // Returns the element attribute named |attrName|. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_attribute)( + struct _cef_domnode_t* self, const cef_string_t* attrName); + + /// + // Returns a map of all element attributes. + /// + void (CEF_CALLBACK *get_element_attributes)(struct _cef_domnode_t* self, + cef_string_map_t attrMap); + + /// + // Set the value for the element attribute named |attrName|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *set_element_attribute)(struct _cef_domnode_t* self, + const cef_string_t* attrName, const cef_string_t* value); + + /// + // Returns the inner text of the element. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_element_inner_text)( + struct _cef_domnode_t* self); +} cef_domnode_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DOM_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_download_handler_capi.h b/vendor/cef3/include/capi/cef_download_handler_capi.h new file mode 100644 index 00000000000..9886b194548 --- /dev/null +++ b/vendor/cef3/include/capi/cef_download_handler_capi.h @@ -0,0 +1,127 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_download_item_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used to asynchronously continue a download. +/// +typedef struct _cef_before_download_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Call to continue the download. Set |download_path| to the full file path + // for the download including the file name or leave blank to use the + // suggested name and the default temp directory. Set |show_dialog| to true + // (1) if you do wish to show the default "Save As" dialog. + /// + void (CEF_CALLBACK *cont)(struct _cef_before_download_callback_t* self, + const cef_string_t* download_path, int show_dialog); +} cef_before_download_callback_t; + + +/// +// Callback structure used to asynchronously cancel a download. +/// +typedef struct _cef_download_item_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Call to cancel the download. + /// + void (CEF_CALLBACK *cancel)(struct _cef_download_item_callback_t* self); +} cef_download_item_callback_t; + + +/// +// Structure used to handle file downloads. The functions of this structure will +// called on the browser process UI thread. +/// +typedef struct _cef_download_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called before a download begins. |suggested_name| is the suggested name for + // the download file. By default the download will be canceled. Execute + // |callback| either asynchronously or in this function to continue the + // download if desired. Do not keep a reference to |download_item| outside of + // this function. + /// + void (CEF_CALLBACK *on_before_download)(struct _cef_download_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_download_item_t* download_item, + const cef_string_t* suggested_name, + struct _cef_before_download_callback_t* callback); + + /// + // Called when a download's status or progress information has been updated. + // This may be called multiple times before and after on_before_download(). + // Execute |callback| either asynchronously or in this function to cancel the + // download if desired. Do not keep a reference to |download_item| outside of + // this function. + /// + void (CEF_CALLBACK *on_download_updated)(struct _cef_download_handler_t* self, + struct _cef_browser_t* browser, + struct _cef_download_item_t* download_item, + struct _cef_download_item_callback_t* callback); +} cef_download_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_download_item_capi.h b/vendor/cef3/include/capi/cef_download_item_capi.h new file mode 100644 index 00000000000..ef5a1575db2 --- /dev/null +++ b/vendor/cef3/include/capi/cef_download_item_capi.h @@ -0,0 +1,155 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent a download item. +/// +typedef struct _cef_download_item_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_download_item_t* self); + + /// + // Returns true (1) if the download is in progress. + /// + int (CEF_CALLBACK *is_in_progress)(struct _cef_download_item_t* self); + + /// + // Returns true (1) if the download is complete. + /// + int (CEF_CALLBACK *is_complete)(struct _cef_download_item_t* self); + + /// + // Returns true (1) if the download has been canceled or interrupted. + /// + int (CEF_CALLBACK *is_canceled)(struct _cef_download_item_t* self); + + /// + // Returns a simple speed estimate in bytes/s. + /// + int64 (CEF_CALLBACK *get_current_speed)(struct _cef_download_item_t* self); + + /// + // Returns the rough percent complete or -1 if the receive total size is + // unknown. + /// + int (CEF_CALLBACK *get_percent_complete)(struct _cef_download_item_t* self); + + /// + // Returns the total number of bytes. + /// + int64 (CEF_CALLBACK *get_total_bytes)(struct _cef_download_item_t* self); + + /// + // Returns the number of received bytes. + /// + int64 (CEF_CALLBACK *get_received_bytes)(struct _cef_download_item_t* self); + + /// + // Returns the time that the download started. + /// + cef_time_t (CEF_CALLBACK *get_start_time)(struct _cef_download_item_t* self); + + /// + // Returns the time that the download ended. + /// + cef_time_t (CEF_CALLBACK *get_end_time)(struct _cef_download_item_t* self); + + /// + // Returns the full path to the downloaded or downloading file. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_full_path)( + struct _cef_download_item_t* self); + + /// + // Returns the unique identifier for this download. + /// + uint32 (CEF_CALLBACK *get_id)(struct _cef_download_item_t* self); + + /// + // Returns the URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)( + struct _cef_download_item_t* self); + + /// + // Returns the suggested file name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_suggested_file_name)( + struct _cef_download_item_t* self); + + /// + // Returns the content disposition. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_content_disposition)( + struct _cef_download_item_t* self); + + /// + // Returns the mime type. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_mime_type)( + struct _cef_download_item_t* self); +} cef_download_item_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DOWNLOAD_ITEM_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_drag_data_capi.h b/vendor/cef3/include/capi/cef_drag_data_capi.h new file mode 100644 index 00000000000..383c67bd01f --- /dev/null +++ b/vendor/cef3/include/capi/cef_drag_data_capi.h @@ -0,0 +1,211 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_stream_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent drag data. The functions of this structure may be +// called on any thread. +/// +typedef struct _cef_drag_data_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns a copy of the current object. + /// + struct _cef_drag_data_t* (CEF_CALLBACK *clone)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a link. + /// + int (CEF_CALLBACK *is_link)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a text or html fragment. + /// + int (CEF_CALLBACK *is_fragment)(struct _cef_drag_data_t* self); + + /// + // Returns true (1) if the drag data is a file. + /// + int (CEF_CALLBACK *is_file)(struct _cef_drag_data_t* self); + + /// + // Return the link URL that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_url)( + struct _cef_drag_data_t* self); + + /// + // Return the title associated with the link being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_title)( + struct _cef_drag_data_t* self); + + /// + // Return the metadata, if any, associated with the link being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_link_metadata)( + struct _cef_drag_data_t* self); + + /// + // Return the plain text fragment that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_text)( + struct _cef_drag_data_t* self); + + /// + // Return the text/html fragment that is being dragged. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_html)( + struct _cef_drag_data_t* self); + + /// + // Return the base URL that the fragment came from. This value is used for + // resolving relative URLs and may be NULL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_fragment_base_url)( + struct _cef_drag_data_t* self); + + /// + // Return the name of the file being dragged out of the browser window. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file_name)( + struct _cef_drag_data_t* self); + + /// + // Write the contents of the file being dragged out of the web view into + // |writer|. Returns the number of bytes sent to |writer|. If |writer| is NULL + // this function will return the size of the file contents in bytes. Call + // get_file_name() to get a suggested name for the file. + /// + size_t (CEF_CALLBACK *get_file_contents)(struct _cef_drag_data_t* self, + struct _cef_stream_writer_t* writer); + + /// + // Retrieve the list of file names that are being dragged into the browser + // window. + /// + int (CEF_CALLBACK *get_file_names)(struct _cef_drag_data_t* self, + cef_string_list_t names); + + /// + // Set the link URL that is being dragged. + /// + void (CEF_CALLBACK *set_link_url)(struct _cef_drag_data_t* self, + const cef_string_t* url); + + /// + // Set the title associated with the link being dragged. + /// + void (CEF_CALLBACK *set_link_title)(struct _cef_drag_data_t* self, + const cef_string_t* title); + + /// + // Set the metadata associated with the link being dragged. + /// + void (CEF_CALLBACK *set_link_metadata)(struct _cef_drag_data_t* self, + const cef_string_t* data); + + /// + // Set the plain text fragment that is being dragged. + /// + void (CEF_CALLBACK *set_fragment_text)(struct _cef_drag_data_t* self, + const cef_string_t* text); + + /// + // Set the text/html fragment that is being dragged. + /// + void (CEF_CALLBACK *set_fragment_html)(struct _cef_drag_data_t* self, + const cef_string_t* html); + + /// + // Set the base URL that the fragment came from. + /// + void (CEF_CALLBACK *set_fragment_base_url)(struct _cef_drag_data_t* self, + const cef_string_t* base_url); + + /// + // Reset the file contents. You should do this before calling + // cef_browser_host_t::DragTargetDragEnter as the web view does not allow us + // to drag in this kind of data. + /// + void (CEF_CALLBACK *reset_file_contents)(struct _cef_drag_data_t* self); + + /// + // Add a file that is being dragged into the webview. + /// + void (CEF_CALLBACK *add_file)(struct _cef_drag_data_t* self, + const cef_string_t* path, const cef_string_t* display_name); +} cef_drag_data_t; + + +/// +// Create a new cef_drag_data_t object. +/// +CEF_EXPORT cef_drag_data_t* cef_drag_data_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DRAG_DATA_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_drag_handler_capi.h b/vendor/cef3/include/capi/cef_drag_handler_capi.h new file mode 100644 index 00000000000..a148270dae5 --- /dev/null +++ b/vendor/cef3/include/capi/cef_drag_handler_capi.h @@ -0,0 +1,76 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_drag_data_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to dragging. The functions +// of this structure will be called on the UI thread. +/// +typedef struct _cef_drag_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when an external drag event enters the browser window. |dragData| + // contains the drag event data and |mask| represents the type of drag + // operation. Return false (0) for default drag handling behavior or true (1) + // to cancel the drag event. + /// + int (CEF_CALLBACK *on_drag_enter)(struct _cef_drag_handler_t* self, + struct _cef_browser_t* browser, struct _cef_drag_data_t* dragData, + cef_drag_operations_mask_t mask); +} cef_drag_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_DRAG_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_focus_handler_capi.h b/vendor/cef3/include/capi/cef_focus_handler_capi.h new file mode 100644 index 00000000000..61938779ea3 --- /dev/null +++ b/vendor/cef3/include/capi/cef_focus_handler_capi.h @@ -0,0 +1,90 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_dom_capi.h" +#include "include/capi/cef_frame_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to focus. The functions of +// this structure will be called on the UI thread. +/// +typedef struct _cef_focus_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when the browser component is about to loose focus. For instance, if + // focus was on the last HTML element and the user pressed the TAB key. |next| + // will be true (1) if the browser is giving focus to the next component and + // false (0) if the browser is giving focus to the previous component. + /// + void (CEF_CALLBACK *on_take_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, int next); + + /// + // Called when the browser component is requesting focus. |source| indicates + // where the focus request is originating from. Return false (0) to allow the + // focus to be set or true (1) to cancel setting the focus. + /// + int (CEF_CALLBACK *on_set_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser, cef_focus_source_t source); + + /// + // Called when the browser component has received focus. + /// + void (CEF_CALLBACK *on_got_focus)(struct _cef_focus_handler_t* self, + struct _cef_browser_t* browser); +} cef_focus_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_FOCUS_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_frame_capi.h b/vendor/cef3/include/capi/cef_frame_capi.h new file mode 100644 index 00000000000..25c18102d2d --- /dev/null +++ b/vendor/cef3/include/capi/cef_frame_capi.h @@ -0,0 +1,220 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_dom_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_stream_capi.h" +#include "include/capi/cef_string_visitor_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_browser_t; +struct _cef_v8context_t; + +/// +// Structure used to represent a frame in the browser window. When used in the +// browser process the functions of this structure may be called on any thread +// unless otherwise indicated in the comments. When used in the render process +// the functions of this structure may only be called on the main thread. +/// +typedef struct _cef_frame_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // True if this object is currently attached to a valid frame. + /// + int (CEF_CALLBACK *is_valid)(struct _cef_frame_t* self); + + /// + // Execute undo in this frame. + /// + void (CEF_CALLBACK *undo)(struct _cef_frame_t* self); + + /// + // Execute redo in this frame. + /// + void (CEF_CALLBACK *redo)(struct _cef_frame_t* self); + + /// + // Execute cut in this frame. + /// + void (CEF_CALLBACK *cut)(struct _cef_frame_t* self); + + /// + // Execute copy in this frame. + /// + void (CEF_CALLBACK *copy)(struct _cef_frame_t* self); + + /// + // Execute paste in this frame. + /// + void (CEF_CALLBACK *paste)(struct _cef_frame_t* self); + + /// + // Execute delete in this frame. + /// + void (CEF_CALLBACK *del)(struct _cef_frame_t* self); + + /// + // Execute select all in this frame. + /// + void (CEF_CALLBACK *select_all)(struct _cef_frame_t* self); + + /// + // Save this frame's HTML source to a temporary file and open it in the + // default text viewing application. This function can only be called from the + // browser process. + /// + void (CEF_CALLBACK *view_source)(struct _cef_frame_t* self); + + /// + // Retrieve this frame's HTML source as a string sent to the specified + // visitor. + /// + void (CEF_CALLBACK *get_source)(struct _cef_frame_t* self, + struct _cef_string_visitor_t* visitor); + + /// + // Retrieve this frame's display text as a string sent to the specified + // visitor. + /// + void (CEF_CALLBACK *get_text)(struct _cef_frame_t* self, + struct _cef_string_visitor_t* visitor); + + /// + // Load the request represented by the |request| object. + /// + void (CEF_CALLBACK *load_request)(struct _cef_frame_t* self, + struct _cef_request_t* request); + + /// + // Load the specified |url|. + /// + void (CEF_CALLBACK *load_url)(struct _cef_frame_t* self, + const cef_string_t* url); + + /// + // Load the contents of |string_val| with the specified dummy |url|. |url| + // should have a standard scheme (for example, http scheme) or behaviors like + // link clicks and web security restrictions may not behave as expected. + /// + void (CEF_CALLBACK *load_string)(struct _cef_frame_t* self, + const cef_string_t* string_val, const cef_string_t* url); + + /// + // Execute a string of JavaScript code in this frame. The |script_url| + // parameter is the URL where the script in question can be found, if any. The + // renderer may request this URL to show the developer the source of the + // error. The |start_line| parameter is the base line number to use for error + // reporting. + /// + void (CEF_CALLBACK *execute_java_script)(struct _cef_frame_t* self, + const cef_string_t* code, const cef_string_t* script_url, + int start_line); + + /// + // Returns true (1) if this is the main (top-level) frame. + /// + int (CEF_CALLBACK *is_main)(struct _cef_frame_t* self); + + /// + // Returns true (1) if this is the focused frame. + /// + int (CEF_CALLBACK *is_focused)(struct _cef_frame_t* self); + + /// + // Returns the name for this frame. If the frame has an assigned name (for + // example, set via the iframe "name" attribute) then that value will be + // returned. Otherwise a unique name will be constructed based on the frame + // parent hierarchy. The main (top-level) frame will always have an NULL name + // value. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)(struct _cef_frame_t* self); + + /// + // Returns the globally unique identifier for this frame. + /// + int64 (CEF_CALLBACK *get_identifier)(struct _cef_frame_t* self); + + /// + // Returns the parent of this frame or NULL if this is the main (top-level) + // frame. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_parent)(struct _cef_frame_t* self); + + /// + // Returns the URL currently loaded in this frame. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_frame_t* self); + + /// + // Returns the browser that this frame belongs to. + /// + struct _cef_browser_t* (CEF_CALLBACK *get_browser)(struct _cef_frame_t* self); + + /// + // Get the V8 context associated with the frame. This function can only be + // called from the render process. + /// + struct _cef_v8context_t* (CEF_CALLBACK *get_v8context)( + struct _cef_frame_t* self); + + /// + // Visit the DOM document. This function can only be called from the render + // process. + /// + void (CEF_CALLBACK *visit_dom)(struct _cef_frame_t* self, + struct _cef_domvisitor_t* visitor); +} cef_frame_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_geolocation_capi.h b/vendor/cef3/include/capi/cef_geolocation_capi.h new file mode 100644 index 00000000000..926cc3c9b57 --- /dev/null +++ b/vendor/cef3/include/capi/cef_geolocation_capi.h @@ -0,0 +1,79 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to receive geolocation updates. The functions of +// this structure will be called on the browser process UI thread. +/// +typedef struct _cef_get_geolocation_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called with the 'best available' location information or, if the location + // update failed, with error information. + /// + void (CEF_CALLBACK *on_location_update)( + struct _cef_get_geolocation_callback_t* self, + const struct _cef_geoposition_t* position); +} cef_get_geolocation_callback_t; + + +/// +// Request a one-time geolocation update. This function bypasses any user +// permission checks so should only be used by code that is allowed to access +// location information. +/// +CEF_EXPORT int cef_get_geolocation(cef_get_geolocation_callback_t* callback); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_geolocation_handler_capi.h b/vendor/cef3/include/capi/cef_geolocation_handler_capi.h new file mode 100644 index 00000000000..12df10ab906 --- /dev/null +++ b/vendor/cef3/include/capi/cef_geolocation_handler_capi.h @@ -0,0 +1,106 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of geolocation +// permission requests. +/// +typedef struct _cef_geolocation_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Call to allow or deny geolocation access. + /// + void (CEF_CALLBACK *cont)(struct _cef_geolocation_callback_t* self, + int allow); +} cef_geolocation_callback_t; + + +/// +// Implement this structure to handle events related to geolocation permission +// requests. The functions of this structure will be called on the browser +// process UI thread. +/// +typedef struct _cef_geolocation_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when a page requests permission to access geolocation information. + // |requesting_url| is the URL requesting permission and |request_id| is the + // unique ID for the permission request. Return true (1) and call + // cef_geolocation_callback_t::cont() either in this function or at a later + // time to continue or cancel the request. Return false (0) to cancel the + // request immediately. + /// + int (CEF_CALLBACK *on_request_geolocation_permission)( + struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* requesting_url, int request_id, + struct _cef_geolocation_callback_t* callback); + + /// + // Called when a geolocation access request is canceled. |requesting_url| is + // the URL that originally requested permission and |request_id| is the unique + // ID for the permission request. + /// + void (CEF_CALLBACK *on_cancel_geolocation_permission)( + struct _cef_geolocation_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* requesting_url, int request_id); +} cef_geolocation_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_GEOLOCATION_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_jsdialog_handler_capi.h b/vendor/cef3/include/capi/cef_jsdialog_handler_capi.h new file mode 100644 index 00000000000..c141a0ef396 --- /dev/null +++ b/vendor/cef3/include/capi/cef_jsdialog_handler_capi.h @@ -0,0 +1,133 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of JavaScript dialog +// requests. +/// +typedef struct _cef_jsdialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the JS dialog request. Set |success| to true (1) if the OK button + // was pressed. The |user_input| value should be specified for prompt dialogs. + /// + void (CEF_CALLBACK *cont)(struct _cef_jsdialog_callback_t* self, int success, + const cef_string_t* user_input); +} cef_jsdialog_callback_t; + + +/// +// Implement this structure to handle events related to JavaScript dialogs. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_jsdialog_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to run a JavaScript dialog. The |default_prompt_text| value will be + // specified for prompt dialogs only. Set |suppress_message| to true (1) and + // return false (0) to suppress the message (suppressing messages is + // preferable to immediately executing the callback as this is used to detect + // presumably malicious behavior like spamming alert messages in + // onbeforeunload). Set |suppress_message| to false (0) and return false (0) + // to use the default implementation (the default implementation will show one + // modal dialog at a time and suppress any additional dialog requests until + // the displayed dialog is dismissed). Return true (1) if the application will + // use a custom dialog or if the callback has been executed immediately. + // Custom dialogs may be either modal or modeless. If a custom dialog is used + // the application must execute |callback| once the custom dialog is + // dismissed. + /// + int (CEF_CALLBACK *on_jsdialog)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* origin_url, + const cef_string_t* accept_lang, cef_jsdialog_type_t dialog_type, + const cef_string_t* message_text, + const cef_string_t* default_prompt_text, + struct _cef_jsdialog_callback_t* callback, int* suppress_message); + + /// + // Called to run a dialog asking the user if they want to leave a page. Return + // false (0) to use the default dialog implementation. Return true (1) if the + // application will use a custom dialog or if the callback has been executed + // immediately. Custom dialogs may be either modal or modeless. If a custom + // dialog is used the application must execute |callback| once the custom + // dialog is dismissed. + /// + int (CEF_CALLBACK *on_before_unload_dialog)( + struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* message_text, int is_reload, + struct _cef_jsdialog_callback_t* callback); + + /// + // Called to cancel any pending dialogs and reset any saved dialog state. Will + // be called due to events like page navigation irregardless of whether any + // dialogs are currently pending. + /// + void (CEF_CALLBACK *on_reset_dialog_state)( + struct _cef_jsdialog_handler_t* self, struct _cef_browser_t* browser); + + /// + // Called when the default implementation dialog is closed. + /// + void (CEF_CALLBACK *on_dialog_closed)(struct _cef_jsdialog_handler_t* self, + struct _cef_browser_t* browser); +} cef_jsdialog_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_JSDIALOG_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_keyboard_handler_capi.h b/vendor/cef3/include/capi/cef_keyboard_handler_capi.h new file mode 100644 index 00000000000..d56b57bef26 --- /dev/null +++ b/vendor/cef3/include/capi/cef_keyboard_handler_capi.h @@ -0,0 +1,84 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to keyboard input. The +// functions of this structure will be called on the UI thread. +/// +typedef struct _cef_keyboard_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + // Called before a keyboard event is sent to the renderer. |event| contains + // information about the keyboard event. |os_event| is the operating system + // event message, if any. Return true (1) if the event was handled or false + // (0) otherwise. If the event will be handled in on_key_event() as a keyboard + // shortcut set |is_keyboard_shortcut| to true (1) and return false (0). + int (CEF_CALLBACK *on_pre_key_event)(struct _cef_keyboard_handler_t* self, + struct _cef_browser_t* browser, const struct _cef_key_event_t* event, + cef_event_handle_t os_event, int* is_keyboard_shortcut); + + /// + // Called after the renderer and JavaScript in the page has had a chance to + // handle the event. |event| contains information about the keyboard event. + // |os_event| is the operating system event message, if any. Return true (1) + // if the keyboard event was handled or false (0) otherwise. + /// + int (CEF_CALLBACK *on_key_event)(struct _cef_keyboard_handler_t* self, + struct _cef_browser_t* browser, const struct _cef_key_event_t* event, + cef_event_handle_t os_event); +} cef_keyboard_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_KEYBOARD_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_life_span_handler_capi.h b/vendor/cef3/include/capi/cef_life_span_handler_capi.h new file mode 100644 index 00000000000..d1c2a2e1686 --- /dev/null +++ b/vendor/cef3/include/capi/cef_life_span_handler_capi.h @@ -0,0 +1,171 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_client_t; + +/// +// Implement this structure to handle events related to browser life span. The +// functions of this structure will be called on the UI thread unless otherwise +// indicated. +/// +typedef struct _cef_life_span_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the IO thread before a new popup window is created. The |browser| + // and |frame| parameters represent the source of the popup request. The + // |target_url| and |target_frame_name| values may be NULL if none were + // specified with the request. The |popupFeatures| structure contains + // information about the requested popup window. To allow creation of the + // popup window optionally modify |windowInfo|, |client|, |settings| and + // |no_javascript_access| and return false (0). To cancel creation of the + // popup window return true (1). The |client| and |settings| values will + // default to the source browser's values. The |no_javascript_access| value + // indicates whether the new browser window should be scriptable and in the + // same process as the source browser. + int (CEF_CALLBACK *on_before_popup)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* target_url, const cef_string_t* target_frame_name, + const struct _cef_popup_features_t* popupFeatures, + struct _cef_window_info_t* windowInfo, struct _cef_client_t** client, + struct _cef_browser_settings_t* settings, int* no_javascript_access); + + /// + // Called after a new browser is created. + /// + void (CEF_CALLBACK *on_after_created)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called when a modal window is about to display and the modal loop should + // begin running. Return false (0) to use the default modal loop + // implementation or true (1) to use a custom implementation. + /// + int (CEF_CALLBACK *run_modal)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called when a browser has recieved a request to close. This may result + // directly from a call to cef_browser_host_t::close_browser() or indirectly + // if the browser is a top-level OS window created by CEF and the user + // attempts to close the window. This function will be called after the + // JavaScript 'onunload' event has been fired. It will not be called for + // browsers after the associated OS window has been destroyed (for those + // browsers it is no longer possible to cancel the close). + // + // If CEF created an OS window for the browser returning false (0) will send + // an OS close notification to the browser window's top-level owner (e.g. + // WM_CLOSE on Windows, performClose: on OS-X and "delete_event" on Linux). If + // no OS window exists (window rendering disabled) returning false (0) will + // cause the browser object to be destroyed immediately. Return true (1) if + // the browser is parented to another window and that other window needs to + // receive close notification via some non-standard technique. + // + // If an application provides its own top-level window it should handle OS + // close notifications by calling cef_browser_host_t::CloseBrowser(false (0)) + // instead of immediately closing (see the example below). This gives CEF an + // opportunity to process the 'onbeforeunload' event and optionally cancel the + // close before do_close() is called. + // + // The cef_life_span_handler_t::on_before_close() function will be called + // immediately before the browser object is destroyed. The application should + // only exit after on_before_close() has been called for all existing + // browsers. + // + // If the browser represents a modal window and a custom modal loop + // implementation was provided in cef_life_span_handler_t::run_modal() this + // callback should be used to restore the opener window to a usable state. + // + // By way of example consider what should happen during window close when the + // browser is parented to an application-provided top-level OS window. 1. + // User clicks the window close button which sends an OS close + // notification (e.g. WM_CLOSE on Windows, performClose: on OS-X and + // "delete_event" on Linux). + // 2. Application's top-level window receives the close notification and: + // A. Calls CefBrowserHost::CloseBrowser(false). + // B. Cancels the window close. + // 3. JavaScript 'onbeforeunload' handler executes and shows the close + // confirmation dialog (which can be overridden via + // CefJSDialogHandler::OnBeforeUnloadDialog()). + // 4. User approves the close. 5. JavaScript 'onunload' handler executes. 6. + // Application's do_close() handler is called. Application will: + // A. Set a flag to indicate that the next close attempt will be allowed. + // B. Return false. + // 7. CEF sends an OS close notification. 8. Application's top-level window + // receives the OS close notification and + // allows the window to close based on the flag from #6B. + // 9. Browser OS window is destroyed. 10. Application's + // cef_life_span_handler_t::on_before_close() handler is called and + // the browser object is destroyed. + // 11. Application exits by calling cef_quit_message_loop() if no other + // browsers + // exist. + /// + int (CEF_CALLBACK *do_close)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called just before a browser is destroyed. Release all references to the + // browser object and do not attempt to execute any functions on the browser + // object after this callback returns. If this is a modal window and a custom + // modal loop implementation was provided in run_modal() this callback should + // be used to exit the custom modal loop. See do_close() documentation for + // additional usage information. + /// + void (CEF_CALLBACK *on_before_close)(struct _cef_life_span_handler_t* self, + struct _cef_browser_t* browser); +} cef_life_span_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_LIFE_SPAN_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_load_handler_capi.h b/vendor/cef3/include/capi/cef_load_handler_capi.h new file mode 100644 index 00000000000..2ce5d092bd1 --- /dev/null +++ b/vendor/cef3/include/capi/cef_load_handler_capi.h @@ -0,0 +1,112 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events related to browser load status. The +// functions of this structure will be called on the browser process UI thread +// or render process main thread (TID_RENDERER). +/// +typedef struct _cef_load_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called when the loading state has changed. This callback will be executed + // twice -- once when loading is initiated either programmatically or by user + // action, and once when loading is terminated due to completion, cancellation + // of failure. + /// + void (CEF_CALLBACK *on_loading_state_change)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, int isLoading, int canGoBack, + int canGoForward); + + /// + // Called when the browser begins loading a frame. The |frame| value will + // never be NULL -- call the is_main() function to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This + // function may not be called for a particular frame if the load request for + // that frame fails. For notification of overall browser load status use + // OnLoadingStateChange instead. + /// + void (CEF_CALLBACK *on_load_start)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame); + + /// + // Called when the browser is done loading a frame. The |frame| value will + // never be NULL -- call the is_main() function to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This + // function will always be called for all frames irrespective of whether the + // request completes successfully. + /// + void (CEF_CALLBACK *on_load_end)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + int httpStatusCode); + + /// + // Called when the resource load for a navigation fails or is canceled. + // |errorCode| is the error code number, |errorText| is the error text and + // |failedUrl| is the URL that failed to load. See net\base\net_error_list.h + // for complete descriptions of the error codes. + /// + void (CEF_CALLBACK *on_load_error)(struct _cef_load_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + cef_errorcode_t errorCode, const cef_string_t* errorText, + const cef_string_t* failedUrl); +} cef_load_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_menu_model_capi.h b/vendor/cef3/include/capi/cef_menu_model_capi.h new file mode 100644 index 00000000000..00f8096775b --- /dev/null +++ b/vendor/cef3/include/capi/cef_menu_model_capi.h @@ -0,0 +1,388 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Supports creation and modification of menus. See cef_menu_id_t for the +// command ids that have default implementations. All user-defined command ids +// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The functions of +// this structure can only be accessed on the browser process the UI thread. +/// +typedef struct _cef_menu_model_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Clears the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *clear)(struct _cef_menu_model_t* self); + + /// + // Returns the number of items in this menu. + /// + int (CEF_CALLBACK *get_count)(struct _cef_menu_model_t* self); + + // + // Add a separator to the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_separator)(struct _cef_menu_model_t* self); + + // + // Add an item to the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_item)(struct _cef_menu_model_t* self, int command_id, + const cef_string_t* label); + + // + // Add a check item to the menu. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_check_item)(struct _cef_menu_model_t* self, + int command_id, const cef_string_t* label); + + // + // Add a radio item to the menu. Only a single item with the specified + // |group_id| can be checked at a time. Returns true (1) on success. + /// + int (CEF_CALLBACK *add_radio_item)(struct _cef_menu_model_t* self, + int command_id, const cef_string_t* label, int group_id); + + // + // Add a sub-menu to the menu. The new sub-menu is returned. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *add_sub_menu)( + struct _cef_menu_model_t* self, int command_id, + const cef_string_t* label); + + // + // Insert a separator in the menu at the specified |index|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *insert_separator_at)(struct _cef_menu_model_t* self, + int index); + + // + // Insert an item in the menu at the specified |index|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *insert_item_at)(struct _cef_menu_model_t* self, int index, + int command_id, const cef_string_t* label); + + // + // Insert a check item in the menu at the specified |index|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *insert_check_item_at)(struct _cef_menu_model_t* self, + int index, int command_id, const cef_string_t* label); + + // + // Insert a radio item in the menu at the specified |index|. Only a single + // item with the specified |group_id| can be checked at a time. Returns true + // (1) on success. + /// + int (CEF_CALLBACK *insert_radio_item_at)(struct _cef_menu_model_t* self, + int index, int command_id, const cef_string_t* label, int group_id); + + // + // Insert a sub-menu in the menu at the specified |index|. The new sub-menu is + // returned. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *insert_sub_menu_at)( + struct _cef_menu_model_t* self, int index, int command_id, + const cef_string_t* label); + + /// + // Removes the item with the specified |command_id|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *remove)(struct _cef_menu_model_t* self, int command_id); + + /// + // Removes the item at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *remove_at)(struct _cef_menu_model_t* self, int index); + + /// + // Returns the index associated with the specified |command_id| or -1 if not + // found due to the command id not existing in the menu. + /// + int (CEF_CALLBACK *get_index_of)(struct _cef_menu_model_t* self, + int command_id); + + /// + // Returns the command id at the specified |index| or -1 if not found due to + // invalid range or the index being a separator. + /// + int (CEF_CALLBACK *get_command_id_at)(struct _cef_menu_model_t* self, + int index); + + /// + // Sets the command id at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_command_id_at)(struct _cef_menu_model_t* self, + int index, int command_id); + + /// + // Returns the label for the specified |command_id| or NULL if not found. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_label)( + struct _cef_menu_model_t* self, int command_id); + + /// + // Returns the label at the specified |index| or NULL if not found due to + // invalid range or the index being a separator. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_label_at)( + struct _cef_menu_model_t* self, int index); + + /// + // Sets the label for the specified |command_id|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_label)(struct _cef_menu_model_t* self, int command_id, + const cef_string_t* label); + + /// + // Set the label at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_label_at)(struct _cef_menu_model_t* self, int index, + const cef_string_t* label); + + /// + // Returns the item type for the specified |command_id|. + /// + cef_menu_item_type_t (CEF_CALLBACK *get_type)(struct _cef_menu_model_t* self, + int command_id); + + /// + // Returns the item type at the specified |index|. + /// + cef_menu_item_type_t (CEF_CALLBACK *get_type_at)( + struct _cef_menu_model_t* self, int index); + + /// + // Returns the group id for the specified |command_id| or -1 if invalid. + /// + int (CEF_CALLBACK *get_group_id)(struct _cef_menu_model_t* self, + int command_id); + + /// + // Returns the group id at the specified |index| or -1 if invalid. + /// + int (CEF_CALLBACK *get_group_id_at)(struct _cef_menu_model_t* self, + int index); + + /// + // Sets the group id for the specified |command_id|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_group_id)(struct _cef_menu_model_t* self, + int command_id, int group_id); + + /// + // Sets the group id at the specified |index|. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_group_id_at)(struct _cef_menu_model_t* self, int index, + int group_id); + + /// + // Returns the submenu for the specified |command_id| or NULL if invalid. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu)( + struct _cef_menu_model_t* self, int command_id); + + /// + // Returns the submenu at the specified |index| or NULL if invalid. + /// + struct _cef_menu_model_t* (CEF_CALLBACK *get_sub_menu_at)( + struct _cef_menu_model_t* self, int index); + + // + // Returns true (1) if the specified |command_id| is visible. + /// + int (CEF_CALLBACK *is_visible)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| is visible. + /// + int (CEF_CALLBACK *is_visible_at)(struct _cef_menu_model_t* self, int index); + + // + // Change the visibility of the specified |command_id|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_visible)(struct _cef_menu_model_t* self, + int command_id, int visible); + + // + // Change the visibility at the specified |index|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_visible_at)(struct _cef_menu_model_t* self, int index, + int visible); + + // + // Returns true (1) if the specified |command_id| is enabled. + /// + int (CEF_CALLBACK *is_enabled)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| is enabled. + /// + int (CEF_CALLBACK *is_enabled_at)(struct _cef_menu_model_t* self, int index); + + // + // Change the enabled status of the specified |command_id|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *set_enabled)(struct _cef_menu_model_t* self, + int command_id, int enabled); + + // + // Change the enabled status at the specified |index|. Returns true (1) on + // success. + /// + int (CEF_CALLBACK *set_enabled_at)(struct _cef_menu_model_t* self, int index, + int enabled); + + // + // Returns true (1) if the specified |command_id| is checked. Only applies to + // check and radio items. + /// + int (CEF_CALLBACK *is_checked)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| is checked. Only applies to check + // and radio items. + /// + int (CEF_CALLBACK *is_checked_at)(struct _cef_menu_model_t* self, int index); + + // + // Check the specified |command_id|. Only applies to check and radio items. + // Returns true (1) on success. + /// + int (CEF_CALLBACK *set_checked)(struct _cef_menu_model_t* self, + int command_id, int checked); + + // + // Check the specified |index|. Only applies to check and radio items. Returns + // true (1) on success. + /// + int (CEF_CALLBACK *set_checked_at)(struct _cef_menu_model_t* self, int index, + int checked); + + // + // Returns true (1) if the specified |command_id| has a keyboard accelerator + // assigned. + /// + int (CEF_CALLBACK *has_accelerator)(struct _cef_menu_model_t* self, + int command_id); + + // + // Returns true (1) if the specified |index| has a keyboard accelerator + // assigned. + /// + int (CEF_CALLBACK *has_accelerator_at)(struct _cef_menu_model_t* self, + int index); + + // + // Set the keyboard accelerator for the specified |command_id|. |key_code| can + // be any virtual key or character value. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_accelerator)(struct _cef_menu_model_t* self, + int command_id, int key_code, int shift_pressed, int ctrl_pressed, + int alt_pressed); + + // + // Set the keyboard accelerator at the specified |index|. |key_code| can be + // any virtual key or character value. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_accelerator_at)(struct _cef_menu_model_t* self, + int index, int key_code, int shift_pressed, int ctrl_pressed, + int alt_pressed); + + // + // Remove the keyboard accelerator for the specified |command_id|. Returns + // true (1) on success. + /// + int (CEF_CALLBACK *remove_accelerator)(struct _cef_menu_model_t* self, + int command_id); + + // + // Remove the keyboard accelerator at the specified |index|. Returns true (1) + // on success. + /// + int (CEF_CALLBACK *remove_accelerator_at)(struct _cef_menu_model_t* self, + int index); + + // + // Retrieves the keyboard accelerator for the specified |command_id|. Returns + // true (1) on success. + /// + int (CEF_CALLBACK *get_accelerator)(struct _cef_menu_model_t* self, + int command_id, int* key_code, int* shift_pressed, int* ctrl_pressed, + int* alt_pressed); + + // + // Retrieves the keyboard accelerator for the specified |index|. Returns true + // (1) on success. + /// + int (CEF_CALLBACK *get_accelerator_at)(struct _cef_menu_model_t* self, + int index, int* key_code, int* shift_pressed, int* ctrl_pressed, + int* alt_pressed); +} cef_menu_model_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_MENU_MODEL_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_navigation_entry_capi.h b/vendor/cef3/include/capi/cef_navigation_entry_capi.h new file mode 100644 index 00000000000..cb65ac942d8 --- /dev/null +++ b/vendor/cef3/include/capi/cef_navigation_entry_capi.h @@ -0,0 +1,134 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent an entry in navigation history. +/// +typedef struct _cef_navigation_entry_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_navigation_entry_t* self); + + /// + // Returns the actual URL of the page. For some pages this may be data: URL or + // similar. Use get_display_url() to return a display-friendly version. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)( + struct _cef_navigation_entry_t* self); + + /// + // Returns a display-friendly version of the URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_display_url)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the original URL that was entered by the user before any redirects. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_original_url)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the title set by the page. This value may be NULL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_title)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the transition type which indicates what the user did to move to + // this page from the previous page. + /// + cef_transition_type_t (CEF_CALLBACK *get_transition_type)( + struct _cef_navigation_entry_t* self); + + /// + // Returns true (1) if this navigation includes post data. + /// + int (CEF_CALLBACK *has_post_data)(struct _cef_navigation_entry_t* self); + + /// + // Returns the name of the sub-frame that navigated or an NULL value if the + // main frame navigated. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_frame_name)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the time for the last known successful navigation completion. A + // navigation may be completed more than once if the page is reloaded. May be + // 0 if the navigation has not yet completed. + /// + cef_time_t (CEF_CALLBACK *get_completion_time)( + struct _cef_navigation_entry_t* self); + + /// + // Returns the HTTP status code for the last known successful navigation + // response. May be 0 if the response has not yet been received or if the + // navigation has not yet completed. + /// + int (CEF_CALLBACK *get_http_status_code)( + struct _cef_navigation_entry_t* self); +} cef_navigation_entry_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_NAVIGATION_ENTRY_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_origin_whitelist_capi.h b/vendor/cef3/include/capi/cef_origin_whitelist_capi.h new file mode 100644 index 00000000000..00ed36133b5 --- /dev/null +++ b/vendor/cef3/include/capi/cef_origin_whitelist_capi.h @@ -0,0 +1,106 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Add an entry to the cross-origin access whitelist. +// +// The same-origin policy restricts how scripts hosted from different origins +// (scheme + domain + port) can communicate. By default, scripts can only access +// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes +// (but no other schemes) can use the "Access-Control-Allow-Origin" header to +// allow cross-origin requests. For example, https://source.example.com can make +// XMLHttpRequest requests on http://target.example.com if the +// http://target.example.com request returns an "Access-Control-Allow-Origin: +// https://source.example.com" response header. +// +// Scripts in separate frames or iframes and hosted from the same protocol and +// domain suffix can execute cross-origin JavaScript if both pages set the +// document.domain value to the same domain suffix. For example, +// scheme://foo.example.com and scheme://bar.example.com can communicate using +// JavaScript if both domains set document.domain="example.com". +// +// This function is used to allow access to origins that would otherwise violate +// the same-origin policy. Scripts hosted underneath the fully qualified +// |source_origin| URL (like http://www.example.com) will be allowed access to +// all resources hosted on the specified |target_protocol| and |target_domain|. +// If |target_domain| is non-NULL and |allow_target_subdomains| if false (0) +// only exact domain matches will be allowed. If |target_domain| contains a top- +// level domain component (like "example.com") and |allow_target_subdomains| is +// true (1) sub-domain matches will be allowed. If |target_domain| is NULL and +// |allow_target_subdomains| if true (1) all domains and IP addresses will be +// allowed. +// +// This function cannot be used to bypass the restrictions on local or display +// isolated schemes. See the comments on CefRegisterCustomScheme for more +// information. +// +// This function may be called on any thread. Returns false (0) if +// |source_origin| is invalid or the whitelist cannot be accessed. +/// +CEF_EXPORT int cef_add_cross_origin_whitelist_entry( + const cef_string_t* source_origin, const cef_string_t* target_protocol, + const cef_string_t* target_domain, int allow_target_subdomains); + +/// +// Remove an entry from the cross-origin access whitelist. Returns false (0) if +// |source_origin| is invalid or the whitelist cannot be accessed. +/// +CEF_EXPORT int cef_remove_cross_origin_whitelist_entry( + const cef_string_t* source_origin, const cef_string_t* target_protocol, + const cef_string_t* target_domain, int allow_target_subdomains); + +/// +// Remove all entries from the cross-origin access whitelist. Returns false (0) +// if the whitelist cannot be accessed. +/// +CEF_EXPORT int cef_clear_cross_origin_whitelist(); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_ORIGIN_WHITELIST_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_path_util_capi.h b/vendor/cef3/include/capi/cef_path_util_capi.h new file mode 100644 index 00000000000..a81f897f8f9 --- /dev/null +++ b/vendor/cef3/include/capi/cef_path_util_capi.h @@ -0,0 +1,58 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Retrieve the path associated with the specified |key|. Returns true (1) on +// success. Can be called on any thread in the browser process. +/// +CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PATH_UTIL_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_print_handler_capi.h b/vendor/cef3/include/capi/cef_print_handler_capi.h new file mode 100644 index 00000000000..4e12aeb5706 --- /dev/null +++ b/vendor/cef3/include/capi/cef_print_handler_capi.h @@ -0,0 +1,134 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_print_settings_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure for asynchronous continuation of print dialog requests. +/// +typedef struct _cef_print_dialog_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue printing with the specified |settings|. + /// + void (CEF_CALLBACK *cont)(struct _cef_print_dialog_callback_t* self, + struct _cef_print_settings_t* settings); + + /// + // Cancel the printing. + /// + void (CEF_CALLBACK *cancel)(struct _cef_print_dialog_callback_t* self); +} cef_print_dialog_callback_t; + + +/// +// Callback structure for asynchronous continuation of print job requests. +/// +typedef struct _cef_print_job_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Indicate completion of the print job. + /// + void (CEF_CALLBACK *cont)(struct _cef_print_job_callback_t* self); +} cef_print_job_callback_t; + + +/// +// Implement this structure to handle printing on Linux. The functions of this +// structure will be called on the browser process UI thread. +/// +typedef struct _cef_print_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Synchronize |settings| with client state. If |get_defaults| is true (1) + // then populate |settings| with the default print settings. Do not keep a + // reference to |settings| outside of this callback. + /// + void (CEF_CALLBACK *on_print_settings)(struct _cef_print_handler_t* self, + struct _cef_print_settings_t* settings, int get_defaults); + + /// + // Show the print dialog. Execute |callback| once the dialog is dismissed. + // Return true (1) if the dialog will be displayed or false (0) to cancel the + // printing immediately. + /// + int (CEF_CALLBACK *on_print_dialog)(struct _cef_print_handler_t* self, + int has_selection, struct _cef_print_dialog_callback_t* callback); + + /// + // Send the print job to the printer. Execute |callback| once the job is + // completed. Return true (1) if the job will proceed or false (0) to cancel + // the job immediately. + /// + int (CEF_CALLBACK *on_print_job)(struct _cef_print_handler_t* self, + const cef_string_t* document_name, const cef_string_t* pdf_file_path, + struct _cef_print_job_callback_t* callback); + + /// + // Reset client state related to printing. + /// + void (CEF_CALLBACK *on_print_reset)(struct _cef_print_handler_t* self); +} cef_print_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_print_settings_capi.h b/vendor/cef3/include/capi/cef_print_settings_capi.h new file mode 100644 index 00000000000..e38da68e53b --- /dev/null +++ b/vendor/cef3/include/capi/cef_print_settings_capi.h @@ -0,0 +1,207 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure representing print settings. +/// +typedef struct _cef_print_settings_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_print_settings_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_print_settings_t* self); + + /// + // Returns a writable copy of this object. + /// + struct _cef_print_settings_t* (CEF_CALLBACK *copy)( + struct _cef_print_settings_t* self); + + /// + // Set the page orientation. + /// + void (CEF_CALLBACK *set_orientation)(struct _cef_print_settings_t* self, + int landscape); + + /// + // Returns true (1) if the orientation is landscape. + /// + int (CEF_CALLBACK *is_landscape)(struct _cef_print_settings_t* self); + + /// + // Set the printer printable area in device units. Some platforms already + // provide flipped area. Set |landscape_needs_flip| to false (0) on those + // platforms to avoid double flipping. + /// + void (CEF_CALLBACK *set_printer_printable_area)( + struct _cef_print_settings_t* self, + const cef_size_t* physical_size_device_units, + const cef_rect_t* printable_area_device_units, + int landscape_needs_flip); + + /// + // Set the device name. + /// + void (CEF_CALLBACK *set_device_name)(struct _cef_print_settings_t* self, + const cef_string_t* name); + + /// + // Get the device name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_device_name)( + struct _cef_print_settings_t* self); + + /// + // Set the DPI (dots per inch). + /// + void (CEF_CALLBACK *set_dpi)(struct _cef_print_settings_t* self, int dpi); + + /// + // Get the DPI (dots per inch). + /// + int (CEF_CALLBACK *get_dpi)(struct _cef_print_settings_t* self); + + /// + // Set the page ranges. + /// + void (CEF_CALLBACK *set_page_ranges)(struct _cef_print_settings_t* self, + size_t rangesCount, cef_page_range_t const* ranges); + + /// + // Returns the number of page ranges that currently exist. + /// + size_t (CEF_CALLBACK *get_page_ranges_count)( + struct _cef_print_settings_t* self); + + /// + // Retrieve the page ranges. + /// + void (CEF_CALLBACK *get_page_ranges)(struct _cef_print_settings_t* self, + size_t* rangesCount, cef_page_range_t* ranges); + + /// + // Set whether only the selection will be printed. + /// + void (CEF_CALLBACK *set_selection_only)(struct _cef_print_settings_t* self, + int selection_only); + + /// + // Returns true (1) if only the selection will be printed. + /// + int (CEF_CALLBACK *is_selection_only)(struct _cef_print_settings_t* self); + + /// + // Set whether pages will be collated. + /// + void (CEF_CALLBACK *set_collate)(struct _cef_print_settings_t* self, + int collate); + + /// + // Returns true (1) if pages will be collated. + /// + int (CEF_CALLBACK *will_collate)(struct _cef_print_settings_t* self); + + /// + // Set the color model. + /// + void (CEF_CALLBACK *set_color_model)(struct _cef_print_settings_t* self, + cef_color_model_t model); + + /// + // Get the color model. + /// + cef_color_model_t (CEF_CALLBACK *get_color_model)( + struct _cef_print_settings_t* self); + + /// + // Set the number of copies. + /// + void (CEF_CALLBACK *set_copies)(struct _cef_print_settings_t* self, + int copies); + + /// + // Get the number of copies. + /// + int (CEF_CALLBACK *get_copies)(struct _cef_print_settings_t* self); + + /// + // Set the duplex mode. + /// + void (CEF_CALLBACK *set_duplex_mode)(struct _cef_print_settings_t* self, + cef_duplex_mode_t mode); + + /// + // Get the duplex mode. + /// + cef_duplex_mode_t (CEF_CALLBACK *get_duplex_mode)( + struct _cef_print_settings_t* self); +} cef_print_settings_t; + + +/// +// Create a new cef_print_settings_t object. +/// +CEF_EXPORT cef_print_settings_t* cef_print_settings_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PRINT_SETTINGS_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_process_message_capi.h b/vendor/cef3/include/capi/cef_process_message_capi.h new file mode 100644 index 00000000000..fd35b6b6b96 --- /dev/null +++ b/vendor/cef3/include/capi/cef_process_message_capi.h @@ -0,0 +1,102 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_values_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure representing a message. Can be used on any process and thread. +/// +typedef struct _cef_process_message_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_process_message_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_process_message_t* self); + + /// + // Returns a writable copy of this object. + /// + struct _cef_process_message_t* (CEF_CALLBACK *copy)( + struct _cef_process_message_t* self); + + /// + // Returns the message name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)( + struct _cef_process_message_t* self); + + /// + // Returns the list of arguments. + /// + struct _cef_list_value_t* (CEF_CALLBACK *get_argument_list)( + struct _cef_process_message_t* self); +} cef_process_message_t; + + +/// +// Create a new cef_process_message_t object with the specified name. +/// +CEF_EXPORT cef_process_message_t* cef_process_message_create( + const cef_string_t* name); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PROCESS_MESSAGE_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_process_util_capi.h b/vendor/cef3/include/capi/cef_process_util_capi.h new file mode 100644 index 00000000000..2d90d30acd8 --- /dev/null +++ b/vendor/cef3/include/capi/cef_process_util_capi.h @@ -0,0 +1,64 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Launches the process specified via |command_line|. Returns true (1) upon +// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. +// +// Unix-specific notes: - All file descriptors open in the parent process will +// be closed in the +// child process except for stdin, stdout, and stderr. +// - If the first argument on the command line does not contain a slash, +// PATH will be searched. (See man execvp.) +/// +CEF_EXPORT int cef_launch_process(struct _cef_command_line_t* command_line); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_PROCESS_UTIL_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_render_handler_capi.h b/vendor/cef3/include/capi/cef_render_handler_capi.h new file mode 100644 index 00000000000..6245f9dbd2e --- /dev/null +++ b/vendor/cef3/include/capi/cef_render_handler_capi.h @@ -0,0 +1,166 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_drag_data_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to handle events when window rendering is disabled. +// The functions of this structure will be called on the UI thread. +/// +typedef struct _cef_render_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to retrieve the root window rectangle in screen coordinates. Return + // true (1) if the rectangle was provided. + /// + int (CEF_CALLBACK *get_root_screen_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_rect_t* rect); + + /// + // Called to retrieve the view rectangle which is relative to screen + // coordinates. Return true (1) if the rectangle was provided. + /// + int (CEF_CALLBACK *get_view_rect)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_rect_t* rect); + + /// + // Called to retrieve the translation from view coordinates to actual screen + // coordinates. Return true (1) if the screen coordinates were provided. + /// + int (CEF_CALLBACK *get_screen_point)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, int viewX, int viewY, int* screenX, + int* screenY); + + /// + // Called to allow the client to fill in the CefScreenInfo object with + // appropriate values. Return true (1) if the |screen_info| structure has been + // modified. + // + // If the screen info rectangle is left NULL the rectangle from GetViewRect + // will be used. If the rectangle is still NULL or invalid popups may not be + // drawn correctly. + /// + int (CEF_CALLBACK *get_screen_info)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, struct _cef_screen_info_t* screen_info); + + /// + // Called when the browser wants to show or hide the popup widget. The popup + // should be shown if |show| is true (1) and hidden if |show| is false (0). + /// + void (CEF_CALLBACK *on_popup_show)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, int show); + + /// + // Called when the browser wants to move or resize the popup widget. |rect| + // contains the new location and size. + /// + void (CEF_CALLBACK *on_popup_size)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, const cef_rect_t* rect); + + /// + // Called when an element should be painted. |type| indicates whether the + // element is the view or the popup widget. |buffer| contains the pixel data + // for the whole image. |dirtyRects| contains the set of rectangles that need + // to be repainted. |buffer| will be |width|*|height|*4 bytes in size and + // represents a BGRA image with an upper-left origin. + /// + void (CEF_CALLBACK *on_paint)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_paint_element_type_t type, + size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer, + int width, int height); + + /// + // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then + // |custom_cursor_info| will be populated with the custom cursor information. + /// + void (CEF_CALLBACK *on_cursor_change)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_cursor_handle_t cursor, + cef_cursor_type_t type, + const struct _cef_cursor_info_t* custom_cursor_info); + + /// + // Called when the user starts dragging content in the web view. Contextual + // information about the dragged content is supplied by |drag_data|. OS APIs + // that run a system message loop may be used within the StartDragging call. + // + // Return false (0) to abort the drag operation. Don't call any of + // cef_browser_host_t::DragSource*Ended* functions after returning false (0). + // + // Return true (1) to handle the drag operation. Call + // cef_browser_host_t::DragSourceEndedAt and DragSourceSystemDragEnded either + // synchronously or asynchronously to inform the web view that the drag + // operation has ended. + /// + int (CEF_CALLBACK *start_dragging)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, struct _cef_drag_data_t* drag_data, + cef_drag_operations_mask_t allowed_ops, int x, int y); + + /// + // Called when the web view wants to update the mouse cursor during a drag & + // drop operation. |operation| describes the allowed operation (none, move, + // copy, link). + /// + void (CEF_CALLBACK *update_drag_cursor)(struct _cef_render_handler_t* self, + struct _cef_browser_t* browser, cef_drag_operations_mask_t operation); + + /// + // Called when the scroll offset has changed. + /// + void (CEF_CALLBACK *on_scroll_offset_changed)( + struct _cef_render_handler_t* self, struct _cef_browser_t* browser); +} cef_render_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RENDER_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_render_process_handler_capi.h b/vendor/cef3/include/capi/cef_render_process_handler_capi.h new file mode 100644 index 00000000000..6593108e280 --- /dev/null +++ b/vendor/cef3/include/capi/cef_render_process_handler_capi.h @@ -0,0 +1,177 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_dom_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_load_handler_capi.h" +#include "include/capi/cef_process_message_capi.h" +#include "include/capi/cef_v8_capi.h" +#include "include/capi/cef_values_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement render process callbacks. The functions of this +// structure will be called on the render process main thread (TID_RENDERER) +// unless otherwise indicated. +/// +typedef struct _cef_render_process_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called after the render process main thread has been created. |extra_info| + // is a read-only value originating from + // cef_browser_process_handler_t::on_render_process_thread_created(). Do not + // keep a reference to |extra_info| outside of this function. + /// + void (CEF_CALLBACK *on_render_thread_created)( + struct _cef_render_process_handler_t* self, + struct _cef_list_value_t* extra_info); + + /// + // Called after WebKit has been initialized. + /// + void (CEF_CALLBACK *on_web_kit_initialized)( + struct _cef_render_process_handler_t* self); + + /// + // Called after a browser has been created. When browsing cross-origin a new + // browser will be created before the old browser with the same identifier is + // destroyed. + /// + void (CEF_CALLBACK *on_browser_created)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Called before a browser is destroyed. + /// + void (CEF_CALLBACK *on_browser_destroyed)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser); + + /// + // Return the handler for browser load status events. + /// + struct _cef_load_handler_t* (CEF_CALLBACK *get_load_handler)( + struct _cef_render_process_handler_t* self); + + /// + // Called before browser navigation. Return true (1) to cancel the navigation + // or false (0) to allow the navigation to proceed. The |request| object + // cannot be modified in this callback. + /// + int (CEF_CALLBACK *on_before_navigation)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_request_t* request, cef_navigation_type_t navigation_type, + int is_redirect); + + /// + // Called immediately after the V8 context for a frame has been created. To + // retrieve the JavaScript 'window' object use the + // cef_v8context_t::get_global() function. V8 handles can only be accessed + // from the thread on which they are created. A task runner for posting tasks + // on the associated thread can be retrieved via the + // cef_v8context_t::get_task_runner() function. + /// + void (CEF_CALLBACK *on_context_created)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_v8context_t* context); + + /// + // Called immediately before the V8 context for a frame is released. No + // references to the context should be kept after this function is called. + /// + void (CEF_CALLBACK *on_context_released)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_v8context_t* context); + + /// + // Called for global uncaught exceptions in a frame. Execution of this + // callback is disabled by default. To enable set + // CefSettings.uncaught_exception_stack_size > 0. + /// + void (CEF_CALLBACK *on_uncaught_exception)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_v8context_t* context, struct _cef_v8exception_t* exception, + struct _cef_v8stack_trace_t* stackTrace); + + /// + // Called when a new node in the the browser gets focus. The |node| value may + // be NULL if no specific node has gained focus. The node object passed to + // this function represents a snapshot of the DOM at the time this function is + // executed. DOM objects are only valid for the scope of this function. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this function. + /// + void (CEF_CALLBACK *on_focused_node_changed)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_domnode_t* node); + + /// + // Called when a new message is received from a different process. Return true + // (1) if the message was handled or false (0) otherwise. Do not keep a + // reference to or attempt to access the message outside of this callback. + /// + int (CEF_CALLBACK *on_process_message_received)( + struct _cef_render_process_handler_t* self, + struct _cef_browser_t* browser, cef_process_id_t source_process, + struct _cef_process_message_t* message); +} cef_render_process_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RENDER_PROCESS_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_request_capi.h b/vendor/cef3/include/capi/cef_request_capi.h new file mode 100644 index 00000000000..f0532654cd7 --- /dev/null +++ b/vendor/cef3/include/capi/cef_request_capi.h @@ -0,0 +1,293 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_post_data_element_t; +struct _cef_post_data_t; + +/// +// Structure used to represent a web request. The functions of this structure +// may be called on any thread. +/// +typedef struct _cef_request_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_request_t* self); + + /// + // Get the fully qualified URL. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_url)(struct _cef_request_t* self); + + /// + // Set the fully qualified URL. + /// + void (CEF_CALLBACK *set_url)(struct _cef_request_t* self, + const cef_string_t* url); + + /// + // Get the request function type. The value will default to POST if post data + // is provided and GET otherwise. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_method)(struct _cef_request_t* self); + + /// + // Set the request function type. + /// + void (CEF_CALLBACK *set_method)(struct _cef_request_t* self, + const cef_string_t* method); + + /// + // Get the post data. + /// + struct _cef_post_data_t* (CEF_CALLBACK *get_post_data)( + struct _cef_request_t* self); + + /// + // Set the post data. + /// + void (CEF_CALLBACK *set_post_data)(struct _cef_request_t* self, + struct _cef_post_data_t* postData); + + /// + // Get the header values. + /// + void (CEF_CALLBACK *get_header_map)(struct _cef_request_t* self, + cef_string_multimap_t headerMap); + + /// + // Set the header values. + /// + void (CEF_CALLBACK *set_header_map)(struct _cef_request_t* self, + cef_string_multimap_t headerMap); + + /// + // Set all values at one time. + /// + void (CEF_CALLBACK *set)(struct _cef_request_t* self, const cef_string_t* url, + const cef_string_t* method, struct _cef_post_data_t* postData, + cef_string_multimap_t headerMap); + + /// + // Get the flags used in combination with cef_urlrequest_t. See + // cef_urlrequest_flags_t for supported values. + /// + int (CEF_CALLBACK *get_flags)(struct _cef_request_t* self); + + /// + // Set the flags used in combination with cef_urlrequest_t. See + // cef_urlrequest_flags_t for supported values. + /// + void (CEF_CALLBACK *set_flags)(struct _cef_request_t* self, int flags); + + /// + // Set the URL to the first party for cookies used in combination with + // cef_urlrequest_t. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_first_party_for_cookies)( + struct _cef_request_t* self); + + /// + // Get the URL to the first party for cookies used in combination with + // cef_urlrequest_t. + /// + void (CEF_CALLBACK *set_first_party_for_cookies)(struct _cef_request_t* self, + const cef_string_t* url); + + /// + // Get the resource type for this request. Only available in the browser + // process. + /// + cef_resource_type_t (CEF_CALLBACK *get_resource_type)( + struct _cef_request_t* self); + + /// + // Get the transition type for this request. Only available in the browser + // process and only applies to requests that represent a main frame or sub- + // frame navigation. + /// + cef_transition_type_t (CEF_CALLBACK *get_transition_type)( + struct _cef_request_t* self); +} cef_request_t; + + +/// +// Create a new cef_request_t object. +/// +CEF_EXPORT cef_request_t* cef_request_create(); + + +/// +// Structure used to represent post data for a web request. The functions of +// this structure may be called on any thread. +/// +typedef struct _cef_post_data_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_t* self); + + /// + // Returns the number of existing post data elements. + /// + size_t (CEF_CALLBACK *get_element_count)(struct _cef_post_data_t* self); + + /// + // Retrieve the post data elements. + /// + void (CEF_CALLBACK *get_elements)(struct _cef_post_data_t* self, + size_t* elementsCount, struct _cef_post_data_element_t** elements); + + /// + // Remove the specified post data element. Returns true (1) if the removal + // succeeds. + /// + int (CEF_CALLBACK *remove_element)(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element); + + /// + // Add the specified post data element. Returns true (1) if the add succeeds. + /// + int (CEF_CALLBACK *add_element)(struct _cef_post_data_t* self, + struct _cef_post_data_element_t* element); + + /// + // Remove all existing post data elements. + /// + void (CEF_CALLBACK *remove_elements)(struct _cef_post_data_t* self); +} cef_post_data_t; + + +/// +// Create a new cef_post_data_t object. +/// +CEF_EXPORT cef_post_data_t* cef_post_data_create(); + + +/// +// Structure used to represent a single element in the request post data. The +// functions of this structure may be called on any thread. +/// +typedef struct _cef_post_data_element_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_post_data_element_t* self); + + /// + // Remove all contents from the post data element. + /// + void (CEF_CALLBACK *set_to_empty)(struct _cef_post_data_element_t* self); + + /// + // The post data element will represent a file. + /// + void (CEF_CALLBACK *set_to_file)(struct _cef_post_data_element_t* self, + const cef_string_t* fileName); + + /// + // The post data element will represent bytes. The bytes passed in will be + // copied. + /// + void (CEF_CALLBACK *set_to_bytes)(struct _cef_post_data_element_t* self, + size_t size, const void* bytes); + + /// + // Return the type of this post data element. + /// + cef_postdataelement_type_t (CEF_CALLBACK *get_type)( + struct _cef_post_data_element_t* self); + + /// + // Return the file name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file)( + struct _cef_post_data_element_t* self); + + /// + // Return the number of bytes. + /// + size_t (CEF_CALLBACK *get_bytes_count)(struct _cef_post_data_element_t* self); + + /// + // Read up to |size| bytes into |bytes| and return the number of bytes + // actually read. + /// + size_t (CEF_CALLBACK *get_bytes)(struct _cef_post_data_element_t* self, + size_t size, void* bytes); +} cef_post_data_element_t; + + +/// +// Create a new cef_post_data_element_t object. +/// +CEF_EXPORT cef_post_data_element_t* cef_post_data_element_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_request_context_capi.h b/vendor/cef3/include/capi/cef_request_context_capi.h new file mode 100644 index 00000000000..e6c40d040b8 --- /dev/null +++ b/vendor/cef3/include/capi/cef_request_context_capi.h @@ -0,0 +1,105 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ +#pragma once + +#include "include/capi/cef_request_context_handler_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// A request context provides request handling for a set of related browser +// objects. A request context is specified when creating a new browser object +// via the cef_browser_host_t static factory functions. Browser objects with +// different request contexts will never be hosted in the same render process. +// Browser objects with the same request context may or may not be hosted in the +// same render process depending on the process model. Browser objects created +// indirectly via the JavaScript window.open function or targeted links will +// share the same render process and the same request context as the source +// browser. When running in single-process mode there is only a single render +// process (the main process) and so all browsers created in single-process mode +// will share the same request context. This will be the first request context +// passed into a cef_browser_host_t static factory function and all other +// request context objects will be ignored. +/// +typedef struct _cef_request_context_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is pointing to the same context as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_request_context_t* self, + struct _cef_request_context_t* other); + + /// + // Returns true (1) if this object is the global context. + /// + int (CEF_CALLBACK *is_global)(struct _cef_request_context_t* self); + + /// + // Returns the handler for this context if any. + /// + struct _cef_request_context_handler_t* (CEF_CALLBACK *get_handler)( + struct _cef_request_context_t* self); +} cef_request_context_t; + + +/// +// Returns the global context object. +/// +CEF_EXPORT cef_request_context_t* cef_request_context_get_global_context(); + +/// +// Creates a new context object with the specified handler. +/// +CEF_EXPORT cef_request_context_t* cef_request_context_create_context( + struct _cef_request_context_handler_t* handler); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_request_context_handler_capi.h b/vendor/cef3/include/capi/cef_request_context_handler_capi.h new file mode 100644 index 00000000000..326701ae77c --- /dev/null +++ b/vendor/cef3/include/capi/cef_request_context_handler_capi.h @@ -0,0 +1,71 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_cookie_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to provide handler implementations. +/// +typedef struct _cef_request_context_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the IO thread to retrieve the cookie manager. The global cookie + // manager will be used if this function returns NULL. + /// + struct _cef_cookie_manager_t* (CEF_CALLBACK *get_cookie_manager)( + struct _cef_request_context_handler_t* self); +} cef_request_context_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_request_handler_capi.h b/vendor/cef3/include/capi/cef_request_handler_capi.h new file mode 100644 index 00000000000..bdd5da0c7ee --- /dev/null +++ b/vendor/cef3/include/capi/cef_request_handler_capi.h @@ -0,0 +1,226 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_auth_callback_capi.h" +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_resource_handler_capi.h" +#include "include/capi/cef_response_capi.h" +#include "include/capi/cef_web_plugin_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Callback structure used for asynchronous continuation of quota requests. +/// +typedef struct _cef_quota_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the quota request. If |allow| is true (1) the request will be + // allowed. Otherwise, the request will be denied. + /// + void (CEF_CALLBACK *cont)(struct _cef_quota_callback_t* self, int allow); + + /// + // Cancel the quota request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_quota_callback_t* self); +} cef_quota_callback_t; + + +/// +// Callback structure used for asynchronous continuation of url requests when +// invalid SSL certificates are encountered. +/// +typedef struct _cef_allow_certificate_error_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Continue the url request. If |allow| is true (1) the request will be + // continued. Otherwise, the request will be canceled. + /// + void (CEF_CALLBACK *cont)( + struct _cef_allow_certificate_error_callback_t* self, int allow); +} cef_allow_certificate_error_callback_t; + + +/// +// Implement this structure to handle events related to browser requests. The +// functions of this structure will be called on the thread indicated. +/// +typedef struct _cef_request_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called on the UI thread before browser navigation. Return true (1) to + // cancel the navigation or false (0) to allow the navigation to proceed. The + // |request| object cannot be modified in this callback. + // cef_load_handler_t::OnLoadingStateChange will be called twice in all cases. + // If the navigation is allowed cef_load_handler_t::OnLoadStart and + // cef_load_handler_t::OnLoadEnd will be called. If the navigation is canceled + // cef_load_handler_t::OnLoadError will be called with an |errorCode| value of + // ERR_ABORTED. + /// + int (CEF_CALLBACK *on_before_browse)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + struct _cef_request_t* request, int is_redirect); + + /// + // Called on the IO thread before a resource request is loaded. The |request| + // object may be modified. To cancel the request return true (1) otherwise + // return false (0). + /// + int (CEF_CALLBACK *on_before_resource_load)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_request_t* request); + + /// + // Called on the IO thread before a resource is loaded. To allow the resource + // to load normally return NULL. To specify a handler for the resource return + // a cef_resource_handler_t object. The |request| object should not be + // modified in this callback. + /// + struct _cef_resource_handler_t* (CEF_CALLBACK *get_resource_handler)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_request_t* request); + + /// + // Called on the IO thread when a resource load is redirected. The |old_url| + // parameter will contain the old URL. The |new_url| parameter will contain + // the new URL and can be changed if desired. + /// + void (CEF_CALLBACK *on_resource_redirect)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* old_url, cef_string_t* new_url); + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true (1) to continue + // the request and call cef_auth_callback_t::cont() when the authentication + // information is available. Return false (0) to cancel the request. + /// + int (CEF_CALLBACK *get_auth_credentials)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, int isProxy, + const cef_string_t* host, int port, const cef_string_t* realm, + const cef_string_t* scheme, struct _cef_auth_callback_t* callback); + + /// + // Called on the IO thread when JavaScript requests a specific storage quota + // size via the webkitStorageInfo.requestQuota function. |origin_url| is the + // origin of the page making the request. |new_size| is the requested quota + // size in bytes. Return true (1) and call cef_quota_callback_t::cont() either + // in this function or at a later time to grant or deny the request. Return + // false (0) to cancel the request. + /// + int (CEF_CALLBACK *on_quota_request)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* origin_url, + int64 new_size, struct _cef_quota_callback_t* callback); + + /// + // Called on the UI thread to handle requests for URLs with an unknown + // protocol component. Set |allow_os_execution| to true (1) to attempt + // execution via the registered OS protocol handler, if any. SECURITY WARNING: + // YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED ON SCHEME, HOST OR + // OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. + /// + void (CEF_CALLBACK *on_protocol_execution)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + const cef_string_t* url, int* allow_os_execution); + + /// + // Called on the UI thread to handle requests for URLs with an invalid SSL + // certificate. Return true (1) and call + // cef_allow_certificate_error_callback_t:: cont() either in this function or + // at a later time to continue or cancel the request. Return false (0) to + // cancel the request immediately. If |callback| is NULL the error cannot be + // recovered from and the request will be canceled automatically. If + // CefSettings.ignore_certificate_errors is set all invalid certificates will + // be accepted without calling this function. + /// + int (CEF_CALLBACK *on_certificate_error)(struct _cef_request_handler_t* self, + cef_errorcode_t cert_error, const cef_string_t* request_url, + struct _cef_allow_certificate_error_callback_t* callback); + + /// + // Called on the browser process IO thread before a plugin is loaded. Return + // true (1) to block loading of the plugin. + /// + int (CEF_CALLBACK *on_before_plugin_load)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* url, + const cef_string_t* policy_url, struct _cef_web_plugin_info_t* info); + + /// + // Called on the browser process UI thread when a plugin has crashed. + // |plugin_path| is the path of the plugin that crashed. + /// + void (CEF_CALLBACK *on_plugin_crashed)(struct _cef_request_handler_t* self, + struct _cef_browser_t* browser, const cef_string_t* plugin_path); + + /// + // Called on the browser process UI thread when the render process terminates + // unexpectedly. |status| indicates how the process terminated. + /// + void (CEF_CALLBACK *on_render_process_terminated)( + struct _cef_request_handler_t* self, struct _cef_browser_t* browser, + cef_termination_status_t status); +} cef_request_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_resource_bundle_handler_capi.h b/vendor/cef3/include/capi/cef_resource_bundle_handler_capi.h new file mode 100644 index 00000000000..e0ea76bc6b4 --- /dev/null +++ b/vendor/cef3/include/capi/cef_resource_bundle_handler_capi.h @@ -0,0 +1,86 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement a custom resource bundle structure. The functions +// of this structure may be called on multiple threads. +/// +typedef struct _cef_resource_bundle_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called to retrieve a localized translation for the string specified by + // |message_id|. To provide the translation set |string| to the translation + // string and return true (1). To use the default translation return false + // (0). Supported message IDs are listed in cef_pack_strings.h. + /// + int (CEF_CALLBACK *get_localized_string)( + struct _cef_resource_bundle_handler_t* self, int message_id, + cef_string_t* string); + + /// + // Called to retrieve data for the resource specified by |resource_id|. To + // provide the resource data set |data| and |data_size| to the data pointer + // and size respectively and return true (1). To use the default resource data + // return false (0). The resource data will not be copied and must remain + // resident in memory. Supported resource IDs are listed in + // cef_pack_resources.h. + /// + int (CEF_CALLBACK *get_data_resource)( + struct _cef_resource_bundle_handler_t* self, int resource_id, void** data, + size_t* data_size); +} cef_resource_bundle_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_resource_handler_capi.h b/vendor/cef3/include/capi/cef_resource_handler_capi.h new file mode 100644 index 00000000000..24bba9b4190 --- /dev/null +++ b/vendor/cef3/include/capi/cef_resource_handler_capi.h @@ -0,0 +1,124 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_callback_capi.h" +#include "include/capi/cef_cookie_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_response_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to implement a custom request handler structure. The functions +// of this structure will always be called on the IO thread. +/// +typedef struct _cef_resource_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Begin processing the request. To handle the request return true (1) and + // call cef_callback_t::cont() once the response header information is + // available (cef_callback_t::cont() can also be called from inside this + // function if header information is available immediately). To cancel the + // request return false (0). + /// + int (CEF_CALLBACK *process_request)(struct _cef_resource_handler_t* self, + struct _cef_request_t* request, struct _cef_callback_t* callback); + + /// + // Retrieve response header information. If the response length is not known + // set |response_length| to -1 and read_response() will be called until it + // returns false (0). If the response length is known set |response_length| to + // a positive value and read_response() will be called until it returns false + // (0) or the specified number of bytes have been read. Use the |response| + // object to set the mime type, http status code and other optional header + // values. To redirect the request to a new URL set |redirectUrl| to the new + // URL. + /// + void (CEF_CALLBACK *get_response_headers)( + struct _cef_resource_handler_t* self, struct _cef_response_t* response, + int64* response_length, cef_string_t* redirectUrl); + + /// + // Read response data. If data is available immediately copy up to + // |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of + // bytes copied, and return true (1). To read the data at a later time set + // |bytes_read| to 0, return true (1) and call cef_callback_t::cont() when the + // data is available. To indicate response completion return false (0). + /// + int (CEF_CALLBACK *read_response)(struct _cef_resource_handler_t* self, + void* data_out, int bytes_to_read, int* bytes_read, + struct _cef_callback_t* callback); + + /// + // Return true (1) if the specified cookie can be sent with the request or + // false (0) otherwise. If false (0) is returned for any cookie then no + // cookies will be sent with the request. + /// + int (CEF_CALLBACK *can_get_cookie)(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie); + + /// + // Return true (1) if the specified cookie returned with the response can be + // set or false (0) otherwise. + /// + int (CEF_CALLBACK *can_set_cookie)(struct _cef_resource_handler_t* self, + const struct _cef_cookie_t* cookie); + + /// + // Request processing has been canceled. + /// + void (CEF_CALLBACK *cancel)(struct _cef_resource_handler_t* self); +} cef_resource_handler_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RESOURCE_HANDLER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_response_capi.h b/vendor/cef3/include/capi/cef_response_capi.h new file mode 100644 index 00000000000..30b3c945ce0 --- /dev/null +++ b/vendor/cef3/include/capi/cef_response_capi.h @@ -0,0 +1,130 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure used to represent a web response. The functions of this structure +// may be called on any thread. +/// +typedef struct _cef_response_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is read-only. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_response_t* self); + + /// + // Get the response status code. + /// + int (CEF_CALLBACK *get_status)(struct _cef_response_t* self); + + /// + // Set the response status code. + /// + void (CEF_CALLBACK *set_status)(struct _cef_response_t* self, int status); + + /// + // Get the response status text. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_status_text)( + struct _cef_response_t* self); + + /// + // Set the response status text. + /// + void (CEF_CALLBACK *set_status_text)(struct _cef_response_t* self, + const cef_string_t* statusText); + + /// + // Get the response mime type. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_mime_type)( + struct _cef_response_t* self); + + /// + // Set the response mime type. + /// + void (CEF_CALLBACK *set_mime_type)(struct _cef_response_t* self, + const cef_string_t* mimeType); + + /// + // Get the value for the specified response header field. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_header)(struct _cef_response_t* self, + const cef_string_t* name); + + /// + // Get all response header fields. + /// + void (CEF_CALLBACK *get_header_map)(struct _cef_response_t* self, + cef_string_multimap_t headerMap); + + /// + // Set all response header fields. + /// + void (CEF_CALLBACK *set_header_map)(struct _cef_response_t* self, + cef_string_multimap_t headerMap); +} cef_response_t; + + +/// +// Create a new cef_response_t object. +/// +CEF_EXPORT cef_response_t* cef_response_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_RESPONSE_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_scheme_capi.h b/vendor/cef3/include/capi/cef_scheme_capi.h new file mode 100644 index 00000000000..e993be243e4 --- /dev/null +++ b/vendor/cef3/include/capi/cef_scheme_capi.h @@ -0,0 +1,168 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_resource_handler_capi.h" +#include "include/capi/cef_response_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_scheme_handler_factory_t; + +/// +// Structure that manages custom scheme registrations. +/// +typedef struct _cef_scheme_registrar_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Register a custom scheme. This function should not be called for the built- + // in HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. + // + // If |is_standard| is true (1) the scheme will be treated as a standard + // scheme. Standard schemes are subject to URL canonicalization and parsing + // rules as defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 + // available at http://www.ietf.org/rfc/rfc1738.txt + // + // In particular, the syntax for standard scheme URLs must be of the form: + //
+  //  [scheme]://[username]:[password]@[host]:[port]/[url-path]
+  // 
Standard scheme URLs must have a host component that is a fully + // qualified domain name as defined in Section 3.5 of RFC 1034 [13] and + // Section 2.1 of RFC 1123. These URLs will be canonicalized to + // "scheme://host/path" in the simplest case and + // "scheme://username:password@host:port/path" in the most explicit case. For + // example, "scheme:host/path" and "scheme:///host/path" will both be + // canonicalized to "scheme://host/path". The origin of a standard scheme URL + // is the combination of scheme, host and port (i.e., "scheme://host:port" in + // the most explicit case). + // + // For non-standard scheme URLs only the "scheme:" component is parsed and + // canonicalized. The remainder of the URL will be passed to the handler as- + // is. For example, "scheme:///some%20text" will remain the same. Non-standard + // scheme URLs cannot be used as a target for form submission. + // + // If |is_local| is true (1) the scheme will be treated as local (i.e., with + // the same security rules as those applied to "file" URLs). Normal pages + // cannot link to or access local URLs. Also, by default, local URLs can only + // perform XMLHttpRequest calls to the same URL (origin + path) that + // originated the request. To allow XMLHttpRequest calls from a local URL to + // other URLs with the same origin set the + // CefSettings.file_access_from_file_urls_allowed value to true (1). To allow + // XMLHttpRequest calls from a local URL to all origins set the + // CefSettings.universal_access_from_file_urls_allowed value to true (1). + // + // If |is_display_isolated| is true (1) the scheme will be treated as display- + // isolated. This means that pages cannot display these URLs unless they are + // from the same scheme. For example, pages in another origin cannot create + // iframes or hyperlinks to URLs with this scheme. + // + // This function may be called on any thread. It should only be called once + // per unique |scheme_name| value. If |scheme_name| is already registered or + // if an error occurs this function will return false (0). + /// + int (CEF_CALLBACK *add_custom_scheme)(struct _cef_scheme_registrar_t* self, + const cef_string_t* scheme_name, int is_standard, int is_local, + int is_display_isolated); +} cef_scheme_registrar_t; + + +/// +// Structure that creates cef_resource_handler_t instances for handling scheme +// requests. The functions of this structure will always be called on the IO +// thread. +/// +typedef struct _cef_scheme_handler_factory_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Return a new resource handler instance to handle the request or an NULL + // reference to allow default handling of the request. |browser| and |frame| + // will be the browser window and frame respectively that originated the + // request or NULL if the request did not originate from a browser window (for + // example, if the request came from cef_urlrequest_t). The |request| object + // passed to this function will not contain cookie data. + /// + struct _cef_resource_handler_t* (CEF_CALLBACK *create)( + struct _cef_scheme_handler_factory_t* self, + struct _cef_browser_t* browser, struct _cef_frame_t* frame, + const cef_string_t* scheme_name, struct _cef_request_t* request); +} cef_scheme_handler_factory_t; + + +/// +// Register a scheme handler factory for the specified |scheme_name| and +// optional |domain_name|. An NULL |domain_name| value for a standard scheme +// will cause the factory to match all domain names. The |domain_name| value +// will be ignored for non-standard schemes. If |scheme_name| is a built-in +// scheme and no handler is returned by |factory| then the built-in scheme +// handler factory will be called. If |scheme_name| is a custom scheme then also +// implement the cef_app_t::on_register_custom_schemes() function in all +// processes. This function may be called multiple times to change or remove the +// factory that matches the specified |scheme_name| and optional |domain_name|. +// Returns false (0) if an error occurs. This function may be called on any +// thread in the browser process. +/// +CEF_EXPORT int cef_register_scheme_handler_factory( + const cef_string_t* scheme_name, const cef_string_t* domain_name, + cef_scheme_handler_factory_t* factory); + +/// +// Clear all registered scheme handler factories. Returns false (0) on error. +// This function may be called on any thread in the browser process. +/// +CEF_EXPORT int cef_clear_scheme_handler_factories(); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_stream_capi.h b/vendor/cef3/include/capi/cef_stream_capi.h new file mode 100644 index 00000000000..8e393b3b21f --- /dev/null +++ b/vendor/cef3/include/capi/cef_stream_capi.h @@ -0,0 +1,252 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure the client can implement to provide a custom stream reader. The +// functions of this structure may be called on any thread. +/// +typedef struct _cef_read_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Read raw binary data. + /// + size_t (CEF_CALLBACK *read)(struct _cef_read_handler_t* self, void* ptr, + size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_read_handler_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_read_handler_t* self); + + /// + // Return non-zero if at end of file. + /// + int (CEF_CALLBACK *eof)(struct _cef_read_handler_t* self); + + /// + // Return true (1) if this handler performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the handler from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_read_handler_t* self); +} cef_read_handler_t; + + +/// +// Structure used to read data from a stream. The functions of this structure +// may be called on any thread. +/// +typedef struct _cef_stream_reader_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Read raw binary data. + /// + size_t (CEF_CALLBACK *read)(struct _cef_stream_reader_t* self, void* ptr, + size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_stream_reader_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_stream_reader_t* self); + + /// + // Return non-zero if at end of file. + /// + int (CEF_CALLBACK *eof)(struct _cef_stream_reader_t* self); + + /// + // Returns true (1) if this reader performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the reader from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_stream_reader_t* self); +} cef_stream_reader_t; + + +/// +// Create a new cef_stream_reader_t object from a file. +/// +CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_file( + const cef_string_t* fileName); + +/// +// Create a new cef_stream_reader_t object from data. +/// +CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_data(void* data, + size_t size); + +/// +// Create a new cef_stream_reader_t object from a custom handler. +/// +CEF_EXPORT cef_stream_reader_t* cef_stream_reader_create_for_handler( + cef_read_handler_t* handler); + + +/// +// Structure the client can implement to provide a custom stream writer. The +// functions of this structure may be called on any thread. +/// +typedef struct _cef_write_handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Write raw binary data. + /// + size_t (CEF_CALLBACK *write)(struct _cef_write_handler_t* self, + const void* ptr, size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Return zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_write_handler_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_write_handler_t* self); + + /// + // Flush the stream. + /// + int (CEF_CALLBACK *flush)(struct _cef_write_handler_t* self); + + /// + // Return true (1) if this handler performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the handler from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_write_handler_t* self); +} cef_write_handler_t; + + +/// +// Structure used to write data to a stream. The functions of this structure may +// be called on any thread. +/// +typedef struct _cef_stream_writer_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Write raw binary data. + /// + size_t (CEF_CALLBACK *write)(struct _cef_stream_writer_t* self, + const void* ptr, size_t size, size_t n); + + /// + // Seek to the specified offset position. |whence| may be any one of SEEK_CUR, + // SEEK_END or SEEK_SET. Returns zero on success and non-zero on failure. + /// + int (CEF_CALLBACK *seek)(struct _cef_stream_writer_t* self, int64 offset, + int whence); + + /// + // Return the current offset position. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_stream_writer_t* self); + + /// + // Flush the stream. + /// + int (CEF_CALLBACK *flush)(struct _cef_stream_writer_t* self); + + /// + // Returns true (1) if this writer performs work like accessing the file + // system which may block. Used as a hint for determining the thread to access + // the writer from. + /// + int (CEF_CALLBACK *may_block)(struct _cef_stream_writer_t* self); +} cef_stream_writer_t; + + +/// +// Create a new cef_stream_writer_t object for a file. +/// +CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_file( + const cef_string_t* fileName); + +/// +// Create a new cef_stream_writer_t object for a custom handler. +/// +CEF_EXPORT cef_stream_writer_t* cef_stream_writer_create_for_handler( + cef_write_handler_t* handler); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_STREAM_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_string_visitor_capi.h b/vendor/cef3/include/capi/cef_string_visitor_capi.h new file mode 100644 index 00000000000..f047ffe5af4 --- /dev/null +++ b/vendor/cef3/include/capi/cef_string_visitor_capi.h @@ -0,0 +1,69 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to receive string values asynchronously. +/// +typedef struct _cef_string_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be executed. + /// + void (CEF_CALLBACK *visit)(struct _cef_string_visitor_t* self, + const cef_string_t* string); +} cef_string_visitor_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_STRING_VISITOR_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_task_capi.h b/vendor/cef3/include/capi/cef_task_capi.h new file mode 100644 index 00000000000..2c803348ffe --- /dev/null +++ b/vendor/cef3/include/capi/cef_task_capi.h @@ -0,0 +1,159 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure for asynchronous task execution. If the task is +// posted successfully and if the associated message loop is still running then +// the execute() function will be called on the target thread. If the task fails +// to post then the task object may be destroyed on the source thread instead of +// the target thread. For this reason be cautious when performing work in the +// task object destructor. +/// +typedef struct _cef_task_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be executed on the target thread. + /// + void (CEF_CALLBACK *execute)(struct _cef_task_t* self); +} cef_task_t; + + +/// +// Structure that asynchronously executes tasks on the associated thread. It is +// safe to call the functions of this structure on any thread. +// +// CEF maintains multiple internal threads that are used for handling different +// types of tasks in different processes. The cef_thread_id_t definitions in +// cef_types.h list the common CEF threads. Task runners are also available for +// other CEF threads as appropriate (for example, V8 WebWorker threads). +/// +typedef struct _cef_task_runner_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is pointing to the same task runner as + // |that| object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_task_runner_t* self, + struct _cef_task_runner_t* that); + + /// + // Returns true (1) if this task runner belongs to the current thread. + /// + int (CEF_CALLBACK *belongs_to_current_thread)( + struct _cef_task_runner_t* self); + + /// + // Returns true (1) if this task runner is for the specified CEF thread. + /// + int (CEF_CALLBACK *belongs_to_thread)(struct _cef_task_runner_t* self, + cef_thread_id_t threadId); + + /// + // Post a task for execution on the thread associated with this task runner. + // Execution will occur asynchronously. + /// + int (CEF_CALLBACK *post_task)(struct _cef_task_runner_t* self, + struct _cef_task_t* task); + + /// + // Post a task for delayed execution on the thread associated with this task + // runner. Execution will occur asynchronously. Delayed tasks are not + // supported on V8 WebWorker threads and will be executed without the + // specified delay. + /// + int (CEF_CALLBACK *post_delayed_task)(struct _cef_task_runner_t* self, + struct _cef_task_t* task, int64 delay_ms); +} cef_task_runner_t; + + +/// +// Returns the task runner for the current thread. Only CEF threads will have +// task runners. An NULL reference will be returned if this function is called +// on an invalid thread. +/// +CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_current_thread(); + +/// +// Returns the task runner for the specified CEF thread. +/// +CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread( + cef_thread_id_t threadId); + + +/// +// Returns true (1) if called on the specified thread. Equivalent to using +// cef_task_tRunner::GetForThread(threadId)->belongs_to_current_thread(). +/// +CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId); + +/// +// Post a task for execution on the specified thread. Equivalent to using +// cef_task_tRunner::GetForThread(threadId)->PostTask(task). +/// +CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, cef_task_t* task); + +/// +// Post a task for delayed execution on the specified thread. Equivalent to +// using cef_task_tRunner::GetForThread(threadId)->PostDelayedTask(task, +// delay_ms). +/// +CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId, cef_task_t* task, + int64 delay_ms); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_trace_capi.h b/vendor/cef3/include/capi/cef_trace_capi.h new file mode 100644 index 00000000000..d298ad96ff7 --- /dev/null +++ b/vendor/cef3/include/capi/cef_trace_capi.h @@ -0,0 +1,118 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_callback_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Implement this structure to receive notification when tracing has completed. +// The functions of this structure will be called on the browser process UI +// thread. +/// +typedef struct _cef_end_tracing_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Called after all processes have sent their trace data. |tracing_file| is + // the path at which tracing data was written. The client is responsible for + // deleting |tracing_file|. + /// + void (CEF_CALLBACK *on_end_tracing_complete)( + struct _cef_end_tracing_callback_t* self, + const cef_string_t* tracing_file); +} cef_end_tracing_callback_t; + + +/// +// Start tracing events on all processes. Tracing is initialized asynchronously +// and |callback| will be executed on the UI thread after initialization is +// complete. +// +// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is +// pending, CefBeginTracing will fail and return false (0). +// +// |categories| is a comma-delimited list of category wildcards. A category can +// have an optional '-' prefix to make it an excluded category. Having both +// included and excluded categories in the same list is not supported. +// +// Example: "test_MyTest*" Example: "test_MyTest*,test_OtherStuff" Example: +// "-excluded_category1,-excluded_category2" +// +// This function must be called on the browser process UI thread. +/// +CEF_EXPORT int cef_begin_tracing(const cef_string_t* categories, + struct _cef_completion_callback_t* callback); + +/// +// Stop tracing events on all processes. +// +// This function will fail and return false (0) if a previous call to +// CefEndTracingAsync is already pending or if CefBeginTracing was not called. +// +// |tracing_file| is the path at which tracing data will be written and +// |callback| is the callback that will be executed once all processes have sent +// their trace data. If |tracing_file| is NULL a new temporary file path will be +// used. If |callback| is NULL no trace data will be written. +// +// This function must be called on the browser process UI thread. +/// +CEF_EXPORT int cef_end_tracing(const cef_string_t* tracing_file, + cef_end_tracing_callback_t* callback); + +/// +// Returns the current system trace time or, if none is defined, the current +// high-res time. Can be used by clients to synchronize with the time +// information in trace events. +/// +CEF_EXPORT int64 cef_now_from_system_trace_time(); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_TRACE_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_url_capi.h b/vendor/cef3/include/capi/cef_url_capi.h new file mode 100644 index 00000000000..c9e22aad7dc --- /dev/null +++ b/vendor/cef3/include/capi/cef_url_capi.h @@ -0,0 +1,82 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Parse the specified |url| into its component parts. Returns false (0) if the +// URL is NULL or invalid. +/// +CEF_EXPORT int cef_parse_url(const cef_string_t* url, + struct _cef_urlparts_t* parts); + +/// +// Creates a URL from the specified |parts|, which must contain a non-NULL spec +// or a non-NULL host and path (at a minimum), but not both. Returns false (0) +// if |parts| isn't initialized as described. +/// +CEF_EXPORT int cef_create_url(const struct _cef_urlparts_t* parts, + cef_string_t* url); + +/// +// Returns the mime type for the specified file extension or an NULL string if +// unknown. +/// +// The resulting string must be freed by calling cef_string_userfree_free(). +CEF_EXPORT cef_string_userfree_t cef_get_mime_type( + const cef_string_t* extension); + +// Get the extensions associated with the given mime type. This should be passed +// in lower case. There could be multiple extensions for a given mime type, like +// "html,htm" for "text/html", or "txt,text,html,..." for "text/*". Any existing +// elements in the provided vector will not be erased. +CEF_EXPORT void cef_get_extensions_for_mime_type(const cef_string_t* mime_type, + cef_string_list_t extensions); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_URL_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_urlrequest_capi.h b/vendor/cef3/include/capi/cef_urlrequest_capi.h new file mode 100644 index 00000000000..b396aa67d4a --- /dev/null +++ b/vendor/cef3/include/capi/cef_urlrequest_capi.h @@ -0,0 +1,189 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ +#pragma once + +#include "include/capi/cef_auth_callback_capi.h" +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_request_capi.h" +#include "include/capi/cef_response_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_urlrequest_client_t; + +/// +// Structure used to make a URL request. URL requests are not associated with a +// browser instance so no cef_client_t callbacks will be executed. URL requests +// can be created on any valid CEF thread in either the browser or render +// process. Once created the functions of the URL request object must be +// accessed on the same thread that created it. +/// +typedef struct _cef_urlrequest_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the request object used to create this URL request. The returned + // object is read-only and should not be modified. + /// + struct _cef_request_t* (CEF_CALLBACK *get_request)( + struct _cef_urlrequest_t* self); + + /// + // Returns the client. + /// + struct _cef_urlrequest_client_t* (CEF_CALLBACK *get_client)( + struct _cef_urlrequest_t* self); + + /// + // Returns the request status. + /// + cef_urlrequest_status_t (CEF_CALLBACK *get_request_status)( + struct _cef_urlrequest_t* self); + + /// + // Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 + // otherwise. + /// + cef_errorcode_t (CEF_CALLBACK *get_request_error)( + struct _cef_urlrequest_t* self); + + /// + // Returns the response, or NULL if no response information is available. + // Response information will only be available after the upload has completed. + // The returned object is read-only and should not be modified. + /// + struct _cef_response_t* (CEF_CALLBACK *get_response)( + struct _cef_urlrequest_t* self); + + /// + // Cancel the request. + /// + void (CEF_CALLBACK *cancel)(struct _cef_urlrequest_t* self); +} cef_urlrequest_t; + + +/// +// Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request +// functions are supported. Multiple post data elements are not supported and +// elements of type PDE_TYPE_FILE are only supported for requests originating +// from the browser process. Requests originating from the render process will +// receive the same handling as requests originating from Web content -- if the +// response contains Content-Disposition or Mime-Type header values that would +// not normally be rendered then the response may receive special handling +// inside the browser (for example, via the file download code path instead of +// the URL request code path). The |request| object will be marked as read-only +// after calling this function. +/// +CEF_EXPORT cef_urlrequest_t* cef_urlrequest_create( + struct _cef_request_t* request, struct _cef_urlrequest_client_t* client); + + +/// +// Structure that should be implemented by the cef_urlrequest_t client. The +// functions of this structure will be called on the same thread that created +// the request unless otherwise documented. +/// +typedef struct _cef_urlrequest_client_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Notifies the client that the request has completed. Use the + // cef_urlrequest_t::GetRequestStatus function to determine if the request was + // successful or not. + /// + void (CEF_CALLBACK *on_request_complete)( + struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request); + + /// + // Notifies the client of upload progress. |current| denotes the number of + // bytes sent so far and |total| is the total size of uploading data (or -1 if + // chunked upload is enabled). This function will only be called if the + // UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. + /// + void (CEF_CALLBACK *on_upload_progress)(struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request, uint64 current, uint64 total); + + /// + // Notifies the client of download progress. |current| denotes the number of + // bytes received up to the call and |total| is the expected total size of the + // response (or -1 if not determined). + /// + void (CEF_CALLBACK *on_download_progress)( + struct _cef_urlrequest_client_t* self, struct _cef_urlrequest_t* request, + uint64 current, uint64 total); + + /// + // Called when some part of the response is read. |data| contains the current + // bytes received since the last call. This function will not be called if the + // UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. + /// + void (CEF_CALLBACK *on_download_data)(struct _cef_urlrequest_client_t* self, + struct _cef_urlrequest_t* request, const void* data, + size_t data_length); + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true (1) to continue + // the request and call cef_auth_callback_t::cont() when the authentication + // information is available. Return false (0) to cancel the request. This + // function will only be called for requests initiated from the browser + // process. + /// + int (CEF_CALLBACK *get_auth_credentials)( + struct _cef_urlrequest_client_t* self, int isProxy, + const cef_string_t* host, int port, const cef_string_t* realm, + const cef_string_t* scheme, struct _cef_auth_callback_t* callback); +} cef_urlrequest_client_t; + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_v8_capi.h b/vendor/cef3/include/capi/cef_v8_capi.h new file mode 100644 index 00000000000..4953be31e89 --- /dev/null +++ b/vendor/cef3/include/capi/cef_v8_capi.h @@ -0,0 +1,851 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" +#include "include/capi/cef_frame_capi.h" +#include "include/capi/cef_task_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_v8exception_t; +struct _cef_v8handler_t; +struct _cef_v8stack_frame_t; +struct _cef_v8value_t; + +/// +// Structure representing a V8 context handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8context_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the task runner associated with this context. V8 handles can only + // be accessed from the thread on which they are created. This function can be + // called on any render process thread. + /// + struct _cef_task_runner_t* (CEF_CALLBACK *get_task_runner)( + struct _cef_v8context_t* self); + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8context_t* self); + + /// + // Returns the browser for this context. This function will return an NULL + // reference for WebWorker contexts. + /// + struct _cef_browser_t* (CEF_CALLBACK *get_browser)( + struct _cef_v8context_t* self); + + /// + // Returns the frame for this context. This function will return an NULL + // reference for WebWorker contexts. + /// + struct _cef_frame_t* (CEF_CALLBACK *get_frame)(struct _cef_v8context_t* self); + + /// + // Returns the global object for this context. The context must be entered + // before calling this function. + /// + struct _cef_v8value_t* (CEF_CALLBACK *get_global)( + struct _cef_v8context_t* self); + + /// + // Enter this context. A context must be explicitly entered before creating a + // V8 Object, Array, Function or Date asynchronously. exit() must be called + // the same number of times as enter() before releasing this context. V8 + // objects belong to the context in which they are created. Returns true (1) + // if the scope was entered successfully. + /// + int (CEF_CALLBACK *enter)(struct _cef_v8context_t* self); + + /// + // Exit this context. Call this function only after calling enter(). Returns + // true (1) if the scope was exited successfully. + /// + int (CEF_CALLBACK *exit)(struct _cef_v8context_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_v8context_t* self, + struct _cef_v8context_t* that); + + /// + // Evaluates the specified JavaScript code using this context's global object. + // On success |retval| will be set to the return value, if any, and the + // function will return true (1). On failure |exception| will be set to the + // exception, if any, and the function will return false (0). + /// + int (CEF_CALLBACK *eval)(struct _cef_v8context_t* self, + const cef_string_t* code, struct _cef_v8value_t** retval, + struct _cef_v8exception_t** exception); +} cef_v8context_t; + + +/// +// Returns the current (top) context object in the V8 context stack. +/// +CEF_EXPORT cef_v8context_t* cef_v8context_get_current_context(); + +/// +// Returns the entered (bottom) context object in the V8 context stack. +/// +CEF_EXPORT cef_v8context_t* cef_v8context_get_entered_context(); + +/// +// Returns true (1) if V8 is currently inside a context. +/// +CEF_EXPORT int cef_v8context_in_context(); + + +/// +// Structure that should be implemented to handle V8 function calls. The +// functions of this structure will be called on the thread associated with the +// V8 function. +/// +typedef struct _cef_v8handler_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Handle execution of the function identified by |name|. |object| is the + // receiver ('this' object) of the function. |arguments| is the list of + // arguments passed to the function. If execution succeeds set |retval| to the + // function return value. If execution fails set |exception| to the exception + // that will be thrown. Return true (1) if execution was handled. + /// + int (CEF_CALLBACK *execute)(struct _cef_v8handler_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + size_t argumentsCount, struct _cef_v8value_t* const* arguments, + struct _cef_v8value_t** retval, cef_string_t* exception); +} cef_v8handler_t; + + +/// +// Structure that should be implemented to handle V8 accessor calls. Accessor +// identifiers are registered by calling cef_v8value_t::set_value_byaccessor(). +// The functions of this structure will be called on the thread associated with +// the V8 accessor. +/// +typedef struct _cef_v8accessor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Handle retrieval the accessor value identified by |name|. |object| is the + // receiver ('this' object) of the accessor. If retrieval succeeds set + // |retval| to the return value. If retrieval fails set |exception| to the + // exception that will be thrown. Return true (1) if accessor retrieval was + // handled. + /// + int (CEF_CALLBACK *get)(struct _cef_v8accessor_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, cef_string_t* exception); + + /// + // Handle assignment of the accessor value identified by |name|. |object| is + // the receiver ('this' object) of the accessor. |value| is the new value + // being assigned to the accessor. If assignment fails set |exception| to the + // exception that will be thrown. Return true (1) if accessor assignment was + // handled. + /// + int (CEF_CALLBACK *set)(struct _cef_v8accessor_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + struct _cef_v8value_t* value, cef_string_t* exception); +} cef_v8accessor_t; + + +/// +// Structure representing a V8 exception. The functions of this structure may be +// called on any render process thread. +/// +typedef struct _cef_v8exception_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the exception message. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_message)( + struct _cef_v8exception_t* self); + + /// + // Returns the line of source code that the exception occurred within. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_source_line)( + struct _cef_v8exception_t* self); + + /// + // Returns the resource name for the script from where the function causing + // the error originates. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_script_resource_name)( + struct _cef_v8exception_t* self); + + /// + // Returns the 1-based number of the line where the error occurred or 0 if the + // line number is unknown. + /// + int (CEF_CALLBACK *get_line_number)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the script of the first character where the error + // occurred. + /// + int (CEF_CALLBACK *get_start_position)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the script of the last character where the error + // occurred. + /// + int (CEF_CALLBACK *get_end_position)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the line of the first character where the error + // occurred. + /// + int (CEF_CALLBACK *get_start_column)(struct _cef_v8exception_t* self); + + /// + // Returns the index within the line of the last character where the error + // occurred. + /// + int (CEF_CALLBACK *get_end_column)(struct _cef_v8exception_t* self); +} cef_v8exception_t; + + +/// +// Structure representing a V8 value handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8value_t* self); + + /// + // True if the value type is undefined. + /// + int (CEF_CALLBACK *is_undefined)(struct _cef_v8value_t* self); + + /// + // True if the value type is null. + /// + int (CEF_CALLBACK *is_null)(struct _cef_v8value_t* self); + + /// + // True if the value type is bool. + /// + int (CEF_CALLBACK *is_bool)(struct _cef_v8value_t* self); + + /// + // True if the value type is int. + /// + int (CEF_CALLBACK *is_int)(struct _cef_v8value_t* self); + + /// + // True if the value type is unsigned int. + /// + int (CEF_CALLBACK *is_uint)(struct _cef_v8value_t* self); + + /// + // True if the value type is double. + /// + int (CEF_CALLBACK *is_double)(struct _cef_v8value_t* self); + + /// + // True if the value type is Date. + /// + int (CEF_CALLBACK *is_date)(struct _cef_v8value_t* self); + + /// + // True if the value type is string. + /// + int (CEF_CALLBACK *is_string)(struct _cef_v8value_t* self); + + /// + // True if the value type is object. + /// + int (CEF_CALLBACK *is_object)(struct _cef_v8value_t* self); + + /// + // True if the value type is array. + /// + int (CEF_CALLBACK *is_array)(struct _cef_v8value_t* self); + + /// + // True if the value type is function. + /// + int (CEF_CALLBACK *is_function)(struct _cef_v8value_t* self); + + /// + // Returns true (1) if this object is pointing to the same handle as |that| + // object. + /// + int (CEF_CALLBACK *is_same)(struct _cef_v8value_t* self, + struct _cef_v8value_t* that); + + /// + // Return a bool value. The underlying data will be converted to if + // necessary. + /// + int (CEF_CALLBACK *get_bool_value)(struct _cef_v8value_t* self); + + /// + // Return an int value. The underlying data will be converted to if + // necessary. + /// + int32 (CEF_CALLBACK *get_int_value)(struct _cef_v8value_t* self); + + /// + // Return an unisgned int value. The underlying data will be converted to if + // necessary. + /// + uint32 (CEF_CALLBACK *get_uint_value)(struct _cef_v8value_t* self); + + /// + // Return a double value. The underlying data will be converted to if + // necessary. + /// + double (CEF_CALLBACK *get_double_value)(struct _cef_v8value_t* self); + + /// + // Return a Date value. The underlying data will be converted to if + // necessary. + /// + cef_time_t (CEF_CALLBACK *get_date_value)(struct _cef_v8value_t* self); + + /// + // Return a string value. The underlying data will be converted to if + // necessary. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string_value)( + struct _cef_v8value_t* self); + + + // OBJECT METHODS - These functions are only available on objects. Arrays and + // functions are also objects. String- and integer-based keys can be used + // interchangably with the framework converting between them as necessary. + + /// + // Returns true (1) if this is a user created object. + /// + int (CEF_CALLBACK *is_user_created)(struct _cef_v8value_t* self); + + /// + // Returns true (1) if the last function call resulted in an exception. This + // attribute exists only in the scope of the current CEF value object. + /// + int (CEF_CALLBACK *has_exception)(struct _cef_v8value_t* self); + + /// + // Returns the exception resulting from the last function call. This attribute + // exists only in the scope of the current CEF value object. + /// + struct _cef_v8exception_t* (CEF_CALLBACK *get_exception)( + struct _cef_v8value_t* self); + + /// + // Clears the last exception and returns true (1) on success. + /// + int (CEF_CALLBACK *clear_exception)(struct _cef_v8value_t* self); + + /// + // Returns true (1) if this object will re-throw future exceptions. This + // attribute exists only in the scope of the current CEF value object. + /// + int (CEF_CALLBACK *will_rethrow_exceptions)(struct _cef_v8value_t* self); + + /// + // Set whether this object will re-throw future exceptions. By default + // exceptions are not re-thrown. If a exception is re-thrown the current + // context should not be accessed again until after the exception has been + // caught and not re-thrown. Returns true (1) on success. This attribute + // exists only in the scope of the current CEF value object. + /// + int (CEF_CALLBACK *set_rethrow_exceptions)(struct _cef_v8value_t* self, + int rethrow); + + /// + // Returns true (1) if the object has a value with the specified identifier. + /// + int (CEF_CALLBACK *has_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key); + + /// + // Returns true (1) if the object has a value with the specified identifier. + /// + int (CEF_CALLBACK *has_value_byindex)(struct _cef_v8value_t* self, int index); + + /// + // Deletes the value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly or an + // exception is thrown. For read-only and don't-delete values this function + // will return true (1) even though deletion failed. + /// + int (CEF_CALLBACK *delete_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key); + + /// + // Deletes the value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly, deletion + // fails or an exception is thrown. For read-only and don't-delete values this + // function will return true (1) even though deletion failed. + /// + int (CEF_CALLBACK *delete_value_byindex)(struct _cef_v8value_t* self, + int index); + + /// + // Returns the value with the specified identifier on success. Returns NULL if + // this function is called incorrectly or an exception is thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *get_value_bykey)( + struct _cef_v8value_t* self, const cef_string_t* key); + + /// + // Returns the value with the specified identifier on success. Returns NULL if + // this function is called incorrectly or an exception is thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *get_value_byindex)( + struct _cef_v8value_t* self, int index); + + /// + // Associates a value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly or an + // exception is thrown. For read-only values this function will return true + // (1) even though assignment failed. + /// + int (CEF_CALLBACK *set_value_bykey)(struct _cef_v8value_t* self, + const cef_string_t* key, struct _cef_v8value_t* value, + cef_v8_propertyattribute_t attribute); + + /// + // Associates a value with the specified identifier and returns true (1) on + // success. Returns false (0) if this function is called incorrectly or an + // exception is thrown. For read-only values this function will return true + // (1) even though assignment failed. + /// + int (CEF_CALLBACK *set_value_byindex)(struct _cef_v8value_t* self, int index, + struct _cef_v8value_t* value); + + /// + // Registers an identifier and returns true (1) on success. Access to the + // identifier will be forwarded to the cef_v8accessor_t instance passed to + // cef_v8value_t::cef_v8value_create_object(). Returns false (0) if this + // function is called incorrectly or an exception is thrown. For read-only + // values this function will return true (1) even though assignment failed. + /// + int (CEF_CALLBACK *set_value_byaccessor)(struct _cef_v8value_t* self, + const cef_string_t* key, cef_v8_accesscontrol_t settings, + cef_v8_propertyattribute_t attribute); + + /// + // Read the keys for the object's values into the specified vector. Integer- + // based keys will also be returned as strings. + /// + int (CEF_CALLBACK *get_keys)(struct _cef_v8value_t* self, + cef_string_list_t keys); + + /// + // Sets the user data for this object and returns true (1) on success. Returns + // false (0) if this function is called incorrectly. This function can only be + // called on user created objects. + /// + int (CEF_CALLBACK *set_user_data)(struct _cef_v8value_t* self, + struct _cef_base_t* user_data); + + /// + // Returns the user data, if any, assigned to this object. + /// + struct _cef_base_t* (CEF_CALLBACK *get_user_data)( + struct _cef_v8value_t* self); + + /// + // Returns the amount of externally allocated memory registered for the + // object. + /// + int (CEF_CALLBACK *get_externally_allocated_memory)( + struct _cef_v8value_t* self); + + /// + // Adjusts the amount of registered external memory for the object. Used to + // give V8 an indication of the amount of externally allocated memory that is + // kept alive by JavaScript objects. V8 uses this information to decide when + // to perform global garbage collection. Each cef_v8value_t tracks the amount + // of external memory associated with it and automatically decreases the + // global total by the appropriate amount on its destruction. + // |change_in_bytes| specifies the number of bytes to adjust by. This function + // returns the number of bytes associated with the object after the + // adjustment. This function can only be called on user created objects. + /// + int (CEF_CALLBACK *adjust_externally_allocated_memory)( + struct _cef_v8value_t* self, int change_in_bytes); + + + // ARRAY METHODS - These functions are only available on arrays. + + /// + // Returns the number of elements in the array. + /// + int (CEF_CALLBACK *get_array_length)(struct _cef_v8value_t* self); + + + // FUNCTION METHODS - These functions are only available on functions. + + /// + // Returns the function name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_function_name)( + struct _cef_v8value_t* self); + + /// + // Returns the function handler or NULL if not a CEF-created function. + /// + struct _cef_v8handler_t* (CEF_CALLBACK *get_function_handler)( + struct _cef_v8value_t* self); + + /// + // Execute the function using the current V8 context. This function should + // only be called from within the scope of a cef_v8handler_t or + // cef_v8accessor_t callback, or in combination with calling enter() and + // exit() on a stored cef_v8context_t reference. |object| is the receiver + // ('this' object) of the function. If |object| is NULL the current context's + // global object will be used. |arguments| is the list of arguments that will + // be passed to the function. Returns the function return value on success. + // Returns NULL if this function is called incorrectly or an exception is + // thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *execute_function)( + struct _cef_v8value_t* self, struct _cef_v8value_t* object, + size_t argumentsCount, struct _cef_v8value_t* const* arguments); + + /// + // Execute the function using the specified V8 context. |object| is the + // receiver ('this' object) of the function. If |object| is NULL the specified + // context's global object will be used. |arguments| is the list of arguments + // that will be passed to the function. Returns the function return value on + // success. Returns NULL if this function is called incorrectly or an + // exception is thrown. + /// + struct _cef_v8value_t* (CEF_CALLBACK *execute_function_with_context)( + struct _cef_v8value_t* self, struct _cef_v8context_t* context, + struct _cef_v8value_t* object, size_t argumentsCount, + struct _cef_v8value_t* const* arguments); +} cef_v8value_t; + + +/// +// Create a new cef_v8value_t object of type undefined. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_undefined(); + +/// +// Create a new cef_v8value_t object of type null. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_null(); + +/// +// Create a new cef_v8value_t object of type bool. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_bool(int value); + +/// +// Create a new cef_v8value_t object of type int. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_int(int32 value); + +/// +// Create a new cef_v8value_t object of type unsigned int. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_uint(uint32 value); + +/// +// Create a new cef_v8value_t object of type double. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_double(double value); + +/// +// Create a new cef_v8value_t object of type Date. This function should only be +// called from within the scope of a cef_v8context_tHandler, cef_v8handler_t or +// cef_v8accessor_t callback, or in combination with calling enter() and exit() +// on a stored cef_v8context_t reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_date(const cef_time_t* date); + +/// +// Create a new cef_v8value_t object of type string. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_string(const cef_string_t* value); + +/// +// Create a new cef_v8value_t object of type object with optional accessor. This +// function should only be called from within the scope of a +// cef_v8context_tHandler, cef_v8handler_t or cef_v8accessor_t callback, or in +// combination with calling enter() and exit() on a stored cef_v8context_t +// reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_object(cef_v8accessor_t* accessor); + +/// +// Create a new cef_v8value_t object of type array with the specified |length|. +// If |length| is negative the returned array will have length 0. This function +// should only be called from within the scope of a cef_v8context_tHandler, +// cef_v8handler_t or cef_v8accessor_t callback, or in combination with calling +// enter() and exit() on a stored cef_v8context_t reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_array(int length); + +/// +// Create a new cef_v8value_t object of type function. This function should only +// be called from within the scope of a cef_v8context_tHandler, cef_v8handler_t +// or cef_v8accessor_t callback, or in combination with calling enter() and +// exit() on a stored cef_v8context_t reference. +/// +CEF_EXPORT cef_v8value_t* cef_v8value_create_function(const cef_string_t* name, + cef_v8handler_t* handler); + + +/// +// Structure representing a V8 stack trace handle. V8 handles can only be +// accessed from the thread on which they are created. Valid threads for +// creating a V8 handle include the render process main thread (TID_RENDERER) +// and WebWorker threads. A task runner for posting tasks on the associated +// thread can be retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8stack_trace_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8stack_trace_t* self); + + /// + // Returns the number of stack frames. + /// + int (CEF_CALLBACK *get_frame_count)(struct _cef_v8stack_trace_t* self); + + /// + // Returns the stack frame at the specified 0-based index. + /// + struct _cef_v8stack_frame_t* (CEF_CALLBACK *get_frame)( + struct _cef_v8stack_trace_t* self, int index); +} cef_v8stack_trace_t; + + +/// +// Returns the stack trace for the currently active context. |frame_limit| is +// the maximum number of frames that will be captured. +/// +CEF_EXPORT cef_v8stack_trace_t* cef_v8stack_trace_get_current(int frame_limit); + + +/// +// Structure representing a V8 stack frame handle. V8 handles can only be +// accessed from the thread on which they are created. Valid threads for +// creating a V8 handle include the render process main thread (TID_RENDERER) +// and WebWorker threads. A task runner for posting tasks on the associated +// thread can be retrieved via the cef_v8context_t::get_task_runner() function. +/// +typedef struct _cef_v8stack_frame_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if the underlying handle is valid and it can be accessed + // on the current thread. Do not call any other functions if this function + // returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_v8stack_frame_t* self); + + /// + // Returns the name of the resource script that contains the function. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_script_name)( + struct _cef_v8stack_frame_t* self); + + /// + // Returns the name of the resource script that contains the function or the + // sourceURL value if the script name is undefined and its source ends with a + // "//@ sourceURL=..." string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_script_name_or_source_url)( + struct _cef_v8stack_frame_t* self); + + /// + // Returns the name of the function. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_function_name)( + struct _cef_v8stack_frame_t* self); + + /// + // Returns the 1-based line number for the function call or 0 if unknown. + /// + int (CEF_CALLBACK *get_line_number)(struct _cef_v8stack_frame_t* self); + + /// + // Returns the 1-based column offset on the line for the function call or 0 if + // unknown. + /// + int (CEF_CALLBACK *get_column)(struct _cef_v8stack_frame_t* self); + + /// + // Returns true (1) if the function was compiled using eval(). + /// + int (CEF_CALLBACK *is_eval)(struct _cef_v8stack_frame_t* self); + + /// + // Returns true (1) if the function was called as a constructor via "new". + /// + int (CEF_CALLBACK *is_constructor)(struct _cef_v8stack_frame_t* self); +} cef_v8stack_frame_t; + + +/// +// Register a new V8 extension with the specified JavaScript extension code and +// handler. Functions implemented by the handler are prototyped using the +// keyword 'native'. The calling of a native function is restricted to the scope +// in which the prototype of the native function is defined. This function may +// only be called on the render process main thread. +// +// Example JavaScript extension code:
+//   // create the 'example' global object if it doesn't already exist.
+//   if (!example)
+//     example = {};
+//   // create the 'example.test' global object if it doesn't already exist.
+//   if (!example.test)
+//     example.test = {};
+//   (function() {
+//     // Define the function 'example.test.myfunction'.
+//     example.test.myfunction = function() {
+//       // Call CefV8Handler::Execute() with the function name 'MyFunction'
+//       // and no arguments.
+//       native function MyFunction();
+//       return MyFunction();
+//     };
+//     // Define the getter function for parameter 'example.test.myparam'.
+//     example.test.__defineGetter__('myparam', function() {
+//       // Call CefV8Handler::Execute() with the function name 'GetMyParam'
+//       // and no arguments.
+//       native function GetMyParam();
+//       return GetMyParam();
+//     });
+//     // Define the setter function for parameter 'example.test.myparam'.
+//     example.test.__defineSetter__('myparam', function(b) {
+//       // Call CefV8Handler::Execute() with the function name 'SetMyParam'
+//       // and a single argument.
+//       native function SetMyParam();
+//       if(b) SetMyParam(b);
+//     });
+//
+//     // Extension definitions can also contain normal JavaScript variables
+//     // and functions.
+//     var myint = 0;
+//     example.test.increment = function() {
+//       myint += 1;
+//       return myint;
+//     };
+//   })();
+// 
Example usage in the page:
+//   // Call the function.
+//   example.test.myfunction();
+//   // Set the parameter.
+//   example.test.myparam = value;
+//   // Get the parameter.
+//   value = example.test.myparam;
+//   // Call another function.
+//   example.test.increment();
+// 
+/// +CEF_EXPORT int cef_register_extension(const cef_string_t* extension_name, + const cef_string_t* javascript_code, cef_v8handler_t* handler); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_V8_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_values_capi.h b/vendor/cef3/include/capi/cef_values_capi.h new file mode 100644 index 00000000000..0fd96fd3a6f --- /dev/null +++ b/vendor/cef3/include/capi/cef_values_capi.h @@ -0,0 +1,463 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +struct _cef_dictionary_value_t; +struct _cef_list_value_t; + +/// +// Structure representing a binary value. Can be used on any process and thread. +/// +typedef struct _cef_binary_value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_binary_value_t* self); + + /// + // Returns true (1) if this object is currently owned by another object. + /// + int (CEF_CALLBACK *is_owned)(struct _cef_binary_value_t* self); + + /// + // Returns a copy of this object. The data in this object will also be copied. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *copy)( + struct _cef_binary_value_t* self); + + /// + // Returns the data size. + /// + size_t (CEF_CALLBACK *get_size)(struct _cef_binary_value_t* self); + + /// + // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at + // the specified byte |data_offset|. Returns the number of bytes read. + /// + size_t (CEF_CALLBACK *get_data)(struct _cef_binary_value_t* self, + void* buffer, size_t buffer_size, size_t data_offset); +} cef_binary_value_t; + + +/// +// Creates a new object that is not owned by any other object. The specified +// |data| will be copied. +/// +CEF_EXPORT cef_binary_value_t* cef_binary_value_create(const void* data, + size_t data_size); + + +/// +// Structure representing a dictionary value. Can be used on any process and +// thread. +/// +typedef struct _cef_dictionary_value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_dictionary_value_t* self); + + /// + // Returns true (1) if this object is currently owned by another object. + /// + int (CEF_CALLBACK *is_owned)(struct _cef_dictionary_value_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_dictionary_value_t* self); + + /// + // Returns a writable copy of this object. If |exclude_NULL_children| is true + // (1) any NULL dictionaries or lists will be excluded from the copy. + /// + struct _cef_dictionary_value_t* (CEF_CALLBACK *copy)( + struct _cef_dictionary_value_t* self, int exclude_empty_children); + + /// + // Returns the number of values. + /// + size_t (CEF_CALLBACK *get_size)(struct _cef_dictionary_value_t* self); + + /// + // Removes all values. Returns true (1) on success. + /// + int (CEF_CALLBACK *clear)(struct _cef_dictionary_value_t* self); + + /// + // Returns true (1) if the current dictionary has a value for the given key. + /// + int (CEF_CALLBACK *has_key)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Reads all keys for this dictionary into the specified vector. + /// + int (CEF_CALLBACK *get_keys)(struct _cef_dictionary_value_t* self, + cef_string_list_t keys); + + /// + // Removes the value at the specified key. Returns true (1) is the value was + // removed successfully. + /// + int (CEF_CALLBACK *remove)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value type for the specified key. + /// + cef_value_type_t (CEF_CALLBACK *get_type)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type bool. + /// + int (CEF_CALLBACK *get_bool)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value at the specified key as type int. + /// + int (CEF_CALLBACK *get_int)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value at the specified key as type double. + /// + double (CEF_CALLBACK *get_double)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Returns the value at the specified key as type string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type binary. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type dictionary. + /// + struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Returns the value at the specified key as type list. + /// + struct _cef_list_value_t* (CEF_CALLBACK *get_list)( + struct _cef_dictionary_value_t* self, const cef_string_t* key); + + /// + // Sets the value at the specified key as type null. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_null)(struct _cef_dictionary_value_t* self, + const cef_string_t* key); + + /// + // Sets the value at the specified key as type bool. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_bool)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, int value); + + /// + // Sets the value at the specified key as type int. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_int)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, int value); + + /// + // Sets the value at the specified key as type double. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_double)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, double value); + + /// + // Sets the value at the specified key as type string. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_string)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, const cef_string_t* value); + + /// + // Sets the value at the specified key as type binary. Returns true (1) if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_binary)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, struct _cef_binary_value_t* value); + + /// + // Sets the value at the specified key as type dict. Returns true (1) if the + // value was set successfully. After calling this function the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_dictionary)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, struct _cef_dictionary_value_t* value); + + /// + // Sets the value at the specified key as type list. Returns true (1) if the + // value was set successfully. After calling this function the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_list)(struct _cef_dictionary_value_t* self, + const cef_string_t* key, struct _cef_list_value_t* value); +} cef_dictionary_value_t; + + +/// +// Creates a new object that is not owned by any other object. +/// +CEF_EXPORT cef_dictionary_value_t* cef_dictionary_value_create(); + + +/// +// Structure representing a list value. Can be used on any process and thread. +/// +typedef struct _cef_list_value_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns true (1) if this object is valid. Do not call any other functions + // if this function returns false (0). + /// + int (CEF_CALLBACK *is_valid)(struct _cef_list_value_t* self); + + /// + // Returns true (1) if this object is currently owned by another object. + /// + int (CEF_CALLBACK *is_owned)(struct _cef_list_value_t* self); + + /// + // Returns true (1) if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + int (CEF_CALLBACK *is_read_only)(struct _cef_list_value_t* self); + + /// + // Returns a writable copy of this object. + /// + struct _cef_list_value_t* (CEF_CALLBACK *copy)( + struct _cef_list_value_t* self); + + /// + // Sets the number of values. If the number of values is expanded all new + // value slots will default to type null. Returns true (1) on success. + /// + int (CEF_CALLBACK *set_size)(struct _cef_list_value_t* self, size_t size); + + /// + // Returns the number of values. + /// + size_t (CEF_CALLBACK *get_size)(struct _cef_list_value_t* self); + + /// + // Removes all values. Returns true (1) on success. + /// + int (CEF_CALLBACK *clear)(struct _cef_list_value_t* self); + + /// + // Removes the value at the specified index. + /// + int (CEF_CALLBACK *remove)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value type at the specified index. + /// + cef_value_type_t (CEF_CALLBACK *get_type)(struct _cef_list_value_t* self, + int index); + + /// + // Returns the value at the specified index as type bool. + /// + int (CEF_CALLBACK *get_bool)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type int. + /// + int (CEF_CALLBACK *get_int)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type double. + /// + double (CEF_CALLBACK *get_double)(struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_string)( + struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type binary. + /// + struct _cef_binary_value_t* (CEF_CALLBACK *get_binary)( + struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type dictionary. + /// + struct _cef_dictionary_value_t* (CEF_CALLBACK *get_dictionary)( + struct _cef_list_value_t* self, int index); + + /// + // Returns the value at the specified index as type list. + /// + struct _cef_list_value_t* (CEF_CALLBACK *get_list)( + struct _cef_list_value_t* self, int index); + + /// + // Sets the value at the specified index as type null. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_null)(struct _cef_list_value_t* self, int index); + + /// + // Sets the value at the specified index as type bool. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_bool)(struct _cef_list_value_t* self, int index, + int value); + + /// + // Sets the value at the specified index as type int. Returns true (1) if the + // value was set successfully. + /// + int (CEF_CALLBACK *set_int)(struct _cef_list_value_t* self, int index, + int value); + + /// + // Sets the value at the specified index as type double. Returns true (1) if + // the value was set successfully. + /// + int (CEF_CALLBACK *set_double)(struct _cef_list_value_t* self, int index, + double value); + + /// + // Sets the value at the specified index as type string. Returns true (1) if + // the value was set successfully. + /// + int (CEF_CALLBACK *set_string)(struct _cef_list_value_t* self, int index, + const cef_string_t* value); + + /// + // Sets the value at the specified index as type binary. Returns true (1) if + // the value was set successfully. After calling this function the |value| + // object will no longer be valid. If |value| is currently owned by another + // object then the value will be copied and the |value| reference will not + // change. Otherwise, ownership will be transferred to this object and the + // |value| reference will be invalidated. + /// + int (CEF_CALLBACK *set_binary)(struct _cef_list_value_t* self, int index, + struct _cef_binary_value_t* value); + + /// + // Sets the value at the specified index as type dict. Returns true (1) if the + // value was set successfully. After calling this function the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_dictionary)(struct _cef_list_value_t* self, int index, + struct _cef_dictionary_value_t* value); + + /// + // Sets the value at the specified index as type list. Returns true (1) if the + // value was set successfully. After calling this function the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + int (CEF_CALLBACK *set_list)(struct _cef_list_value_t* self, int index, + struct _cef_list_value_t* value); +} cef_list_value_t; + + +/// +// Creates a new object that is not owned by any other object. +/// +CEF_EXPORT cef_list_value_t* cef_list_value_create(); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_VALUES_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_web_plugin_capi.h b/vendor/cef3/include/capi/cef_web_plugin_capi.h new file mode 100644 index 00000000000..a9d089b77a2 --- /dev/null +++ b/vendor/cef3/include/capi/cef_web_plugin_capi.h @@ -0,0 +1,195 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_browser_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Information about a specific web plugin. +/// +typedef struct _cef_web_plugin_info_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Returns the plugin name (i.e. Flash). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_name)( + struct _cef_web_plugin_info_t* self); + + /// + // Returns the plugin file path (DLL/bundle/library). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_path)( + struct _cef_web_plugin_info_t* self); + + /// + // Returns the version of the plugin (may be OS-specific). + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_version)( + struct _cef_web_plugin_info_t* self); + + /// + // Returns a description of the plugin from the version information. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_description)( + struct _cef_web_plugin_info_t* self); +} cef_web_plugin_info_t; + + +/// +// Structure to implement for visiting web plugin information. The functions of +// this structure will be called on the browser process UI thread. +/// +typedef struct _cef_web_plugin_info_visitor_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called once for each plugin. |count| is the 0-based + // index for the current plugin. |total| is the total number of plugins. + // Return false (0) to stop visiting plugins. This function may never be + // called if no plugins are found. + /// + int (CEF_CALLBACK *visit)(struct _cef_web_plugin_info_visitor_t* self, + struct _cef_web_plugin_info_t* info, int count, int total); +} cef_web_plugin_info_visitor_t; + + +/// +// Structure to implement for receiving unstable plugin information. The +// functions of this structure will be called on the browser process IO thread. +/// +typedef struct _cef_web_plugin_unstable_callback_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Method that will be called for the requested plugin. |unstable| will be + // true (1) if the plugin has reached the crash count threshold of 3 times in + // 120 seconds. + /// + void (CEF_CALLBACK *is_unstable)( + struct _cef_web_plugin_unstable_callback_t* self, + const cef_string_t* path, int unstable); +} cef_web_plugin_unstable_callback_t; + + +/// +// Visit web plugin information. Can be called on any thread in the browser +// process. +/// +CEF_EXPORT void cef_visit_web_plugin_info( + cef_web_plugin_info_visitor_t* visitor); + +/// +// Cause the plugin list to refresh the next time it is accessed regardless of +// whether it has already been loaded. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_refresh_web_plugins(); + +/// +// Add a plugin path (directory + file). This change may not take affect until +// after cef_refresh_web_plugins() is called. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_add_web_plugin_path(const cef_string_t* path); + +/// +// Add a plugin directory. This change may not take affect until after +// cef_refresh_web_plugins() is called. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_add_web_plugin_directory(const cef_string_t* dir); + +/// +// Remove a plugin path (directory + file). This change may not take affect +// until after cef_refresh_web_plugins() is called. Can be called on any thread +// in the browser process. +/// +CEF_EXPORT void cef_remove_web_plugin_path(const cef_string_t* path); + +/// +// Unregister an internal plugin. This may be undone the next time +// cef_refresh_web_plugins() is called. Can be called on any thread in the +// browser process. +/// +CEF_EXPORT void cef_unregister_internal_web_plugin(const cef_string_t* path); + +/// +// Force a plugin to shutdown. Can be called on any thread in the browser +// process but will be executed on the IO thread. +/// +CEF_EXPORT void cef_force_web_plugin_shutdown(const cef_string_t* path); + +/// +// Register a plugin crash. Can be called on any thread in the browser process +// but will be executed on the IO thread. +/// +CEF_EXPORT void cef_register_web_plugin_crash(const cef_string_t* path); + +/// +// Query if a plugin is unstable. Can be called on any thread in the browser +// process. +/// +CEF_EXPORT void cef_is_web_plugin_unstable(const cef_string_t* path, + cef_web_plugin_unstable_callback_t* callback); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_WEB_PLUGIN_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_xml_reader_capi.h b/vendor/cef3/include/capi/cef_xml_reader_capi.h new file mode 100644 index 00000000000..1a7bd21044c --- /dev/null +++ b/vendor/cef3/include/capi/cef_xml_reader_capi.h @@ -0,0 +1,278 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_stream_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure that supports the reading of XML data via the libxml streaming API. +// The functions of this structure should only be called on the thread that +// creates the object. +/// +typedef struct _cef_xml_reader_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Moves the cursor to the next node in the document. This function must be + // called at least once to set the current cursor position. Returns true (1) + // if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_next_node)(struct _cef_xml_reader_t* self); + + /// + // Close the document. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + int (CEF_CALLBACK *close)(struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if an error has been reported by the XML parser. + /// + int (CEF_CALLBACK *has_error)(struct _cef_xml_reader_t* self); + + /// + // Returns the error string. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_error)( + struct _cef_xml_reader_t* self); + + + // The below functions retrieve data for the node at the current cursor + // position. + + /// + // Returns the node type. + /// + cef_xml_node_type_t (CEF_CALLBACK *get_type)(struct _cef_xml_reader_t* self); + + /// + // Returns the node depth. Depth starts at 0 for the root node. + /// + int (CEF_CALLBACK *get_depth)(struct _cef_xml_reader_t* self); + + /// + // Returns the local name. See http://www.w3.org/TR/REC-xml-names/#NT- + // LocalPart for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_local_name)( + struct _cef_xml_reader_t* self); + + /// + // Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for + // additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_prefix)( + struct _cef_xml_reader_t* self); + + /// + // Returns the qualified name, equal to (Prefix:)LocalName. See + // http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_qualified_name)( + struct _cef_xml_reader_t* self); + + /// + // Returns the URI defining the namespace associated with the node. See + // http://www.w3.org/TR/REC-xml-names/ for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_namespace_uri)( + struct _cef_xml_reader_t* self); + + /// + // Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for + // additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_base_uri)( + struct _cef_xml_reader_t* self); + + /// + // Returns the xml:lang scope within which the node resides. See + // http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_xml_lang)( + struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if the node represents an NULL element.
is considered + // NULL but is not. + /// + int (CEF_CALLBACK *is_empty_element)(struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if the node has a text value. + /// + int (CEF_CALLBACK *has_value)(struct _cef_xml_reader_t* self); + + /// + // Returns the text value. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_value)( + struct _cef_xml_reader_t* self); + + /// + // Returns true (1) if the node has attributes. + /// + int (CEF_CALLBACK *has_attributes)(struct _cef_xml_reader_t* self); + + /// + // Returns the number of attributes. + /// + size_t (CEF_CALLBACK *get_attribute_count)(struct _cef_xml_reader_t* self); + + /// + // Returns the value of the attribute at the specified 0-based index. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_attribute_byindex)( + struct _cef_xml_reader_t* self, int index); + + /// + // Returns the value of the attribute with the specified qualified name. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_attribute_byqname)( + struct _cef_xml_reader_t* self, const cef_string_t* qualifiedName); + + /// + // Returns the value of the attribute with the specified local name and + // namespace URI. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_attribute_bylname)( + struct _cef_xml_reader_t* self, const cef_string_t* localName, + const cef_string_t* namespaceURI); + + /// + // Returns an XML representation of the current node's children. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_inner_xml)( + struct _cef_xml_reader_t* self); + + /// + // Returns an XML representation of the current node including its children. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_outer_xml)( + struct _cef_xml_reader_t* self); + + /// + // Returns the line number for the current node. + /// + int (CEF_CALLBACK *get_line_number)(struct _cef_xml_reader_t* self); + + + // Attribute nodes are not traversed by default. The below functions can be + // used to move the cursor to an attribute node. move_to_carrying_element() + // can be called afterwards to return the cursor to the carrying element. The + // depth of an attribute node will be 1 + the depth of the carrying element. + + /// + // Moves the cursor to the attribute at the specified 0-based index. Returns + // true (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_attribute_byindex)(struct _cef_xml_reader_t* self, + int index); + + /// + // Moves the cursor to the attribute with the specified qualified name. + // Returns true (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_attribute_byqname)(struct _cef_xml_reader_t* self, + const cef_string_t* qualifiedName); + + /// + // Moves the cursor to the attribute with the specified local name and + // namespace URI. Returns true (1) if the cursor position was set + // successfully. + /// + int (CEF_CALLBACK *move_to_attribute_bylname)(struct _cef_xml_reader_t* self, + const cef_string_t* localName, const cef_string_t* namespaceURI); + + /// + // Moves the cursor to the first attribute in the current element. Returns + // true (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_first_attribute)(struct _cef_xml_reader_t* self); + + /// + // Moves the cursor to the next attribute in the current element. Returns true + // (1) if the cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_next_attribute)(struct _cef_xml_reader_t* self); + + /// + // Moves the cursor back to the carrying element. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_carrying_element)(struct _cef_xml_reader_t* self); +} cef_xml_reader_t; + + +/// +// Create a new cef_xml_reader_t object. The returned object's functions can +// only be called from the thread that created the object. +/// +CEF_EXPORT cef_xml_reader_t* cef_xml_reader_create( + struct _cef_stream_reader_t* stream, cef_xml_encoding_type_t encodingType, + const cef_string_t* URI); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_XML_READER_CAPI_H_ diff --git a/vendor/cef3/include/capi/cef_zip_reader_capi.h b/vendor/cef3/include/capi/cef_zip_reader_capi.h new file mode 100644 index 00000000000..b9a5094e89e --- /dev/null +++ b/vendor/cef3/include/capi/cef_zip_reader_capi.h @@ -0,0 +1,149 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool and should not edited +// by hand. See the translator.README.txt file in the tools directory for +// more information. +// + +#ifndef CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ +#define CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ +#pragma once + +#include "include/capi/cef_base_capi.h" +#include "include/capi/cef_stream_capi.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +/// +// Structure that supports the reading of zip archives via the zlib unzip API. +// The functions of this structure should only be called on the thread that +// creates the object. +/// +typedef struct _cef_zip_reader_t { + /// + // Base structure. + /// + cef_base_t base; + + /// + // Moves the cursor to the first file in the archive. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_first_file)(struct _cef_zip_reader_t* self); + + /// + // Moves the cursor to the next file in the archive. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_next_file)(struct _cef_zip_reader_t* self); + + /// + // Moves the cursor to the specified file in the archive. If |caseSensitive| + // is true (1) then the search will be case sensitive. Returns true (1) if the + // cursor position was set successfully. + /// + int (CEF_CALLBACK *move_to_file)(struct _cef_zip_reader_t* self, + const cef_string_t* fileName, int caseSensitive); + + /// + // Closes the archive. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + int (CEF_CALLBACK *close)(struct _cef_zip_reader_t* self); + + + // The below functions act on the file at the current cursor position. + + /// + // Returns the name of the file. + /// + // The resulting string must be freed by calling cef_string_userfree_free(). + cef_string_userfree_t (CEF_CALLBACK *get_file_name)( + struct _cef_zip_reader_t* self); + + /// + // Returns the uncompressed size of the file. + /// + int64 (CEF_CALLBACK *get_file_size)(struct _cef_zip_reader_t* self); + + /// + // Returns the last modified timestamp for the file. + /// + time_t (CEF_CALLBACK *get_file_last_modified)(struct _cef_zip_reader_t* self); + + /// + // Opens the file for reading of uncompressed data. A read password may + // optionally be specified. + /// + int (CEF_CALLBACK *open_file)(struct _cef_zip_reader_t* self, + const cef_string_t* password); + + /// + // Closes the file. + /// + int (CEF_CALLBACK *close_file)(struct _cef_zip_reader_t* self); + + /// + // Read uncompressed file contents into the specified buffer. Returns < 0 if + // an error occurred, 0 if at the end of file, or the number of bytes read. + /// + int (CEF_CALLBACK *read_file)(struct _cef_zip_reader_t* self, void* buffer, + size_t bufferSize); + + /// + // Returns the current offset in the uncompressed file contents. + /// + int64 (CEF_CALLBACK *tell)(struct _cef_zip_reader_t* self); + + /// + // Returns true (1) if at end of the file contents. + /// + int (CEF_CALLBACK *eof)(struct _cef_zip_reader_t* self); +} cef_zip_reader_t; + + +/// +// Create a new cef_zip_reader_t object. The returned object's functions can +// only be called from the thread that created the object. +/// +CEF_EXPORT cef_zip_reader_t* cef_zip_reader_create( + struct _cef_stream_reader_t* stream); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_CAPI_CEF_ZIP_READER_CAPI_H_ diff --git a/vendor/cef3/include/cef_app.h b/vendor/cef3/include/cef_app.h new file mode 100644 index 00000000000..bac62281253 --- /dev/null +++ b/vendor/cef3/include/cef_app.h @@ -0,0 +1,192 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + + +#ifndef CEF_INCLUDE_CEF_APP_H_ +#define CEF_INCLUDE_CEF_APP_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser_process_handler.h" +#include "include/cef_command_line.h" +#include "include/cef_render_process_handler.h" +#include "include/cef_resource_bundle_handler.h" +#include "include/cef_scheme.h" + +class CefApp; + +/// +// This function should be called from the application entry point function to +// execute a secondary process. It can be used to run secondary processes from +// the browser client executable (default behavior) or from a separate +// executable specified by the CefSettings.browser_subprocess_path value. If +// called for the browser process (identified by no "type" command-line value) +// it will return immediately with a value of -1. If called for a recognized +// secondary process it will block until the process should exit and then return +// the process exit code. The |application| parameter may be empty. The +// |windows_sandbox_info| parameter is only used on Windows and may be NULL (see +// cef_sandbox_win.h for details). +/// +/*--cef(api_hash_check,optional_param=application, + optional_param=windows_sandbox_info)--*/ +int CefExecuteProcess(const CefMainArgs& args, + CefRefPtr application, + void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to initialize +// the CEF browser process. The |application| parameter may be empty. A return +// value of true indicates that it succeeded and false indicates that it failed. +// The |windows_sandbox_info| parameter is only used on Windows and may be NULL +// (see cef_sandbox_win.h for details). +/// +/*--cef(api_hash_check,optional_param=application, + optional_param=windows_sandbox_info)--*/ +bool CefInitialize(const CefMainArgs& args, + const CefSettings& settings, + CefRefPtr application, + void* windows_sandbox_info); + +/// +// This function should be called on the main application thread to shut down +// the CEF browser process before the application exits. +/// +/*--cef()--*/ +void CefShutdown(); + +/// +// Perform a single iteration of CEF message loop processing. This function is +// used to integrate the CEF message loop into an existing application message +// loop. Care must be taken to balance performance against excessive CPU usage. +// This function should only be called on the main application thread and only +// if CefInitialize() is called with a CefSettings.multi_threaded_message_loop +// value of false. This function will not block. +/// +/*--cef()--*/ +void CefDoMessageLoopWork(); + +/// +// Run the CEF message loop. Use this function instead of an application- +// provided message loop to get the best balance between performance and CPU +// usage. This function should only be called on the main application thread and +// only if CefInitialize() is called with a +// CefSettings.multi_threaded_message_loop value of false. This function will +// block until a quit message is received by the system. +/// +/*--cef()--*/ +void CefRunMessageLoop(); + +/// +// Quit the CEF message loop that was started by calling CefRunMessageLoop(). +// This function should only be called on the main application thread and only +// if CefRunMessageLoop() was used. +/// +/*--cef()--*/ +void CefQuitMessageLoop(); + +/// +// Set to true before calling Windows APIs like TrackPopupMenu that enter a +// modal message loop. Set to false after exiting the modal message loop. +/// +/*--cef()--*/ +void CefSetOSModalLoop(bool osModalLoop); + +/// +// Implement this interface to provide handler implementations. Methods will be +// called by the process and/or thread indicated. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefApp : public virtual CefBase { + public: + /// + // Provides an opportunity to view and/or modify command-line arguments before + // processing by CEF and Chromium. The |process_type| value will be empty for + // the browser process. Do not keep a reference to the CefCommandLine object + // passed to this method. The CefSettings.command_line_args_disabled value + // can be used to start with an empty command-line object. Any values + // specified in CefSettings that equate to command-line arguments will be set + // before this method is called. Be cautious when using this method to modify + // command-line arguments for non-browser processes as this may result in + // undefined behavior including crashes. + /// + /*--cef(optional_param=process_type)--*/ + virtual void OnBeforeCommandLineProcessing( + const CefString& process_type, + CefRefPtr command_line) { + } + + /// + // Provides an opportunity to register custom schemes. Do not keep a reference + // to the |registrar| object. This method is called on the main thread for + // each process and the registered schemes should be the same across all + // processes. + /// + /*--cef()--*/ + virtual void OnRegisterCustomSchemes( + CefRefPtr registrar) { + } + + /// + // Return the handler for resource bundle events. If + // CefSettings.pack_loading_disabled is true a handler must be returned. If no + // handler is returned resources will be loaded from pack files. This method + // is called by the browser and render processes on multiple threads. + /// + /*--cef()--*/ + virtual CefRefPtr GetResourceBundleHandler() { + return NULL; + } + + /// + // Return the handler for functionality specific to the browser process. This + // method is called on multiple threads in the browser process. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowserProcessHandler() { + return NULL; + } + + /// + // Return the handler for functionality specific to the render process. This + // method is called on the render process main thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetRenderProcessHandler() { + return NULL; + } +}; + +#endif // CEF_INCLUDE_CEF_APP_H_ diff --git a/vendor/cef3/include/cef_auth_callback.h b/vendor/cef3/include/cef_auth_callback.h new file mode 100644 index 00000000000..86d249ad3a7 --- /dev/null +++ b/vendor/cef3/include/cef_auth_callback.h @@ -0,0 +1,64 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_AUTH_CALLBACK_H_ +#define CEF_INCLUDE_CEF_AUTH_CALLBACK_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Callback interface used for asynchronous continuation of authentication +// requests. +/// +/*--cef(source=library)--*/ +class CefAuthCallback : public virtual CefBase { + public: + /// + // Continue the authentication request. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(const CefString& username, + const CefString& password) =0; + + /// + // Cancel the authentication request. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +#endif // CEF_INCLUDE_CEF_AUTH_CALLBACK_H_ diff --git a/vendor/cef3/include/cef_base.h b/vendor/cef3/include/cef_base.h new file mode 100644 index 00000000000..c237b9e8d3c --- /dev/null +++ b/vendor/cef3/include/cef_base.h @@ -0,0 +1,180 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_CEF_BASE_H_ +#define CEF_INCLUDE_CEF_BASE_H_ +#pragma once + +#include "include/base/cef_atomic_ref_count.h" +#include "include/base/cef_build.h" +#include "include/base/cef_macros.h" + +// Bring in common C++ type definitions used by CEF consumers. +#include "include/internal/cef_ptr.h" +#include "include/internal/cef_types_wrappers.h" +#if defined(OS_WIN) +#include "include/internal/cef_win.h" +#elif defined(OS_MACOSX) +#include "include/internal/cef_mac.h" +#elif defined(OS_LINUX) +#include "include/internal/cef_linux.h" +#endif + +/// +// Interface defining the reference count implementation methods. All framework +// classes must extend the CefBase class. +/// +class CefBase { + public: + /// + // Called to increment the reference count for the object. Should be called + // for every new copy of a pointer to a given object. + /// + virtual void AddRef() const =0; + + /// + // Called to decrement the reference count for the object. Returns true if + // the reference count is 0, in which case the object should self-delete. + /// + virtual bool Release() const =0; + + /// + // Returns true if the reference count is 1. + /// + virtual bool HasOneRef() const =0; + + protected: + virtual ~CefBase() {} +}; + +/// +// Class that implements atomic reference counting. +/// +class CefRefCount { + public: + CefRefCount() : ref_count_(0) {} + + /// + // Increment the reference count. + /// + void AddRef() const { + base::AtomicRefCountInc(&ref_count_); + } + + /// + // Decrement the reference count. Returns true if the reference count is 0. + /// + bool Release() const { + return !base::AtomicRefCountDec(&ref_count_); + } + + /// + // Returns true if the reference count is 1. + /// + bool HasOneRef() const { + return base::AtomicRefCountIsOne(&ref_count_); + } + + private: + mutable base::AtomicRefCount ref_count_; + DISALLOW_COPY_AND_ASSIGN(CefRefCount); +}; + +/// +// Macro that provides a reference counting implementation for classes extending +// CefBase. +/// +#define IMPLEMENT_REFCOUNTING(ClassName) \ + public: \ + void AddRef() const { \ + ref_count_.AddRef(); \ + } \ + bool Release() const { \ + if (ref_count_.Release()) { \ + delete static_cast(this); \ + return true; \ + } \ + return false; \ + } \ + bool HasOneRef() const { \ + return ref_count_.HasOneRef(); \ + } \ + private: \ + CefRefCount ref_count_; + +/// +// Macro that provides a locking implementation. Use the Lock() and Unlock() +// methods to protect a section of code from simultaneous access by multiple +// threads. The AutoLock class is a helper that will hold the lock while in +// scope. +// +// THIS MACRO IS DEPRECATED. Use an explicit base::Lock member variable and +// base::AutoLock instead. For example: +// +// #include "include/base/cef_lock.h" +// +// // Class declaration. +// class MyClass : public CefBase { +// public: +// MyClass() : value_(0) {} +// // Method that may be called on multiple threads. +// void IncrementValue(); +// private: +// // Value that may be accessed on multiple theads. +// int value_; +// // Lock used to protect access to |value_|. +// base::Lock lock_; +// IMPLEMENT_REFCOUNTING(MyClass); +// }; +// +// // Class implementation. +// void MyClass::IncrementValue() { +// // Acquire the lock for the scope of this method. +// base::AutoLock lock_scope(lock_); +// // |value_| can now be modified safely. +// value_++; +// } +/// +#define IMPLEMENT_LOCKING(ClassName) \ + public: \ + class AutoLock { \ + public: \ + explicit AutoLock(ClassName* base) : base_(base) { base_->Lock(); } \ + ~AutoLock() { base_->Unlock(); } \ + private: \ + ClassName* base_; \ + DISALLOW_COPY_AND_ASSIGN(AutoLock); \ + }; \ + void Lock() { lock_.Acquire(); } \ + void Unlock() { lock_.Release(); } \ + private: \ + base::Lock lock_; + +#endif // CEF_INCLUDE_CEF_BASE_H_ diff --git a/vendor/cef3/include/cef_browser.h b/vendor/cef3/include/cef_browser.h new file mode 100644 index 00000000000..ff274917210 --- /dev/null +++ b/vendor/cef3/include/cef_browser.h @@ -0,0 +1,638 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_BROWSER_H_ +#define CEF_INCLUDE_CEF_BROWSER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_drag_data.h" +#include "include/cef_frame.h" +#include "include/cef_navigation_entry.h" +#include "include/cef_process_message.h" +#include "include/cef_request_context.h" +#include + +class CefBrowserHost; +class CefClient; + + +/// +// Class used to represent a browser window. When used in the browser process +// the methods of this class may be called on any thread unless otherwise +// indicated in the comments. When used in the render process the methods of +// this class may only be called on the main thread. +/// +/*--cef(source=library)--*/ +class CefBrowser : public virtual CefBase { + public: + /// + // Returns the browser host object. This method can only be called in the + // browser process. + /// + /*--cef()--*/ + virtual CefRefPtr GetHost() =0; + + /// + // Returns true if the browser can navigate backwards. + /// + /*--cef()--*/ + virtual bool CanGoBack() =0; + + /// + // Navigate backwards. + /// + /*--cef()--*/ + virtual void GoBack() =0; + + /// + // Returns true if the browser can navigate forwards. + /// + /*--cef()--*/ + virtual bool CanGoForward() =0; + + /// + // Navigate forwards. + /// + /*--cef()--*/ + virtual void GoForward() =0; + + /// + // Returns true if the browser is currently loading. + /// + /*--cef()--*/ + virtual bool IsLoading() =0; + + /// + // Reload the current page. + /// + /*--cef()--*/ + virtual void Reload() =0; + + /// + // Reload the current page ignoring any cached data. + /// + /*--cef()--*/ + virtual void ReloadIgnoreCache() =0; + + /// + // Stop loading the page. + /// + /*--cef()--*/ + virtual void StopLoad() =0; + + /// + // Returns the globally unique identifier for this browser. + /// + /*--cef()--*/ + virtual int GetIdentifier() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if the window is a popup window. + /// + /*--cef()--*/ + virtual bool IsPopup() =0; + + /// + // Returns true if a document has been loaded in the browser. + /// + /*--cef()--*/ + virtual bool HasDocument() =0; + + /// + // Returns the main (top-level) frame for the browser window. + /// + /*--cef()--*/ + virtual CefRefPtr GetMainFrame() =0; + + /// + // Returns the focused frame for the browser window. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusedFrame() =0; + + /// + // Returns the frame with the specified identifier, or NULL if not found. + /// + /*--cef(capi_name=get_frame_byident)--*/ + virtual CefRefPtr GetFrame(int64 identifier) =0; + + /// + // Returns the frame with the specified name, or NULL if not found. + /// + /*--cef(optional_param=name)--*/ + virtual CefRefPtr GetFrame(const CefString& name) =0; + + /// + // Returns the number of frames that currently exist. + /// + /*--cef()--*/ + virtual size_t GetFrameCount() =0; + + /// + // Returns the identifiers of all existing frames. + /// + /*--cef(count_func=identifiers:GetFrameCount)--*/ + virtual void GetFrameIdentifiers(std::vector& identifiers) =0; + + /// + // Returns the names of all existing frames. + /// + /*--cef()--*/ + virtual void GetFrameNames(std::vector& names) =0; + + // + // Send a message to the specified |target_process|. Returns true if the + // message was sent successfully. + /// + /*--cef()--*/ + virtual bool SendProcessMessage(CefProcessId target_process, + CefRefPtr message) =0; +}; + + +/// +// Callback interface for CefBrowserHost::RunFileDialog. The methods of this +// class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefRunFileDialogCallback : public virtual CefBase { + public: + /// + // Called asynchronously after the file dialog is dismissed. If the selection + // was successful |file_paths| will be a single value or a list of values + // depending on the dialog mode. If the selection was cancelled |file_paths| + // will be empty. + /// + /*--cef(capi_name=cont)--*/ + virtual void OnFileDialogDismissed( + CefRefPtr browser_host, + const std::vector& file_paths) =0; +}; + + +/// +// Callback interface for CefBrowserHost::GetNavigationEntries. The methods of +// this class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefNavigationEntryVisitor : public virtual CefBase { + public: + /// + // Method that will be executed. Do not keep a reference to |entry| outside of + // this callback. Return true to continue visiting entries or false to stop. + // |current| is true if this entry is the currently loaded navigation entry. + // |index| is the 0-based index of this entry and |total| is the total number + // of entries. + /// + /*--cef()--*/ + virtual bool Visit(CefRefPtr entry, + bool current, + int index, + int total) =0; +}; + + +/// +// Class used to represent the browser process aspects of a browser window. The +// methods of this class can only be called in the browser process. They may be +// called on any thread in that process unless otherwise indicated in the +// comments. +/// +/*--cef(source=library)--*/ +class CefBrowserHost : public virtual CefBase { + public: + typedef cef_drag_operations_mask_t DragOperationsMask; + typedef cef_file_dialog_mode_t FileDialogMode; + typedef cef_mouse_button_type_t MouseButtonType; + typedef cef_paint_element_type_t PaintElementType; + + /// + // Create a new browser window using the window parameters specified by + // |windowInfo|. All values will be copied internally and the actual window + // will be created on the UI thread. If |request_context| is empty the + // global request context will be used. This method can be called on any + // browser process thread and will not block. + /// + /*--cef(optional_param=client,optional_param=url, + optional_param=request_context)--*/ + static bool CreateBrowser(const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, + const CefBrowserSettings& settings, + CefRefPtr request_context); + + /// + // Create a new browser window using the window parameters specified by + // |windowInfo|. If |request_context| is empty the global request context + // will be used. This method can only be called on the browser process UI + // thread. + /// + /*--cef(optional_param=client,optional_param=url, + optional_param=request_context)--*/ + static CefRefPtr CreateBrowserSync( + const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefString& url, + const CefBrowserSettings& settings, + CefRefPtr request_context); + + /// + // Returns the hosted browser object. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Request that the browser close. The JavaScript 'onbeforeunload' event will + // be fired. If |force_close| is false the event handler, if any, will be + // allowed to prompt the user and the user can optionally cancel the close. + // If |force_close| is true the prompt will not be displayed and the close + // will proceed. Results in a call to CefLifeSpanHandler::DoClose() if the + // event handler allows the close or if |force_close| is true. See + // CefLifeSpanHandler::DoClose() documentation for additional usage + // information. + /// + /*--cef()--*/ + virtual void CloseBrowser(bool force_close) =0; + + /// + // Set whether the browser is focused. + /// + /*--cef()--*/ + virtual void SetFocus(bool focus) =0; + + /// + // Set whether the window containing the browser is visible + // (minimized/unminimized, app hidden/unhidden, etc). Only used on Mac OS X. + /// + /*--cef()--*/ + virtual void SetWindowVisibility(bool visible) =0; + + /// + // Retrieve the window handle for this browser. + /// + /*--cef()--*/ + virtual CefWindowHandle GetWindowHandle() =0; + + /// + // Retrieve the window handle of the browser that opened this browser. Will + // return NULL for non-popup windows. This method can be used in combination + // with custom handling of modal windows. + /// + /*--cef()--*/ + virtual CefWindowHandle GetOpenerWindowHandle() =0; + + /// + // Returns the client for this browser. + /// + /*--cef()--*/ + virtual CefRefPtr GetClient() =0; + + /// + // Returns the request context for this browser. + /// + /*--cef()--*/ + virtual CefRefPtr GetRequestContext() =0; + + /// + // Get the current zoom level. The default zoom level is 0.0. This method can + // only be called on the UI thread. + /// + /*--cef()--*/ + virtual double GetZoomLevel() =0; + + /// + // Change the zoom level to the specified value. Specify 0.0 to reset the + // zoom level. If called on the UI thread the change will be applied + // immediately. Otherwise, the change will be applied asynchronously on the + // UI thread. + /// + /*--cef()--*/ + virtual void SetZoomLevel(double zoomLevel) =0; + + /// + // Call to run a file chooser dialog. Only a single file chooser dialog may be + // pending at any given time. |mode| represents the type of dialog to display. + // |title| to the title to be used for the dialog and may be empty to show the + // default title ("Open" or "Save" depending on the mode). |default_file_name| + // is the default file name to select in the dialog. |accept_types| is a list + // of valid lower-cased MIME types or file extensions specified in an input + // element and is used to restrict selectable files to such types. |callback| + // will be executed after the dialog is dismissed or immediately if another + // dialog is already pending. The dialog will be initiated asynchronously on + // the UI thread. + /// + /*--cef(optional_param=title,optional_param=default_file_name, + optional_param=accept_types)--*/ + virtual void RunFileDialog(FileDialogMode mode, + const CefString& title, + const CefString& default_file_name, + const std::vector& accept_types, + CefRefPtr callback) =0; + + /// + // Download the file at |url| using CefDownloadHandler. + /// + /*--cef()--*/ + virtual void StartDownload(const CefString& url) =0; + + /// + // Print the current browser contents. + /// + /*--cef()--*/ + virtual void Print() =0; + + /// + // Search for |searchText|. |identifier| can be used to have multiple searches + // running simultaniously. |forward| indicates whether to search forward or + // backward within the page. |matchCase| indicates whether the search should + // be case-sensitive. |findNext| indicates whether this is the first request + // or a follow-up. + /// + /*--cef()--*/ + virtual void Find(int identifier, const CefString& searchText, + bool forward, bool matchCase, bool findNext) =0; + + /// + // Cancel all searches that are currently going on. + /// + /*--cef()--*/ + virtual void StopFinding(bool clearSelection) =0; + + /// + // Open developer tools in its own window. If |inspect_element_at| is non- + // empty the element at the specified (x,y) location will be inspected. + /// + /*--cef(optional_param=inspect_element_at)--*/ + virtual void ShowDevTools(const CefWindowInfo& windowInfo, + CefRefPtr client, + const CefBrowserSettings& settings, + const CefPoint& inspect_element_at) =0; + + /// + // Explicitly close the developer tools window if one exists for this browser + // instance. + /// + /*--cef()--*/ + virtual void CloseDevTools() =0; + + /// + // Retrieve a snapshot of current navigation entries as values sent to the + // specified visitor. If |current_only| is true only the current navigation + // entry will be sent, otherwise all navigation entries will be sent. + /// + /// + /*--cef()--*/ + virtual void GetNavigationEntries( + CefRefPtr visitor, + bool current_only) =0; + + /// + // Set whether mouse cursor change is disabled. + /// + /*--cef()--*/ + virtual void SetMouseCursorChangeDisabled(bool disabled) =0; + + /// + // Returns true if mouse cursor change is disabled. + /// + /*--cef()--*/ + virtual bool IsMouseCursorChangeDisabled() =0; + + /// + // If a misspelled word is currently selected in an editable node calling + // this method will replace it with the specified |word|. + /// + /*--cef()--*/ + virtual void ReplaceMisspelling(const CefString& word) =0; + + /// + // Add the specified |word| to the spelling dictionary. + /// + /*--cef()--*/ + virtual void AddWordToDictionary(const CefString& word) =0; + + /// + // Returns true if window rendering is disabled. + /// + /*--cef()--*/ + virtual bool IsWindowRenderingDisabled() =0; + + /// + // Notify the browser that the widget has been resized. The browser will first + // call CefRenderHandler::GetViewRect to get the new size and then call + // CefRenderHandler::OnPaint asynchronously with the updated regions. This + // method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void WasResized() =0; + + /// + // Notify the browser that it has been hidden or shown. Layouting and + // CefRenderHandler::OnPaint notification will stop when the browser is + // hidden. This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void WasHidden(bool hidden) =0; + + /// + // Send a notification to the browser that the screen info has changed. The + // browser will then call CefRenderHandler::GetScreenInfo to update the + // screen information with the new values. This simulates moving the webview + // window from one display to another, or changing the properties of the + // current display. This method is only used when window rendering is + // disabled. + /// + /*--cef()--*/ + virtual void NotifyScreenInfoChanged() =0; + + /// + // Invalidate the view. The browser will call CefRenderHandler::OnPaint + // asynchronously. This method is only used when window rendering is + // disabled. + /// + /*--cef()--*/ + virtual void Invalidate(PaintElementType type) =0; + + /// + // Send a key event to the browser. + /// + /*--cef()--*/ + virtual void SendKeyEvent(const CefKeyEvent& event) =0; + + /// + // Send a mouse click event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + /*--cef()--*/ + virtual void SendMouseClickEvent(const CefMouseEvent& event, + MouseButtonType type, + bool mouseUp, int clickCount) =0; + + /// + // Send a mouse move event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. + /// + /*--cef()--*/ + virtual void SendMouseMoveEvent(const CefMouseEvent& event, + bool mouseLeave) =0; + + /// + // Send a mouse wheel event to the browser. The |x| and |y| coordinates are + // relative to the upper-left corner of the view. The |deltaX| and |deltaY| + // values represent the movement delta in the X and Y directions respectively. + // In order to scroll inside select popups with window rendering disabled + // CefRenderHandler::GetScreenPoint should be implemented properly. + /// + /*--cef()--*/ + virtual void SendMouseWheelEvent(const CefMouseEvent& event, + int deltaX, int deltaY) =0; + + /// + // Send a focus event to the browser. + /// + /*--cef()--*/ + virtual void SendFocusEvent(bool setFocus) =0; + + /// + // Send a capture lost event to the browser. + /// + /*--cef()--*/ + virtual void SendCaptureLostEvent() =0; + + /// + // Notify the browser that the window hosting it is about to be moved or + // resized. This method is only used on Windows and Linux. + /// + /*--cef()--*/ + virtual void NotifyMoveOrResizeStarted() =0; + + /// + // Get the NSTextInputContext implementation for enabling IME on Mac when + // window rendering is disabled. + /// + /*--cef(default_retval=NULL)--*/ + virtual CefTextInputContext GetNSTextInputContext() =0; + + /// + // Handles a keyDown event prior to passing it through the NSTextInputClient + // machinery. + /// + /*--cef()--*/ + virtual void HandleKeyEventBeforeTextInputClient(CefEventHandle keyEvent) =0; + + /// + // Performs any additional actions after NSTextInputClient handles the event. + /// + /*--cef()--*/ + virtual void HandleKeyEventAfterTextInputClient(CefEventHandle keyEvent) =0; + + /// + // Call this method when the user drags the mouse into the web view (before + // calling DragTargetDragOver/DragTargetLeave/DragTargetDrop). + // |drag_data| should not contain file contents as this type of data is not + // allowed to be dragged into the web view. File contents can be removed using + // CefDragData::ResetFileContents (for example, if |drag_data| comes from + // CefRenderHandler::StartDragging). + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDragEnter(CefRefPtr drag_data, + const CefMouseEvent& event, + DragOperationsMask allowed_ops) =0; + + /// + // Call this method each time the mouse is moved across the web view during + // a drag operation (after calling DragTargetDragEnter and before calling + // DragTargetDragLeave/DragTargetDrop). + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDragOver(const CefMouseEvent& event, + DragOperationsMask allowed_ops) =0; + + /// + // Call this method when the user drags the mouse out of the web view (after + // calling DragTargetDragEnter). + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDragLeave() =0; + + /// + // Call this method when the user completes the drag operation by dropping + // the object onto the web view (after calling DragTargetDragEnter). + // The object being dropped is |drag_data|, given as an argument to + // the previous DragTargetDragEnter call. + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragTargetDrop(const CefMouseEvent& event) =0; + + /// + // Call this method when the drag operation started by a + // CefRenderHandler::StartDragging call has ended either in a drop or + // by being cancelled. |x| and |y| are mouse coordinates relative to the + // upper-left corner of the view. If the web view is both the drag source + // and the drag target then all DragTarget* methods should be called before + // DragSource* mthods. + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragSourceEndedAt(int x, int y, DragOperationsMask op) =0; + + /// + // Call this method when the drag operation started by a + // CefRenderHandler::StartDragging call has completed. This method may be + // called immediately without first calling DragSourceEndedAt to cancel a + // drag operation. If the web view is both the drag source and the drag + // target then all DragTarget* methods should be called before DragSource* + // mthods. + // This method is only used when window rendering is disabled. + /// + /*--cef()--*/ + virtual void DragSourceSystemDragEnded() =0; +}; + +#endif // CEF_INCLUDE_CEF_BROWSER_H_ diff --git a/vendor/cef3/include/cef_browser_process_handler.h b/vendor/cef3/include/cef_browser_process_handler.h new file mode 100644 index 00000000000..5d62cb30c1d --- /dev/null +++ b/vendor/cef3/include/cef_browser_process_handler.h @@ -0,0 +1,92 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_BROWSER_PROCESS_HANDLER_H_ +#define CEF_INCLUDE_CEF_BROWSER_PROCESS_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_command_line.h" +#include "include/cef_print_handler.h" +#include "include/cef_values.h" + +/// +// Class used to implement browser process callbacks. The methods of this class +// will be called on the browser process main thread unless otherwise indicated. +/// +/*--cef(source=client)--*/ +class CefBrowserProcessHandler : public virtual CefBase { + public: + /// + // Called on the browser process UI thread immediately after the CEF context + // has been initialized. + /// + /*--cef()--*/ + virtual void OnContextInitialized() {} + + /// + // Called before a child process is launched. Will be called on the browser + // process UI thread when launching a render process and on the browser + // process IO thread when launching a GPU or plugin process. Provides an + // opportunity to modify the child process command line. Do not keep a + // reference to |command_line| outside of this method. + /// + /*--cef()--*/ + virtual void OnBeforeChildProcessLaunch( + CefRefPtr command_line) {} + + /// + // Called on the browser process IO thread after the main thread has been + // created for a new render process. Provides an opportunity to specify extra + // information that will be passed to + // CefRenderProcessHandler::OnRenderThreadCreated() in the render process. Do + // not keep a reference to |extra_info| outside of this method. + /// + /*--cef()--*/ + virtual void OnRenderProcessThreadCreated( + CefRefPtr extra_info) {} + + /// + // Return the handler for printing on Linux. If a print handler is not + // provided then printing will not be supported on the Linux platform. + /// + /*--cef()--*/ + virtual CefRefPtr GetPrintHandler() { + return NULL; + } +}; + +#endif // CEF_INCLUDE_CEF_BROWSER_PROCESS_HANDLER_H_ diff --git a/vendor/cef3/include/cef_callback.h b/vendor/cef3/include/cef_callback.h new file mode 100644 index 00000000000..e5efebd2d42 --- /dev/null +++ b/vendor/cef3/include/cef_callback.h @@ -0,0 +1,75 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_CALLBACK_H_ +#define CEF_INCLUDE_CEF_CALLBACK_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Generic callback interface used for asynchronous continuation. +/// +/*--cef(source=library)--*/ +class CefCallback : public virtual CefBase { + public: + /// + // Continue processing. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue() =0; + + /// + // Cancel processing. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +/// +// Generic callback interface used for asynchronous completion. +/// +/*--cef(source=client)--*/ +class CefCompletionCallback : public virtual CefBase { + public: + /// + // Method that will be called once the task is complete. + /// + /*--cef()--*/ + virtual void OnComplete() =0; +}; + +#endif // CEF_INCLUDE_CEF_CALLBACK_H_ diff --git a/vendor/cef3/include/cef_client.h b/vendor/cef3/include/cef_client.h new file mode 100644 index 00000000000..d413e0e645c --- /dev/null +++ b/vendor/cef3/include/cef_client.h @@ -0,0 +1,185 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_CLIENT_H_ +#define CEF_INCLUDE_CEF_CLIENT_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_context_menu_handler.h" +#include "include/cef_dialog_handler.h" +#include "include/cef_display_handler.h" +#include "include/cef_download_handler.h" +#include "include/cef_drag_handler.h" +#include "include/cef_focus_handler.h" +#include "include/cef_geolocation_handler.h" +#include "include/cef_jsdialog_handler.h" +#include "include/cef_keyboard_handler.h" +#include "include/cef_life_span_handler.h" +#include "include/cef_load_handler.h" +#include "include/cef_process_message.h" +#include "include/cef_render_handler.h" +#include "include/cef_request_handler.h" + +/// +// Implement this interface to provide handler implementations. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefClient : public virtual CefBase { + public: + /// + // Return the handler for context menus. If no handler is provided the default + // implementation will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetContextMenuHandler() { + return NULL; + } + + /// + // Return the handler for dialogs. If no handler is provided the default + // implementation will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetDialogHandler() { + return NULL; + } + + /// + // Return the handler for browser display state events. + /// + /*--cef()--*/ + virtual CefRefPtr GetDisplayHandler() { + return NULL; + } + + /// + // Return the handler for download events. If no handler is returned downloads + // will not be allowed. + /// + /*--cef()--*/ + virtual CefRefPtr GetDownloadHandler() { + return NULL; + } + + /// + // Return the handler for drag events. + /// + /*--cef()--*/ + virtual CefRefPtr GetDragHandler() { + return NULL; + } + + /// + // Return the handler for focus events. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusHandler() { + return NULL; + } + + /// + // Return the handler for geolocation permissions requests. If no handler is + // provided geolocation access will be denied by default. + /// + /*--cef()--*/ + virtual CefRefPtr GetGeolocationHandler() { + return NULL; + } + + /// + // Return the handler for JavaScript dialogs. If no handler is provided the + // default implementation will be used. + /// + /*--cef()--*/ + virtual CefRefPtr GetJSDialogHandler() { + return NULL; + } + + /// + // Return the handler for keyboard events. + /// + /*--cef()--*/ + virtual CefRefPtr GetKeyboardHandler() { + return NULL; + } + + /// + // Return the handler for browser life span events. + /// + /*--cef()--*/ + virtual CefRefPtr GetLifeSpanHandler() { + return NULL; + } + + /// + // Return the handler for browser load status events. + /// + /*--cef()--*/ + virtual CefRefPtr GetLoadHandler() { + return NULL; + } + + /// + // Return the handler for off-screen rendering events. + /// + /*--cef()--*/ + virtual CefRefPtr GetRenderHandler() { + return NULL; + } + + /// + // Return the handler for browser request events. + /// + /*--cef()--*/ + virtual CefRefPtr GetRequestHandler() { + return NULL; + } + + /// + // Called when a new message is received from a different process. Return true + // if the message was handled or false otherwise. Do not keep a reference to + // or attempt to access the message outside of this callback. + /// + /*--cef()--*/ + virtual bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) { + return false; + } +}; + +#endif // CEF_INCLUDE_CEF_CLIENT_H_ diff --git a/vendor/cef3/include/cef_command_line.h b/vendor/cef3/include/cef_command_line.h new file mode 100644 index 00000000000..96241cf43cc --- /dev/null +++ b/vendor/cef3/include/cef_command_line.h @@ -0,0 +1,208 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_COMMAND_LINE_H_ +#define CEF_INCLUDE_CEF_COMMAND_LINE_H_ +#pragma once + +#include "include/cef_base.h" +#include +#include + +/// +// Class used to create and/or parse command line arguments. Arguments with +// '--', '-' and, on Windows, '/' prefixes are considered switches. Switches +// will always precede any arguments without switch prefixes. Switches can +// optionally have a value specified using the '=' delimiter (e.g. +// "-switch=value"). An argument of "--" will terminate switch parsing with all +// subsequent tokens, regardless of prefix, being interpreted as non-switch +// arguments. Switch names are considered case-insensitive. This class can be +// used before CefInitialize() is called. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefCommandLine : public virtual CefBase { + public: + typedef std::vector ArgumentList; + typedef std::map SwitchMap; + + /// + // Create a new CefCommandLine instance. + /// + /*--cef(api_hash_check)--*/ + static CefRefPtr CreateCommandLine(); + + /// + // Returns the singleton global CefCommandLine object. The returned object + // will be read-only. + /// + /*--cef(api_hash_check)--*/ + static CefRefPtr GetGlobalCommandLine(); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Initialize the command line with the specified |argc| and |argv| values. + // The first argument must be the name of the program. This method is only + // supported on non-Windows platforms. + /// + /*--cef()--*/ + virtual void InitFromArgv(int argc, const char* const* argv) =0; + + /// + // Initialize the command line with the string returned by calling + // GetCommandLineW(). This method is only supported on Windows. + /// + /*--cef()--*/ + virtual void InitFromString(const CefString& command_line) =0; + + /// + // Reset the command-line switches and arguments but leave the program + // component unchanged. + /// + /*--cef()--*/ + virtual void Reset() =0; + + /// + // Retrieve the original command line string as a vector of strings. + // The argv array: { program, [(--|-|/)switch[=value]]*, [--], [argument]* } + /// + /*--cef()--*/ + virtual void GetArgv(std::vector& argv) =0; + + /// + // Constructs and returns the represented command line string. Use this method + // cautiously because quoting behavior is unclear. + /// + /*--cef()--*/ + virtual CefString GetCommandLineString() =0; + + /// + // Get the program part of the command line string (the first item). + /// + /*--cef()--*/ + virtual CefString GetProgram() =0; + + /// + // Set the program part of the command line string (the first item). + /// + /*--cef()--*/ + virtual void SetProgram(const CefString& program) =0; + + /// + // Returns true if the command line has switches. + /// + /*--cef()--*/ + virtual bool HasSwitches() =0; + + /// + // Returns true if the command line contains the given switch. + /// + /*--cef()--*/ + virtual bool HasSwitch(const CefString& name) =0; + + /// + // Returns the value associated with the given switch. If the switch has no + // value or isn't present this method returns the empty string. + /// + /*--cef()--*/ + virtual CefString GetSwitchValue(const CefString& name) =0; + + /// + // Returns the map of switch names and values. If a switch has no value an + // empty string is returned. + /// + /*--cef()--*/ + virtual void GetSwitches(SwitchMap& switches) =0; + + /// + // Add a switch to the end of the command line. If the switch has no value + // pass an empty value string. + /// + /*--cef()--*/ + virtual void AppendSwitch(const CefString& name) =0; + + /// + // Add a switch with the specified value to the end of the command line. + /// + /*--cef()--*/ + virtual void AppendSwitchWithValue(const CefString& name, + const CefString& value) =0; + + /// + // True if there are remaining command line arguments. + /// + /*--cef()--*/ + virtual bool HasArguments() =0; + + /// + // Get the remaining command line arguments. + /// + /*--cef()--*/ + virtual void GetArguments(ArgumentList& arguments) =0; + + /// + // Add an argument to the end of the command line. + /// + /*--cef()--*/ + virtual void AppendArgument(const CefString& argument) =0; + + /// + // Insert a command before the current command. + // Common for debuggers, like "valgrind" or "gdb --args". + /// + /*--cef()--*/ + virtual void PrependWrapper(const CefString& wrapper) =0; +}; + +#endif // CEF_INCLUDE_CEF_COMMAND_LINE_H_ diff --git a/vendor/cef3/include/cef_context_menu_handler.h b/vendor/cef3/include/cef_context_menu_handler.h new file mode 100644 index 00000000000..f841722de6d --- /dev/null +++ b/vendor/cef3/include/cef_context_menu_handler.h @@ -0,0 +1,238 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ +#define CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_menu_model.h" + +class CefContextMenuParams; + +/// +// Implement this interface to handle context menu events. The methods of this +// class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefContextMenuHandler : public virtual CefBase { + public: + typedef cef_event_flags_t EventFlags; + + /// + // Called before a context menu is displayed. |params| provides information + // about the context menu state. |model| initially contains the default + // context menu. The |model| can be cleared to show no context menu or + // modified to show a custom menu. Do not keep references to |params| or + // |model| outside of this callback. + /// + /*--cef()--*/ + virtual void OnBeforeContextMenu(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + CefRefPtr model) {} + + /// + // Called to execute a command selected from the context menu. Return true if + // the command was handled or false for the default implementation. See + // cef_menu_id_t for the command ids that have default implementations. All + // user-defined command ids should be between MENU_ID_USER_FIRST and + // MENU_ID_USER_LAST. |params| will have the same values as what was passed to + // OnBeforeContextMenu(). Do not keep a reference to |params| outside of this + // callback. + /// + /*--cef()--*/ + virtual bool OnContextMenuCommand(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr params, + int command_id, + EventFlags event_flags) { return false; } + + /// + // Called when the context menu is dismissed irregardless of whether the menu + // was empty or a command was selected. + /// + /*--cef()--*/ + virtual void OnContextMenuDismissed(CefRefPtr browser, + CefRefPtr frame) {} +}; + + +/// +// Provides information about the context menu state. The ethods of this class +// can only be accessed on browser process the UI thread. +/// +/*--cef(source=library)--*/ +class CefContextMenuParams : public virtual CefBase { + public: + typedef cef_context_menu_type_flags_t TypeFlags; + typedef cef_context_menu_media_type_t MediaType; + typedef cef_context_menu_media_state_flags_t MediaStateFlags; + typedef cef_context_menu_edit_state_flags_t EditStateFlags; + + /// + // Returns the X coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + /*--cef()--*/ + virtual int GetXCoord() =0; + + /// + // Returns the Y coordinate of the mouse where the context menu was invoked. + // Coords are relative to the associated RenderView's origin. + /// + /*--cef()--*/ + virtual int GetYCoord() =0; + + /// + // Returns flags representing the type of node that the context menu was + // invoked on. + /// + /*--cef(default_retval=CM_TYPEFLAG_NONE)--*/ + virtual TypeFlags GetTypeFlags() =0; + + /// + // Returns the URL of the link, if any, that encloses the node that the + // context menu was invoked on. + /// + /*--cef()--*/ + virtual CefString GetLinkUrl() =0; + + /// + // Returns the link URL, if any, to be used ONLY for "copy link address". We + // don't validate this field in the frontend process. + /// + /*--cef()--*/ + virtual CefString GetUnfilteredLinkUrl() =0; + + /// + // Returns the source URL, if any, for the element that the context menu was + // invoked on. Example of elements with source URLs are img, audio, and video. + /// + /*--cef()--*/ + virtual CefString GetSourceUrl() =0; + + /// + // Returns true if the context menu was invoked on an image which has + // non-empty contents. + /// + /*--cef()--*/ + virtual bool HasImageContents() =0; + + /// + // Returns the URL of the top level page that the context menu was invoked on. + /// + /*--cef()--*/ + virtual CefString GetPageUrl() =0; + + /// + // Returns the URL of the subframe that the context menu was invoked on. + /// + /*--cef()--*/ + virtual CefString GetFrameUrl() =0; + + /// + // Returns the character encoding of the subframe that the context menu was + // invoked on. + /// + /*--cef()--*/ + virtual CefString GetFrameCharset() =0; + + /// + // Returns the type of context node that the context menu was invoked on. + /// + /*--cef(default_retval=CM_MEDIATYPE_NONE)--*/ + virtual MediaType GetMediaType() =0; + + /// + // Returns flags representing the actions supported by the media element, if + // any, that the context menu was invoked on. + /// + /*--cef(default_retval=CM_MEDIAFLAG_NONE)--*/ + virtual MediaStateFlags GetMediaStateFlags() =0; + + /// + // Returns the text of the selection, if any, that the context menu was + // invoked on. + /// + /*--cef()--*/ + virtual CefString GetSelectionText() =0; + + /// + // Returns the text of the misspelled word, if any, that the context menu was + // invoked on. + /// + /*--cef()--*/ + virtual CefString GetMisspelledWord() =0; + + /// + // Returns the hash of the misspelled word, if any, that the context menu was + // invoked on. + /// + /*--cef()--*/ + virtual int GetMisspellingHash() =0; + + /// + // Returns true if suggestions exist, false otherwise. Fills in |suggestions| + // from the spell check service for the misspelled word if there is one. + /// + /*--cef()--*/ + virtual bool GetDictionarySuggestions(std::vector& suggestions) =0; + + /// + // Returns true if the context menu was invoked on an editable node. + /// + /*--cef()--*/ + virtual bool IsEditable() =0; + + /// + // Returns true if the context menu was invoked on an editable node where + // spell-check is enabled. + /// + /*--cef()--*/ + virtual bool IsSpellCheckEnabled() =0; + + /// + // Returns flags representing the actions supported by the editable node, if + // any, that the context menu was invoked on. + /// + /*--cef(default_retval=CM_EDITFLAG_NONE)--*/ + virtual EditStateFlags GetEditStateFlags() =0; +}; + +#endif // CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_ diff --git a/vendor/cef3/include/cef_cookie.h b/vendor/cef3/include/cef_cookie.h new file mode 100644 index 00000000000..73506dc46c8 --- /dev/null +++ b/vendor/cef3/include/cef_cookie.h @@ -0,0 +1,166 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_COOKIE_H_ +#define CEF_INCLUDE_CEF_COOKIE_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_callback.h" +#include + +class CefCookieVisitor; + + +/// +// Class used for managing cookies. The methods of this class may be called on +// any thread unless otherwise indicated. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefCookieManager : public virtual CefBase { + public: + /// + // Returns the global cookie manager. By default data will be stored at + // CefSettings.cache_path if specified or in memory otherwise. + /// + /*--cef()--*/ + static CefRefPtr GetGlobalManager(); + + /// + // Creates a new cookie manager. If |path| is empty data will be stored in + // memory only. Otherwise, data will be stored at the specified |path|. To + // persist session cookies (cookies without an expiry date or validity + // interval) set |persist_session_cookies| to true. Session cookies are + // generally intended to be transient and most Web browsers do not persist + // them. Returns NULL if creation fails. + /// + /*--cef(optional_param=path)--*/ + static CefRefPtr CreateManager( + const CefString& path, + bool persist_session_cookies); + + /// + // Set the schemes supported by this manager. By default only "http" and + // "https" schemes are supported. Must be called before any cookies are + // accessed. + /// + /*--cef()--*/ + virtual void SetSupportedSchemes(const std::vector& schemes) =0; + + /// + // Visit all cookies. The returned cookies are ordered by longest path, then + // by earliest creation date. Returns false if cookies cannot be accessed. + /// + /*--cef()--*/ + virtual bool VisitAllCookies(CefRefPtr visitor) =0; + + /// + // Visit a subset of cookies. The results are filtered by the given url + // scheme, host, domain and path. If |includeHttpOnly| is true HTTP-only + // cookies will also be included in the results. The returned cookies are + // ordered by longest path, then by earliest creation date. Returns false if + // cookies cannot be accessed. + /// + /*--cef()--*/ + virtual bool VisitUrlCookies(const CefString& url, bool includeHttpOnly, + CefRefPtr visitor) =0; + + /// + // Sets a cookie given a valid URL and explicit user-provided cookie + // attributes. This function expects each attribute to be well-formed. It will + // check for disallowed characters (e.g. the ';' character is disallowed + // within the cookie value attribute) and will return false without setting + // the cookie if such characters are found. This method must be called on the + // IO thread. + /// + /*--cef()--*/ + virtual bool SetCookie(const CefString& url, const CefCookie& cookie) =0; + + /// + // Delete all cookies that match the specified parameters. If both |url| and + // values |cookie_name| are specified all host and domain cookies matching + // both will be deleted. If only |url| is specified all host cookies (but not + // domain cookies) irrespective of path will be deleted. If |url| is empty all + // cookies for all hosts and domains will be deleted. Returns false if a non- + // empty invalid URL is specified or if cookies cannot be accessed. This + // method must be called on the IO thread. + /// + /*--cef(optional_param=url,optional_param=cookie_name)--*/ + virtual bool DeleteCookies(const CefString& url, + const CefString& cookie_name) =0; + + /// + // Sets the directory path that will be used for storing cookie data. If + // |path| is empty data will be stored in memory only. Otherwise, data will be + // stored at the specified |path|. To persist session cookies (cookies without + // an expiry date or validity interval) set |persist_session_cookies| to true. + // Session cookies are generally intended to be transient and most Web browsers + // do not persist them. Returns false if cookies cannot be accessed. + /// + /*--cef(optional_param=path)--*/ + virtual bool SetStoragePath(const CefString& path, + bool persist_session_cookies) =0; + + /// + // Flush the backing store (if any) to disk and execute the specified + // |callback| on the IO thread when done. Returns false if cookies cannot be + // accessed. + /// + /*--cef(optional_param=handler)--*/ + virtual bool FlushStore(CefRefPtr callback) =0; +}; + + +/// +// Interface to implement for visiting cookie values. The methods of this class +// will always be called on the IO thread. +/// +/*--cef(source=client)--*/ +class CefCookieVisitor : public virtual CefBase { + public: + /// + // Method that will be called once for each cookie. |count| is the 0-based + // index for the current cookie. |total| is the total number of cookies. + // Set |deleteCookie| to true to delete the cookie currently being visited. + // Return false to stop visiting cookies. This method may never be called if + // no cookies are found. + /// + /*--cef()--*/ + virtual bool Visit(const CefCookie& cookie, int count, int total, + bool& deleteCookie) =0; +}; + +#endif // CEF_INCLUDE_CEF_COOKIE_H_ diff --git a/vendor/cef3/include/cef_dialog_handler.h b/vendor/cef3/include/cef_dialog_handler.h new file mode 100644 index 00000000000..83e1048a434 --- /dev/null +++ b/vendor/cef3/include/cef_dialog_handler.h @@ -0,0 +1,98 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DIALOG_HANDLER_H_ +#define CEF_INCLUDE_CEF_DIALOG_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Callback interface for asynchronous continuation of file dialog requests. +/// +/*--cef(source=library)--*/ +class CefFileDialogCallback : public virtual CefBase { + public: + /// + // Continue the file selection with the specified |file_paths|. This may be + // a single value or a list of values depending on the dialog mode. An empty + // value is treated the same as calling Cancel(). + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(const std::vector& file_paths) =0; + + /// + // Cancel the file selection. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + + +/// +// Implement this interface to handle dialog events. The methods of this class +// will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefDialogHandler : public virtual CefBase { + public: + typedef cef_file_dialog_mode_t FileDialogMode; + + /// + // Called to run a file chooser dialog. |mode| represents the type of dialog + // to display. |title| to the title to be used for the dialog and may be empty + // to show the default title ("Open" or "Save" depending on the mode). + // |default_file_name| is the default file name to select in the dialog. + // |accept_types| is a list of valid lower-cased MIME types or file extensions + // specified in an input element and is used to restrict selectable files to + // such types. To display a custom dialog return true and execute |callback| + // either inline or at a later time. To display the default dialog return + // false. + /// + /*--cef(optional_param=title,optional_param=default_file_name, + optional_param=accept_types)--*/ + virtual bool OnFileDialog(CefRefPtr browser, + FileDialogMode mode, + const CefString& title, + const CefString& default_file_name, + const std::vector& accept_types, + CefRefPtr callback) { + return false; + } +}; + +#endif // CEF_INCLUDE_CEF_DIALOG_HANDLER_H_ diff --git a/vendor/cef3/include/cef_display_handler.h b/vendor/cef3/include/cef_display_handler.h new file mode 100644 index 00000000000..681728cd7ec --- /dev/null +++ b/vendor/cef3/include/cef_display_handler.h @@ -0,0 +1,98 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ +#define CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" + +/// +// Implement this interface to handle events related to browser display state. +// The methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDisplayHandler : public virtual CefBase { + public: + /// + // Called when a frame's address has changed. + /// + /*--cef()--*/ + virtual void OnAddressChange(CefRefPtr browser, + CefRefPtr frame, + const CefString& url) {} + + /// + // Called when the page title changes. + /// + /*--cef(optional_param=title)--*/ + virtual void OnTitleChange(CefRefPtr browser, + const CefString& title) {} + + /// + // Called when the browser is about to display a tooltip. |text| contains the + // text that will be displayed in the tooltip. To handle the display of the + // tooltip yourself return true. Otherwise, you can optionally modify |text| + // and then return false to allow the browser to display the tooltip. + // When window rendering is disabled the application is responsible for + // drawing tooltips and the return value is ignored. + /// + /*--cef(optional_param=text)--*/ + virtual bool OnTooltip(CefRefPtr browser, + CefString& text) { return false; } + + /// + // Called when the browser receives a status message. |value| contains the + // text that will be displayed in the status message. + /// + /*--cef(optional_param=value)--*/ + virtual void OnStatusMessage(CefRefPtr browser, + const CefString& value) {} + + /// + // Called to display a console message. Return true to stop the message from + // being output to the console. + /// + /*--cef(optional_param=message,optional_param=source)--*/ + virtual bool OnConsoleMessage(CefRefPtr browser, + const CefString& message, + const CefString& source, + int line) { return false; } +}; + +#endif // CEF_INCLUDE_CEF_DISPLAY_HANDLER_H_ diff --git a/vendor/cef3/include/cef_dom.h b/vendor/cef3/include/cef_dom.h new file mode 100644 index 00000000000..ab0699911dd --- /dev/null +++ b/vendor/cef3/include/cef_dom.h @@ -0,0 +1,340 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DOM_H_ +#define CEF_INCLUDE_CEF_DOM_H_ +#pragma once + +#include "include/cef_base.h" +#include + +class CefDOMDocument; +class CefDOMNode; + +/// +// Interface to implement for visiting the DOM. The methods of this class will +// be called on the render process main thread. +/// +/*--cef(source=client)--*/ +class CefDOMVisitor : public virtual CefBase { + public: + /// + // Method executed for visiting the DOM. The document object passed to this + // method represents a snapshot of the DOM at the time this method is + // executed. DOM objects are only valid for the scope of this method. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this method. + /// + /*--cef()--*/ + virtual void Visit(CefRefPtr document) =0; +}; + + +/// +// Class used to represent a DOM document. The methods of this class should only +// be called on the render process main thread thread. +/// +/*--cef(source=library)--*/ +class CefDOMDocument : public virtual CefBase { + public: + typedef cef_dom_document_type_t Type; + + /// + // Returns the document type. + /// + /*--cef(default_retval=DOM_DOCUMENT_TYPE_UNKNOWN)--*/ + virtual Type GetType() =0; + + /// + // Returns the root document node. + /// + /*--cef()--*/ + virtual CefRefPtr GetDocument() =0; + + /// + // Returns the BODY node of an HTML document. + /// + /*--cef()--*/ + virtual CefRefPtr GetBody() =0; + + /// + // Returns the HEAD node of an HTML document. + /// + /*--cef()--*/ + virtual CefRefPtr GetHead() =0; + + /// + // Returns the title of an HTML document. + /// + /*--cef()--*/ + virtual CefString GetTitle() =0; + + /// + // Returns the document element with the specified ID value. + /// + /*--cef()--*/ + virtual CefRefPtr GetElementById(const CefString& id) =0; + + /// + // Returns the node that currently has keyboard focus. + /// + /*--cef()--*/ + virtual CefRefPtr GetFocusedNode() =0; + + /// + // Returns true if a portion of the document is selected. + /// + /*--cef()--*/ + virtual bool HasSelection() =0; + + /// + // Returns the selection start node. + /// + /*--cef()--*/ + virtual CefRefPtr GetSelectionStartNode() =0; + + /// + // Returns the selection offset within the start node. + /// + /*--cef()--*/ + virtual int GetSelectionStartOffset() =0; + + /// + // Returns the selection end node. + /// + /*--cef()--*/ + virtual CefRefPtr GetSelectionEndNode() =0; + + /// + // Returns the selection offset within the end node. + /// + /*--cef()--*/ + virtual int GetSelectionEndOffset() =0; + + /// + // Returns the contents of this selection as markup. + /// + /*--cef()--*/ + virtual CefString GetSelectionAsMarkup() =0; + + /// + // Returns the contents of this selection as text. + /// + /*--cef()--*/ + virtual CefString GetSelectionAsText() =0; + + /// + // Returns the base URL for the document. + /// + /*--cef()--*/ + virtual CefString GetBaseURL() =0; + + /// + // Returns a complete URL based on the document base URL and the specified + // partial URL. + /// + /*--cef()--*/ + virtual CefString GetCompleteURL(const CefString& partialURL) =0; +}; + + +/// +// Class used to represent a DOM node. The methods of this class should only be +// called on the render process main thread. +/// +/*--cef(source=library)--*/ +class CefDOMNode : public virtual CefBase { + public: + typedef std::map AttributeMap; + typedef cef_dom_node_type_t Type; + + /// + // Returns the type for this node. + /// + /*--cef(default_retval=DOM_NODE_TYPE_UNSUPPORTED)--*/ + virtual Type GetType() =0; + + /// + // Returns true if this is a text node. + /// + /*--cef()--*/ + virtual bool IsText() =0; + + /// + // Returns true if this is an element node. + /// + /*--cef()--*/ + virtual bool IsElement() =0; + + /// + // Returns true if this is an editable node. + /// + /*--cef()--*/ + virtual bool IsEditable() =0; + + /// + // Returns true if this is a form control element node. + /// + /*--cef()--*/ + virtual bool IsFormControlElement() =0; + + /// + // Returns the type of this form control element node. + /// + /*--cef()--*/ + virtual CefString GetFormControlElementType() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns the name of this node. + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the value of this node. + /// + /*--cef()--*/ + virtual CefString GetValue() =0; + + /// + // Set the value of this node. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetValue(const CefString& value) =0; + + /// + // Returns the contents of this node as markup. + /// + /*--cef()--*/ + virtual CefString GetAsMarkup() =0; + + /// + // Returns the document associated with this node. + /// + /*--cef()--*/ + virtual CefRefPtr GetDocument() =0; + + /// + // Returns the parent node. + /// + /*--cef()--*/ + virtual CefRefPtr GetParent() =0; + + /// + // Returns the previous sibling node. + /// + /*--cef()--*/ + virtual CefRefPtr GetPreviousSibling() =0; + + /// + // Returns the next sibling node. + /// + /*--cef()--*/ + virtual CefRefPtr GetNextSibling() =0; + + /// + // Returns true if this node has child nodes. + /// + /*--cef()--*/ + virtual bool HasChildren() =0; + + /// + // Return the first child node. + /// + /*--cef()--*/ + virtual CefRefPtr GetFirstChild() =0; + + /// + // Returns the last child node. + /// + /*--cef()--*/ + virtual CefRefPtr GetLastChild() =0; + + // The following methods are valid only for element nodes. + + /// + // Returns the tag name of this element. + /// + /*--cef()--*/ + virtual CefString GetElementTagName() =0; + + /// + // Returns true if this element has attributes. + /// + /*--cef()--*/ + virtual bool HasElementAttributes() =0; + + /// + // Returns true if this element has an attribute named |attrName|. + /// + /*--cef()--*/ + virtual bool HasElementAttribute(const CefString& attrName) =0; + + /// + // Returns the element attribute named |attrName|. + /// + /*--cef()--*/ + virtual CefString GetElementAttribute(const CefString& attrName) =0; + + /// + // Returns a map of all element attributes. + /// + /*--cef()--*/ + virtual void GetElementAttributes(AttributeMap& attrMap) =0; + + /// + // Set the value for the element attribute named |attrName|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetElementAttribute(const CefString& attrName, + const CefString& value) =0; + + /// + // Returns the inner text of the element. + /// + /*--cef()--*/ + virtual CefString GetElementInnerText() =0; +}; + +#endif // CEF_INCLUDE_CEF_DOM_H_ diff --git a/vendor/cef3/include/cef_download_handler.h b/vendor/cef3/include/cef_download_handler.h new file mode 100644 index 00000000000..f7c26b3cd0c --- /dev/null +++ b/vendor/cef3/include/cef_download_handler.h @@ -0,0 +1,112 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ +#define CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_download_item.h" + + +/// +// Callback interface used to asynchronously continue a download. +/// +/*--cef(source=library)--*/ +class CefBeforeDownloadCallback : public virtual CefBase { + public: + /// + // Call to continue the download. Set |download_path| to the full file path + // for the download including the file name or leave blank to use the + // suggested name and the default temp directory. Set |show_dialog| to true + // if you do wish to show the default "Save As" dialog. + /// + /*--cef(capi_name=cont,optional_param=download_path)--*/ + virtual void Continue(const CefString& download_path, bool show_dialog) =0; +}; + + +/// +// Callback interface used to asynchronously cancel a download. +/// +/*--cef(source=library)--*/ +class CefDownloadItemCallback : public virtual CefBase { + public: + /// + // Call to cancel the download. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + + +/// +// Class used to handle file downloads. The methods of this class will called +// on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefDownloadHandler : public virtual CefBase { + public: + /// + // Called before a download begins. |suggested_name| is the suggested name for + // the download file. By default the download will be canceled. Execute + // |callback| either asynchronously or in this method to continue the download + // if desired. Do not keep a reference to |download_item| outside of this + // method. + /// + /*--cef()--*/ + virtual void OnBeforeDownload( + CefRefPtr browser, + CefRefPtr download_item, + const CefString& suggested_name, + CefRefPtr callback) =0; + + /// + // Called when a download's status or progress information has been updated. + // This may be called multiple times before and after OnBeforeDownload(). + // Execute |callback| either asynchronously or in this method to cancel the + // download if desired. Do not keep a reference to |download_item| outside of + // this method. + /// + /*--cef()--*/ + virtual void OnDownloadUpdated( + CefRefPtr browser, + CefRefPtr download_item, + CefRefPtr callback) {} +}; + +#endif // CEF_INCLUDE_CEF_DOWNLOAD_HANDLER_H_ diff --git a/vendor/cef3/include/cef_download_item.h b/vendor/cef3/include/cef_download_item.h new file mode 100644 index 00000000000..6f76ff5e48c --- /dev/null +++ b/vendor/cef3/include/cef_download_item.h @@ -0,0 +1,148 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DOWNLOAD_ITEM_H_ +#define CEF_INCLUDE_CEF_DOWNLOAD_ITEM_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Class used to represent a download item. +/// +/*--cef(source=library)--*/ +class CefDownloadItem : public virtual CefBase { + public: + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the download is in progress. + /// + /*--cef()--*/ + virtual bool IsInProgress() =0; + + /// + // Returns true if the download is complete. + /// + /*--cef()--*/ + virtual bool IsComplete() =0; + + /// + // Returns true if the download has been canceled or interrupted. + /// + /*--cef()--*/ + virtual bool IsCanceled() =0; + + /// + // Returns a simple speed estimate in bytes/s. + /// + /*--cef()--*/ + virtual int64 GetCurrentSpeed() =0; + + /// + // Returns the rough percent complete or -1 if the receive total size is + // unknown. + /// + /*--cef()--*/ + virtual int GetPercentComplete() =0; + + /// + // Returns the total number of bytes. + /// + /*--cef()--*/ + virtual int64 GetTotalBytes() =0; + + /// + // Returns the number of received bytes. + /// + /*--cef()--*/ + virtual int64 GetReceivedBytes() =0; + + /// + // Returns the time that the download started. + /// + /*--cef()--*/ + virtual CefTime GetStartTime() =0; + + /// + // Returns the time that the download ended. + /// + /*--cef()--*/ + virtual CefTime GetEndTime() =0; + + /// + // Returns the full path to the downloaded or downloading file. + /// + /*--cef()--*/ + virtual CefString GetFullPath() =0; + + /// + // Returns the unique identifier for this download. + /// + /*--cef()--*/ + virtual uint32 GetId() =0; + + /// + // Returns the URL. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Returns the suggested file name. + /// + /*--cef()--*/ + virtual CefString GetSuggestedFileName() =0; + + /// + // Returns the content disposition. + /// + /*--cef()--*/ + virtual CefString GetContentDisposition() =0; + + /// + // Returns the mime type. + /// + /*--cef()--*/ + virtual CefString GetMimeType() =0; +}; + +#endif // CEF_INCLUDE_CEF_DOWNLOAD_ITEM_H_ diff --git a/vendor/cef3/include/cef_drag_data.h b/vendor/cef3/include/cef_drag_data.h new file mode 100644 index 00000000000..8f8094b44ff --- /dev/null +++ b/vendor/cef3/include/cef_drag_data.h @@ -0,0 +1,198 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DRAG_DATA_H_ +#define CEF_INCLUDE_CEF_DRAG_DATA_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_stream.h" +#include + +/// +// Class used to represent drag data. The methods of this class may be called +// on any thread. +/// +/*--cef(source=library)--*/ +class CefDragData : public virtual CefBase { + public: + /// + // Create a new CefDragData object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns a copy of the current object. + /// + /*--cef()--*/ + virtual CefRefPtr Clone() =0; + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns true if the drag data is a link. + /// + /*--cef()--*/ + virtual bool IsLink() =0; + + /// + // Returns true if the drag data is a text or html fragment. + /// + /*--cef()--*/ + virtual bool IsFragment() =0; + + /// + // Returns true if the drag data is a file. + /// + /*--cef()--*/ + virtual bool IsFile() =0; + + /// + // Return the link URL that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkURL() =0; + + /// + // Return the title associated with the link being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkTitle() =0; + + /// + // Return the metadata, if any, associated with the link being dragged. + /// + /*--cef()--*/ + virtual CefString GetLinkMetadata() =0; + + /// + // Return the plain text fragment that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetFragmentText() =0; + + /// + // Return the text/html fragment that is being dragged. + /// + /*--cef()--*/ + virtual CefString GetFragmentHtml() =0; + + /// + // Return the base URL that the fragment came from. This value is used for + // resolving relative URLs and may be empty. + /// + /*--cef()--*/ + virtual CefString GetFragmentBaseURL() =0; + + /// + // Return the name of the file being dragged out of the browser window. + /// + /*--cef()--*/ + virtual CefString GetFileName() =0; + + /// + // Write the contents of the file being dragged out of the web view into + // |writer|. Returns the number of bytes sent to |writer|. If |writer| is + // NULL this method will return the size of the file contents in bytes. + // Call GetFileName() to get a suggested name for the file. + /// + /*--cef(optional_param=writer)--*/ + virtual size_t GetFileContents(CefRefPtr writer) =0; + + /// + // Retrieve the list of file names that are being dragged into the browser + // window. + /// + /*--cef()--*/ + virtual bool GetFileNames(std::vector& names) =0; + + /// + // Set the link URL that is being dragged. + /// + /*--cef(optional_param=url)--*/ + virtual void SetLinkURL(const CefString& url) =0; + + /// + // Set the title associated with the link being dragged. + /// + /*--cef(optional_param=title)--*/ + virtual void SetLinkTitle(const CefString& title) =0; + + /// + // Set the metadata associated with the link being dragged. + /// + /*--cef(optional_param=data)--*/ + virtual void SetLinkMetadata(const CefString& data) =0; + + /// + // Set the plain text fragment that is being dragged. + /// + /*--cef(optional_param=text)--*/ + virtual void SetFragmentText(const CefString& text) =0; + + /// + // Set the text/html fragment that is being dragged. + /// + /*--cef(optional_param=html)--*/ + virtual void SetFragmentHtml(const CefString& html) =0; + + /// + // Set the base URL that the fragment came from. + /// + /*--cef(optional_param=base_url)--*/ + virtual void SetFragmentBaseURL(const CefString& base_url) =0; + + /// + // Reset the file contents. You should do this before calling + // CefBrowserHost::DragTargetDragEnter as the web view does not allow us to + // drag in this kind of data. + /// + /*--cef()--*/ + virtual void ResetFileContents() =0; + + /// + // Add a file that is being dragged into the webview. + /// + /*--cef(optional_param=display_name)--*/ + virtual void AddFile(const CefString& path, const CefString& display_name) =0; +}; + +#endif // CEF_INCLUDE_CEF_DRAG_DATA_H_ diff --git a/vendor/cef3/include/cef_drag_handler.h b/vendor/cef3/include/cef_drag_handler.h new file mode 100644 index 00000000000..7cfc40ba54b --- /dev/null +++ b/vendor/cef3/include/cef_drag_handler.h @@ -0,0 +1,66 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_DRAG_HANDLER_H_ +#define CEF_INCLUDE_CEF_DRAG_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_drag_data.h" +#include "include/cef_browser.h" + +/// +// Implement this interface to handle events related to dragging. The methods of +// this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefDragHandler : public virtual CefBase { + public: + typedef cef_drag_operations_mask_t DragOperationsMask; + + /// + // Called when an external drag event enters the browser window. |dragData| + // contains the drag event data and |mask| represents the type of drag + // operation. Return false for default drag handling behavior or true to + // cancel the drag event. + /// + /*--cef()--*/ + virtual bool OnDragEnter(CefRefPtr browser, + CefRefPtr dragData, + DragOperationsMask mask) { return false; } +}; + +#endif // CEF_INCLUDE_CEF_DRAG_HANDLER_H_ diff --git a/vendor/cef3/include/cef_focus_handler.h b/vendor/cef3/include/cef_focus_handler.h new file mode 100644 index 00000000000..1d91c42ab56 --- /dev/null +++ b/vendor/cef3/include/cef_focus_handler.h @@ -0,0 +1,81 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ +#define CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_dom.h" +#include "include/cef_frame.h" + +/// +// Implement this interface to handle events related to focus. The methods of +// this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefFocusHandler : public virtual CefBase { + public: + typedef cef_focus_source_t FocusSource; + + /// + // Called when the browser component is about to loose focus. For instance, if + // focus was on the last HTML element and the user pressed the TAB key. |next| + // will be true if the browser is giving focus to the next component and false + // if the browser is giving focus to the previous component. + /// + /*--cef()--*/ + virtual void OnTakeFocus(CefRefPtr browser, + bool next) {} + + /// + // Called when the browser component is requesting focus. |source| indicates + // where the focus request is originating from. Return false to allow the + // focus to be set or true to cancel setting the focus. + /// + /*--cef()--*/ + virtual bool OnSetFocus(CefRefPtr browser, + FocusSource source) { return false; } + + /// + // Called when the browser component has received focus. + /// + /*--cef()--*/ + virtual void OnGotFocus(CefRefPtr browser) {} +}; + +#endif // CEF_INCLUDE_CEF_FOCUS_HANDLER_H_ diff --git a/vendor/cef3/include/cef_frame.h b/vendor/cef3/include/cef_frame.h new file mode 100644 index 00000000000..adba66f1ee8 --- /dev/null +++ b/vendor/cef3/include/cef_frame.h @@ -0,0 +1,224 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_FRAME_H_ +#define CEF_INCLUDE_CEF_FRAME_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_dom.h" +#include "include/cef_request.h" +#include "include/cef_stream.h" +#include "include/cef_string_visitor.h" + +class CefBrowser; +class CefV8Context; + +/// +// Class used to represent a frame in the browser window. When used in the +// browser process the methods of this class may be called on any thread unless +// otherwise indicated in the comments. When used in the render process the +// methods of this class may only be called on the main thread. +/// +/*--cef(source=library)--*/ +class CefFrame : public virtual CefBase { + public: + /// + // True if this object is currently attached to a valid frame. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Execute undo in this frame. + /// + /*--cef()--*/ + virtual void Undo() =0; + + /// + // Execute redo in this frame. + /// + /*--cef()--*/ + virtual void Redo() =0; + + /// + // Execute cut in this frame. + /// + /*--cef()--*/ + virtual void Cut() =0; + + /// + // Execute copy in this frame. + /// + /*--cef()--*/ + virtual void Copy() =0; + + /// + // Execute paste in this frame. + /// + /*--cef()--*/ + virtual void Paste() =0; + + /// + // Execute delete in this frame. + /// + /*--cef(capi_name=del)--*/ + virtual void Delete() =0; + + /// + // Execute select all in this frame. + /// + /*--cef()--*/ + virtual void SelectAll() =0; + + /// + // Save this frame's HTML source to a temporary file and open it in the + // default text viewing application. This method can only be called from the + // browser process. + /// + /*--cef()--*/ + virtual void ViewSource() =0; + + /// + // Retrieve this frame's HTML source as a string sent to the specified + // visitor. + /// + /*--cef()--*/ + virtual void GetSource(CefRefPtr visitor) =0; + + /// + // Retrieve this frame's display text as a string sent to the specified + // visitor. + /// + /*--cef()--*/ + virtual void GetText(CefRefPtr visitor) =0; + + /// + // Load the request represented by the |request| object. + /// + /*--cef()--*/ + virtual void LoadRequest(CefRefPtr request) =0; + + /// + // Load the specified |url|. + /// + /*--cef()--*/ + virtual void LoadURL(const CefString& url) =0; + + /// + // Load the contents of |string_val| with the specified dummy |url|. |url| + // should have a standard scheme (for example, http scheme) or behaviors like + // link clicks and web security restrictions may not behave as expected. + /// + /*--cef()--*/ + virtual void LoadString(const CefString& string_val, + const CefString& url) =0; + + /// + // Execute a string of JavaScript code in this frame. The |script_url| + // parameter is the URL where the script in question can be found, if any. + // The renderer may request this URL to show the developer the source of the + // error. The |start_line| parameter is the base line number to use for error + // reporting. + /// + /*--cef(optional_param=script_url)--*/ + virtual void ExecuteJavaScript(const CefString& code, + const CefString& script_url, + int start_line) =0; + + /// + // Returns true if this is the main (top-level) frame. + /// + /*--cef()--*/ + virtual bool IsMain() =0; + + /// + // Returns true if this is the focused frame. + /// + /*--cef()--*/ + virtual bool IsFocused() =0; + + /// + // Returns the name for this frame. If the frame has an assigned name (for + // example, set via the iframe "name" attribute) then that value will be + // returned. Otherwise a unique name will be constructed based on the frame + // parent hierarchy. The main (top-level) frame will always have an empty name + // value. + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the globally unique identifier for this frame. + /// + /*--cef()--*/ + virtual int64 GetIdentifier() =0; + + /// + // Returns the parent of this frame or NULL if this is the main (top-level) + // frame. + /// + /*--cef()--*/ + virtual CefRefPtr GetParent() =0; + + /// + // Returns the URL currently loaded in this frame. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Returns the browser that this frame belongs to. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Get the V8 context associated with the frame. This method can only be + // called from the render process. + /// + /*--cef()--*/ + virtual CefRefPtr GetV8Context() =0; + + /// + // Visit the DOM document. This method can only be called from the render + // process. + /// + /*--cef()--*/ + virtual void VisitDOM(CefRefPtr visitor) =0; +}; + +#endif // CEF_INCLUDE_CEF_FRAME_H_ diff --git a/vendor/cef3/include/cef_geolocation.h b/vendor/cef3/include/cef_geolocation.h new file mode 100644 index 00000000000..69c08779cbb --- /dev/null +++ b/vendor/cef3/include/cef_geolocation.h @@ -0,0 +1,66 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_GEOLOCATION_H_ +#define CEF_INCLUDE_CEF_GEOLOCATION_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Implement this interface to receive geolocation updates. The methods of this +// class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefGetGeolocationCallback : public virtual CefBase { + public: + /// + // Called with the 'best available' location information or, if the location + // update failed, with error information. + /// + /*--cef()--*/ + virtual void OnLocationUpdate(const CefGeoposition& position) =0; +}; + +/// +// Request a one-time geolocation update. This function bypasses any user +// permission checks so should only be used by code that is allowed to access +// location information. +/// +/*--cef()--*/ +bool CefGetGeolocation(CefRefPtr callback); + +#endif // CEF_INCLUDE_CEF_GEOLOCATION_H_ diff --git a/vendor/cef3/include/cef_geolocation_handler.h b/vendor/cef3/include/cef_geolocation_handler.h new file mode 100644 index 00000000000..679621a1ffe --- /dev/null +++ b/vendor/cef3/include/cef_geolocation_handler.h @@ -0,0 +1,97 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_ +#define CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Callback interface used for asynchronous continuation of geolocation +// permission requests. +/// +/*--cef(source=library)--*/ +class CefGeolocationCallback : public virtual CefBase { + public: + /// + // Call to allow or deny geolocation access. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(bool allow) =0; +}; + + +/// +// Implement this interface to handle events related to geolocation permission +// requests. The methods of this class will be called on the browser process UI +// thread. +/// +/*--cef(source=client)--*/ +class CefGeolocationHandler : public virtual CefBase { + public: + /// + // Called when a page requests permission to access geolocation information. + // |requesting_url| is the URL requesting permission and |request_id| is the + // unique ID for the permission request. Return true and call + // CefGeolocationCallback::Continue() either in this method or at a later + // time to continue or cancel the request. Return false to cancel the request + // immediately. + /// + /*--cef()--*/ + virtual bool OnRequestGeolocationPermission( + CefRefPtr browser, + const CefString& requesting_url, + int request_id, + CefRefPtr callback) { + return false; + } + + /// + // Called when a geolocation access request is canceled. |requesting_url| is + // the URL that originally requested permission and |request_id| is the unique + // ID for the permission request. + /// + /*--cef()--*/ + virtual void OnCancelGeolocationPermission( + CefRefPtr browser, + const CefString& requesting_url, + int request_id) { + } +}; + +#endif // CEF_INCLUDE_CEF_GEOLOCATION_HANDLER_H_ diff --git a/vendor/cef3/include/cef_jsdialog_handler.h b/vendor/cef3/include/cef_jsdialog_handler.h new file mode 100644 index 00000000000..29548966ed5 --- /dev/null +++ b/vendor/cef3/include/cef_jsdialog_handler.h @@ -0,0 +1,128 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ +#define CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Callback interface used for asynchronous continuation of JavaScript dialog +// requests. +/// +/*--cef(source=library)--*/ +class CefJSDialogCallback : public virtual CefBase { + public: + /// + // Continue the JS dialog request. Set |success| to true if the OK button was + // pressed. The |user_input| value should be specified for prompt dialogs. + /// + /*--cef(capi_name=cont,optional_param=user_input)--*/ + virtual void Continue(bool success, + const CefString& user_input) =0; +}; + + +/// +// Implement this interface to handle events related to JavaScript dialogs. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefJSDialogHandler : public virtual CefBase { + public: + typedef cef_jsdialog_type_t JSDialogType; + + /// + // Called to run a JavaScript dialog. The |default_prompt_text| value will be + // specified for prompt dialogs only. Set |suppress_message| to true and + // return false to suppress the message (suppressing messages is preferable + // to immediately executing the callback as this is used to detect presumably + // malicious behavior like spamming alert messages in onbeforeunload). Set + // |suppress_message| to false and return false to use the default + // implementation (the default implementation will show one modal dialog at a + // time and suppress any additional dialog requests until the displayed dialog + // is dismissed). Return true if the application will use a custom dialog or + // if the callback has been executed immediately. Custom dialogs may be either + // modal or modeless. If a custom dialog is used the application must execute + // |callback| once the custom dialog is dismissed. + /// + /*--cef(optional_param=origin_url,optional_param=accept_lang, + optional_param=message_text,optional_param=default_prompt_text)--*/ + virtual bool OnJSDialog(CefRefPtr browser, + const CefString& origin_url, + const CefString& accept_lang, + JSDialogType dialog_type, + const CefString& message_text, + const CefString& default_prompt_text, + CefRefPtr callback, + bool& suppress_message) { + return false; + } + + /// + // Called to run a dialog asking the user if they want to leave a page. Return + // false to use the default dialog implementation. Return true if the + // application will use a custom dialog or if the callback has been executed + // immediately. Custom dialogs may be either modal or modeless. If a custom + // dialog is used the application must execute |callback| once the custom + // dialog is dismissed. + /// + /*--cef(optional_param=message_text)--*/ + virtual bool OnBeforeUnloadDialog(CefRefPtr browser, + const CefString& message_text, + bool is_reload, + CefRefPtr callback) { + return false; + } + + /// + // Called to cancel any pending dialogs and reset any saved dialog state. Will + // be called due to events like page navigation irregardless of whether any + // dialogs are currently pending. + /// + /*--cef()--*/ + virtual void OnResetDialogState(CefRefPtr browser) {} + + /// + // Called when the default implementation dialog is closed. + /// + /*--cef()--*/ + virtual void OnDialogClosed(CefRefPtr browser) {} +}; + +#endif // CEF_INCLUDE_CEF_JSDIALOG_HANDLER_H_ diff --git a/vendor/cef3/include/cef_keyboard_handler.h b/vendor/cef3/include/cef_keyboard_handler.h new file mode 100644 index 00000000000..55cb57ef802 --- /dev/null +++ b/vendor/cef3/include/cef_keyboard_handler.h @@ -0,0 +1,74 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ +#define CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Implement this interface to handle events related to keyboard input. The +// methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefKeyboardHandler : public virtual CefBase { + public: + // Called before a keyboard event is sent to the renderer. |event| contains + // information about the keyboard event. |os_event| is the operating system + // event message, if any. Return true if the event was handled or false + // otherwise. If the event will be handled in OnKeyEvent() as a keyboard + // shortcut set |is_keyboard_shortcut| to true and return false. + /*--cef()--*/ + virtual bool OnPreKeyEvent(CefRefPtr browser, + const CefKeyEvent& event, + CefEventHandle os_event, + bool* is_keyboard_shortcut) { return false; } + + /// + // Called after the renderer and JavaScript in the page has had a chance to + // handle the event. |event| contains information about the keyboard event. + // |os_event| is the operating system event message, if any. Return true if + // the keyboard event was handled or false otherwise. + /// + /*--cef()--*/ + virtual bool OnKeyEvent(CefRefPtr browser, + const CefKeyEvent& event, + CefEventHandle os_event) { return false; } +}; + +#endif // CEF_INCLUDE_CEF_KEYBOARD_HANDLER_H_ diff --git a/vendor/cef3/include/cef_life_span_handler.h b/vendor/cef3/include/cef_life_span_handler.h new file mode 100644 index 00000000000..14534961ce8 --- /dev/null +++ b/vendor/cef3/include/cef_life_span_handler.h @@ -0,0 +1,164 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ +#define CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +class CefClient; + +/// +// Implement this interface to handle events related to browser life span. The +// methods of this class will be called on the UI thread unless otherwise +// indicated. +/// +/*--cef(source=client)--*/ +class CefLifeSpanHandler : public virtual CefBase { + public: + /// + // Called on the IO thread before a new popup window is created. The |browser| + // and |frame| parameters represent the source of the popup request. The + // |target_url| and |target_frame_name| values may be empty if none were + // specified with the request. The |popupFeatures| structure contains + // information about the requested popup window. To allow creation of the + // popup window optionally modify |windowInfo|, |client|, |settings| and + // |no_javascript_access| and return false. To cancel creation of the popup + // window return true. The |client| and |settings| values will default to the + // source browser's values. The |no_javascript_access| value indicates whether + // the new browser window should be scriptable and in the same process as the + // source browser. + /*--cef(optional_param=target_url,optional_param=target_frame_name)--*/ + virtual bool OnBeforePopup(CefRefPtr browser, + CefRefPtr frame, + const CefString& target_url, + const CefString& target_frame_name, + const CefPopupFeatures& popupFeatures, + CefWindowInfo& windowInfo, + CefRefPtr& client, + CefBrowserSettings& settings, + bool* no_javascript_access) { + return false; + } + + /// + // Called after a new browser is created. + /// + /*--cef()--*/ + virtual void OnAfterCreated(CefRefPtr browser) {} + + /// + // Called when a modal window is about to display and the modal loop should + // begin running. Return false to use the default modal loop implementation or + // true to use a custom implementation. + /// + /*--cef()--*/ + virtual bool RunModal(CefRefPtr browser) { return false; } + + /// + // Called when a browser has recieved a request to close. This may result + // directly from a call to CefBrowserHost::CloseBrowser() or indirectly if the + // browser is a top-level OS window created by CEF and the user attempts to + // close the window. This method will be called after the JavaScript + // 'onunload' event has been fired. It will not be called for browsers after + // the associated OS window has been destroyed (for those browsers it is no + // longer possible to cancel the close). + // + // If CEF created an OS window for the browser returning false will send an OS + // close notification to the browser window's top-level owner (e.g. WM_CLOSE + // on Windows, performClose: on OS-X and "delete_event" on Linux). If no OS + // window exists (window rendering disabled) returning false will cause the + // browser object to be destroyed immediately. Return true if the browser is + // parented to another window and that other window needs to receive close + // notification via some non-standard technique. + // + // If an application provides its own top-level window it should handle OS + // close notifications by calling CefBrowserHost::CloseBrowser(false) instead + // of immediately closing (see the example below). This gives CEF an + // opportunity to process the 'onbeforeunload' event and optionally cancel the + // close before DoClose() is called. + // + // The CefLifeSpanHandler::OnBeforeClose() method will be called immediately + // before the browser object is destroyed. The application should only exit + // after OnBeforeClose() has been called for all existing browsers. + // + // If the browser represents a modal window and a custom modal loop + // implementation was provided in CefLifeSpanHandler::RunModal() this callback + // should be used to restore the opener window to a usable state. + // + // By way of example consider what should happen during window close when the + // browser is parented to an application-provided top-level OS window. + // 1. User clicks the window close button which sends an OS close + // notification (e.g. WM_CLOSE on Windows, performClose: on OS-X and + // "delete_event" on Linux). + // 2. Application's top-level window receives the close notification and: + // A. Calls CefBrowserHost::CloseBrowser(false). + // B. Cancels the window close. + // 3. JavaScript 'onbeforeunload' handler executes and shows the close + // confirmation dialog (which can be overridden via + // CefJSDialogHandler::OnBeforeUnloadDialog()). + // 4. User approves the close. + // 5. JavaScript 'onunload' handler executes. + // 6. Application's DoClose() handler is called. Application will: + // A. Set a flag to indicate that the next close attempt will be allowed. + // B. Return false. + // 7. CEF sends an OS close notification. + // 8. Application's top-level window receives the OS close notification and + // allows the window to close based on the flag from #6B. + // 9. Browser OS window is destroyed. + // 10. Application's CefLifeSpanHandler::OnBeforeClose() handler is called and + // the browser object is destroyed. + // 11. Application exits by calling CefQuitMessageLoop() if no other browsers + // exist. + /// + /*--cef()--*/ + virtual bool DoClose(CefRefPtr browser) { return false; } + + /// + // Called just before a browser is destroyed. Release all references to the + // browser object and do not attempt to execute any methods on the browser + // object after this callback returns. If this is a modal window and a custom + // modal loop implementation was provided in RunModal() this callback should + // be used to exit the custom modal loop. See DoClose() documentation for + // additional usage information. + /// + /*--cef()--*/ + virtual void OnBeforeClose(CefRefPtr browser) {} +}; + +#endif // CEF_INCLUDE_CEF_LIFE_SPAN_HANDLER_H_ diff --git a/vendor/cef3/include/cef_load_handler.h b/vendor/cef3/include/cef_load_handler.h new file mode 100644 index 00000000000..02d9d9f1a31 --- /dev/null +++ b/vendor/cef3/include/cef_load_handler.h @@ -0,0 +1,107 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_LOAD_HANDLER_H_ +#define CEF_INCLUDE_CEF_LOAD_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" + +/// +// Implement this interface to handle events related to browser load status. The +// methods of this class will be called on the browser process UI thread or +// render process main thread (TID_RENDERER). +/// +/*--cef(source=client)--*/ +class CefLoadHandler : public virtual CefBase { + public: + typedef cef_errorcode_t ErrorCode; + + /// + // Called when the loading state has changed. This callback will be executed + // twice -- once when loading is initiated either programmatically or by user + // action, and once when loading is terminated due to completion, cancellation + // of failure. + /// + /*--cef()--*/ + virtual void OnLoadingStateChange(CefRefPtr browser, + bool isLoading, + bool canGoBack, + bool canGoForward) {} + + /// + // Called when the browser begins loading a frame. The |frame| value will + // never be empty -- call the IsMain() method to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This method + // may not be called for a particular frame if the load request for that frame + // fails. For notification of overall browser load status use + // OnLoadingStateChange instead. + /// + /*--cef()--*/ + virtual void OnLoadStart(CefRefPtr browser, + CefRefPtr frame) {} + + /// + // Called when the browser is done loading a frame. The |frame| value will + // never be empty -- call the IsMain() method to check if this frame is the + // main frame. Multiple frames may be loading at the same time. Sub-frames may + // start or continue loading after the main frame load has ended. This method + // will always be called for all frames irrespective of whether the request + // completes successfully. + /// + /*--cef()--*/ + virtual void OnLoadEnd(CefRefPtr browser, + CefRefPtr frame, + int httpStatusCode) {} + + /// + // Called when the resource load for a navigation fails or is canceled. + // |errorCode| is the error code number, |errorText| is the error text and + // |failedUrl| is the URL that failed to load. See net\base\net_error_list.h + // for complete descriptions of the error codes. + /// + /*--cef(optional_param=errorText)--*/ + virtual void OnLoadError(CefRefPtr browser, + CefRefPtr frame, + ErrorCode errorCode, + const CefString& errorText, + const CefString& failedUrl) {} +}; + +#endif // CEF_INCLUDE_CEF_LOAD_HANDLER_H_ diff --git a/vendor/cef3/include/cef_menu_model.h b/vendor/cef3/include/cef_menu_model.h new file mode 100644 index 00000000000..84728c58b51 --- /dev/null +++ b/vendor/cef3/include/cef_menu_model.h @@ -0,0 +1,402 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_MENU_MODEL_H_ +#define CEF_INCLUDE_CEF_MENU_MODEL_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Supports creation and modification of menus. See cef_menu_id_t for the +// command ids that have default implementations. All user-defined command ids +// should be between MENU_ID_USER_FIRST and MENU_ID_USER_LAST. The methods of +// this class can only be accessed on the browser process the UI thread. +/// +/*--cef(source=library)--*/ +class CefMenuModel : public virtual CefBase { + public: + typedef cef_menu_item_type_t MenuItemType; + + /// + // Clears the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool Clear() =0; + + /// + // Returns the number of items in this menu. + /// + /*--cef()--*/ + virtual int GetCount() =0; + + // + // Add a separator to the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddSeparator() =0; + + // + // Add an item to the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddItem(int command_id, + const CefString& label) =0; + + // + // Add a check item to the menu. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddCheckItem(int command_id, + const CefString& label) =0; + // + // Add a radio item to the menu. Only a single item with the specified + // |group_id| can be checked at a time. Returns true on success. + /// + /*--cef()--*/ + virtual bool AddRadioItem(int command_id, + const CefString& label, + int group_id) =0; + + // + // Add a sub-menu to the menu. The new sub-menu is returned. + /// + /*--cef()--*/ + virtual CefRefPtr AddSubMenu(int command_id, + const CefString& label) =0; + + // + // Insert a separator in the menu at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool InsertSeparatorAt(int index) =0; + + // + // Insert an item in the menu at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool InsertItemAt(int index, + int command_id, + const CefString& label) =0; + + // + // Insert a check item in the menu at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool InsertCheckItemAt(int index, + int command_id, + const CefString& label) =0; + + // + // Insert a radio item in the menu at the specified |index|. Only a single + // item with the specified |group_id| can be checked at a time. Returns true + // on success. + /// + /*--cef()--*/ + virtual bool InsertRadioItemAt(int index, + int command_id, + const CefString& label, + int group_id) =0; + + // + // Insert a sub-menu in the menu at the specified |index|. The new sub-menu + // is returned. + /// + /*--cef()--*/ + virtual CefRefPtr InsertSubMenuAt(int index, + int command_id, + const CefString& label) =0; + + /// + // Removes the item with the specified |command_id|. Returns true on success. + /// + /*--cef()--*/ + virtual bool Remove(int command_id) =0; + + /// + // Removes the item at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool RemoveAt(int index) =0; + + /// + // Returns the index associated with the specified |command_id| or -1 if not + // found due to the command id not existing in the menu. + /// + /*--cef()--*/ + virtual int GetIndexOf(int command_id) =0; + + /// + // Returns the command id at the specified |index| or -1 if not found due to + // invalid range or the index being a separator. + /// + /*--cef()--*/ + virtual int GetCommandIdAt(int index) =0; + + /// + // Sets the command id at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetCommandIdAt(int index, int command_id) =0; + + /// + // Returns the label for the specified |command_id| or empty if not found. + /// + /*--cef()--*/ + virtual CefString GetLabel(int command_id) =0; + + /// + // Returns the label at the specified |index| or empty if not found due to + // invalid range or the index being a separator. + /// + /*--cef()--*/ + virtual CefString GetLabelAt(int index) =0; + + /// + // Sets the label for the specified |command_id|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetLabel(int command_id, const CefString& label) =0; + + /// + // Set the label at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetLabelAt(int index, const CefString& label) =0; + + /// + // Returns the item type for the specified |command_id|. + /// + /*--cef(default_retval=MENUITEMTYPE_NONE)--*/ + virtual MenuItemType GetType(int command_id) =0; + + /// + // Returns the item type at the specified |index|. + /// + /*--cef(default_retval=MENUITEMTYPE_NONE)--*/ + virtual MenuItemType GetTypeAt(int index) =0; + + /// + // Returns the group id for the specified |command_id| or -1 if invalid. + /// + /*--cef()--*/ + virtual int GetGroupId(int command_id) =0; + + /// + // Returns the group id at the specified |index| or -1 if invalid. + /// + /*--cef()--*/ + virtual int GetGroupIdAt(int index) =0; + + /// + // Sets the group id for the specified |command_id|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetGroupId(int command_id, int group_id) =0; + + /// + // Sets the group id at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetGroupIdAt(int index, int group_id) =0; + + /// + // Returns the submenu for the specified |command_id| or empty if invalid. + /// + /*--cef()--*/ + virtual CefRefPtr GetSubMenu(int command_id) =0; + + /// + // Returns the submenu at the specified |index| or empty if invalid. + /// + /*--cef()--*/ + virtual CefRefPtr GetSubMenuAt(int index) =0; + + // + // Returns true if the specified |command_id| is visible. + /// + /*--cef()--*/ + virtual bool IsVisible(int command_id) =0; + + // + // Returns true if the specified |index| is visible. + /// + /*--cef()--*/ + virtual bool IsVisibleAt(int index) =0; + + // + // Change the visibility of the specified |command_id|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetVisible(int command_id, bool visible) =0; + + // + // Change the visibility at the specified |index|. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetVisibleAt(int index, bool visible) =0; + + // + // Returns true if the specified |command_id| is enabled. + /// + /*--cef()--*/ + virtual bool IsEnabled(int command_id) =0; + + // + // Returns true if the specified |index| is enabled. + /// + /*--cef()--*/ + virtual bool IsEnabledAt(int index) =0; + + // + // Change the enabled status of the specified |command_id|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetEnabled(int command_id, bool enabled) =0; + + // + // Change the enabled status at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool SetEnabledAt(int index, bool enabled) =0; + + // + // Returns true if the specified |command_id| is checked. Only applies to + // check and radio items. + /// + /*--cef()--*/ + virtual bool IsChecked(int command_id) =0; + + // + // Returns true if the specified |index| is checked. Only applies to check + // and radio items. + /// + /*--cef()--*/ + virtual bool IsCheckedAt(int index) =0; + + // + // Check the specified |command_id|. Only applies to check and radio items. + // Returns true on success. + /// + /*--cef()--*/ + virtual bool SetChecked(int command_id, bool checked) =0; + + // + // Check the specified |index|. Only applies to check and radio items. Returns + // true on success. + /// + /*--cef()--*/ + virtual bool SetCheckedAt(int index, bool checked) =0; + + // + // Returns true if the specified |command_id| has a keyboard accelerator + // assigned. + /// + /*--cef()--*/ + virtual bool HasAccelerator(int command_id) =0; + + // + // Returns true if the specified |index| has a keyboard accelerator assigned. + /// + /*--cef()--*/ + virtual bool HasAcceleratorAt(int index) =0; + + // + // Set the keyboard accelerator for the specified |command_id|. |key_code| can + // be any virtual key or character value. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetAccelerator(int command_id, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) =0; + + // + // Set the keyboard accelerator at the specified |index|. |key_code| can be + // any virtual key or character value. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetAcceleratorAt(int index, + int key_code, + bool shift_pressed, + bool ctrl_pressed, + bool alt_pressed) =0; + + // + // Remove the keyboard accelerator for the specified |command_id|. Returns + // true on success. + /// + /*--cef()--*/ + virtual bool RemoveAccelerator(int command_id) =0; + + // + // Remove the keyboard accelerator at the specified |index|. Returns true on + // success. + /// + /*--cef()--*/ + virtual bool RemoveAcceleratorAt(int index) =0; + + // + // Retrieves the keyboard accelerator for the specified |command_id|. Returns + // true on success. + /// + /*--cef()--*/ + virtual bool GetAccelerator(int command_id, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) =0; + + // + // Retrieves the keyboard accelerator for the specified |index|. Returns true + // on success. + /// + /*--cef()--*/ + virtual bool GetAcceleratorAt(int index, + int& key_code, + bool& shift_pressed, + bool& ctrl_pressed, + bool& alt_pressed) =0; +}; + +#endif // CEF_INCLUDE_CEF_MENU_MODEL_H_ diff --git a/vendor/cef3/include/cef_navigation_entry.h b/vendor/cef3/include/cef_navigation_entry.h new file mode 100644 index 00000000000..708e3981951 --- /dev/null +++ b/vendor/cef3/include/cef_navigation_entry.h @@ -0,0 +1,120 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ +#define CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Class used to represent an entry in navigation history. +/// +/*--cef(source=library)--*/ +class CefNavigationEntry : public virtual CefBase { + public: + typedef cef_transition_type_t TransitionType; + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the actual URL of the page. For some pages this may be data: URL or + // similar. Use GetDisplayURL() to return a display-friendly version. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Returns a display-friendly version of the URL. + /// + /*--cef()--*/ + virtual CefString GetDisplayURL() =0; + + /// + // Returns the original URL that was entered by the user before any redirects. + /// + /*--cef()--*/ + virtual CefString GetOriginalURL() =0; + + /// + // Returns the title set by the page. This value may be empty. + /// + /*--cef()--*/ + virtual CefString GetTitle() =0; + + /// + // Returns the transition type which indicates what the user did to move to + // this page from the previous page. + /// + /*--cef(default_retval=TT_EXPLICIT)--*/ + virtual TransitionType GetTransitionType() =0; + + /// + // Returns true if this navigation includes post data. + /// + /*--cef()--*/ + virtual bool HasPostData() =0; + + /// + // Returns the name of the sub-frame that navigated or an empty value if the + // main frame navigated. + /// + /*--cef()--*/ + virtual CefString GetFrameName() =0; + + /// + // Returns the time for the last known successful navigation completion. A + // navigation may be completed more than once if the page is reloaded. May be + // 0 if the navigation has not yet completed. + /// + /*--cef()--*/ + virtual CefTime GetCompletionTime() =0; + + /// + // Returns the HTTP status code for the last known successful navigation + // response. May be 0 if the response has not yet been received or if the + // navigation has not yet completed. + /// + /*--cef()--*/ + virtual int GetHttpStatusCode() =0; +}; + +#endif // CEF_INCLUDE_CEF_NAVIGATION_ENTRY_H_ diff --git a/vendor/cef3/include/cef_origin_whitelist.h b/vendor/cef3/include/cef_origin_whitelist.h new file mode 100644 index 00000000000..7fed3453a73 --- /dev/null +++ b/vendor/cef3/include/cef_origin_whitelist.h @@ -0,0 +1,103 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ +#define CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ +#pragma once + +#include "include/cef_base.h" + + +/// +// Add an entry to the cross-origin access whitelist. +// +// The same-origin policy restricts how scripts hosted from different origins +// (scheme + domain + port) can communicate. By default, scripts can only access +// resources with the same origin. Scripts hosted on the HTTP and HTTPS schemes +// (but no other schemes) can use the "Access-Control-Allow-Origin" header to +// allow cross-origin requests. For example, https://source.example.com can make +// XMLHttpRequest requests on http://target.example.com if the +// http://target.example.com request returns an "Access-Control-Allow-Origin: +// https://source.example.com" response header. +// +// Scripts in separate frames or iframes and hosted from the same protocol and +// domain suffix can execute cross-origin JavaScript if both pages set the +// document.domain value to the same domain suffix. For example, +// scheme://foo.example.com and scheme://bar.example.com can communicate using +// JavaScript if both domains set document.domain="example.com". +// +// This method is used to allow access to origins that would otherwise violate +// the same-origin policy. Scripts hosted underneath the fully qualified +// |source_origin| URL (like http://www.example.com) will be allowed access to +// all resources hosted on the specified |target_protocol| and |target_domain|. +// If |target_domain| is non-empty and |allow_target_subdomains| if false only +// exact domain matches will be allowed. If |target_domain| contains a top- +// level domain component (like "example.com") and |allow_target_subdomains| is +// true sub-domain matches will be allowed. If |target_domain| is empty and +// |allow_target_subdomains| if true all domains and IP addresses will be +// allowed. +// +// This method cannot be used to bypass the restrictions on local or display +// isolated schemes. See the comments on CefRegisterCustomScheme for more +// information. +// +// This function may be called on any thread. Returns false if |source_origin| +// is invalid or the whitelist cannot be accessed. +/// +/*--cef(optional_param=target_domain)--*/ +bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, + const CefString& target_protocol, + const CefString& target_domain, + bool allow_target_subdomains); + +/// +// Remove an entry from the cross-origin access whitelist. Returns false if +// |source_origin| is invalid or the whitelist cannot be accessed. +/// +/*--cef(optional_param=target_domain)--*/ +bool CefRemoveCrossOriginWhitelistEntry(const CefString& source_origin, + const CefString& target_protocol, + const CefString& target_domain, + bool allow_target_subdomains); + +/// +// Remove all entries from the cross-origin access whitelist. Returns false if +// the whitelist cannot be accessed. +/// +/*--cef()--*/ +bool CefClearCrossOriginWhitelist(); + +#endif // CEF_INCLUDE_CEF_ORIGIN_WHITELIST_H_ diff --git a/vendor/cef3/include/cef_pack_resources.h b/vendor/cef3/include/cef_pack_resources.h new file mode 100644 index 00000000000..a5a69a5ac9a --- /dev/null +++ b/vendor/cef3/include/cef_pack_resources.h @@ -0,0 +1,977 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file is generated by the make_pack_header.py tool. +// + +#ifndef CEF_INCLUDE_CEF_PACK_RESOURCES_H_ +#define CEF_INCLUDE_CEF_PACK_RESOURCES_H_ +#pragma once + +// --------------------------------------------------------------------------- +// From blink_resources.h: + +#define IDR_UASTYLE_HTML_CSS 30500 +#define IDR_UASTYLE_QUIRKS_CSS 30501 +#define IDR_UASTYLE_VIEW_SOURCE_CSS 30502 +#define IDR_UASTYLE_THEME_CHROMIUM_CSS 30503 +#define IDR_UASTYLE_THEME_CHROMIUM_ANDROID_CSS 30504 +#define IDR_UASTYLE_MEDIA_CONTROLS_ANDROID_CSS 30505 +#define IDR_UASTYLE_THEME_CHROMIUM_LINUX_CSS 30506 +#define IDR_UASTYLE_THEME_MAC_CSS 30507 +#define IDR_UASTYLE_THEME_CHROMIUM_SKIA_CSS 30508 +#define IDR_UASTYLE_THEME_INPUT_MULTIPLE_FIELDS_CSS 30509 +#define IDR_UASTYLE_THEME_WIN_CSS 30510 +#define IDR_UASTYLE_THEME_WIN_QUIRKS_CSS 30511 +#define IDR_UASTYLE_SVG_CSS 30512 +#define IDR_UASTYLE_NAVIGATION_TRANSITIONS_CSS 30513 +#define IDR_UASTYLE_MATHML_CSS 30514 +#define IDR_UASTYLE_MEDIA_CONTROLS_CSS 30515 +#define IDR_UASTYLE_FULLSCREEN_CSS 30516 +#define IDR_UASTYLE_XHTMLMP_CSS 30517 +#define IDR_UASTYLE_VIEWPORT_ANDROID_CSS 30518 +#define IDR_INSPECTOR_OVERLAY_PAGE_HTML 30519 +#define IDR_INSPECTOR_INJECTED_SCRIPT_CANVAS_MODULE_SOURCE_JS 30520 +#define IDR_INSPECTOR_INJECTED_SCRIPT_SOURCE_JS 30521 +#define IDR_INSPECTOR_DEBUGGER_SCRIPT_SOURCE_JS 30522 +#define IDR_PRIVATE_SCRIPT_DOCUMENTEXECCOMMAND_JS 30523 +#define IDR_PRIVATE_SCRIPT_DOCUMENTXMLTREEVIEWER_JS 30524 +#define IDR_PRIVATE_SCRIPT_HTMLMARQUEEELEMENT_JS 30525 +#define IDR_PRIVATE_SCRIPT_PLUGINPLACEHOLDERELEMENT_JS 30526 +#define IDR_PRIVATE_SCRIPT_PRIVATESCRIPTRUNNER_JS 30527 +#define IDR_PICKER_COMMON_JS 30528 +#define IDR_PICKER_COMMON_CSS 30529 +#define IDR_CALENDAR_PICKER_CSS 30530 +#define IDR_CALENDAR_PICKER_JS 30531 +#define IDR_PICKER_BUTTON_CSS 30532 +#define IDR_SUGGESTION_PICKER_CSS 30533 +#define IDR_SUGGESTION_PICKER_JS 30534 +#define IDR_COLOR_SUGGESTION_PICKER_CSS 30535 +#define IDR_COLOR_SUGGESTION_PICKER_JS 30536 +#define IDR_AUDIO_SPATIALIZATION_COMPOSITE 30537 +#define IDR_AUDIO_SPATIALIZATION_T000_P000 30538 +#define IDR_AUDIO_SPATIALIZATION_T000_P015 30539 +#define IDR_AUDIO_SPATIALIZATION_T000_P030 30540 +#define IDR_AUDIO_SPATIALIZATION_T000_P045 30541 +#define IDR_AUDIO_SPATIALIZATION_T000_P060 30542 +#define IDR_AUDIO_SPATIALIZATION_T000_P075 30543 +#define IDR_AUDIO_SPATIALIZATION_T000_P090 30544 +#define IDR_AUDIO_SPATIALIZATION_T000_P315 30545 +#define IDR_AUDIO_SPATIALIZATION_T000_P330 30546 +#define IDR_AUDIO_SPATIALIZATION_T000_P345 30547 +#define IDR_AUDIO_SPATIALIZATION_T015_P000 30548 +#define IDR_AUDIO_SPATIALIZATION_T015_P015 30549 +#define IDR_AUDIO_SPATIALIZATION_T015_P030 30550 +#define IDR_AUDIO_SPATIALIZATION_T015_P045 30551 +#define IDR_AUDIO_SPATIALIZATION_T015_P060 30552 +#define IDR_AUDIO_SPATIALIZATION_T015_P075 30553 +#define IDR_AUDIO_SPATIALIZATION_T015_P090 30554 +#define IDR_AUDIO_SPATIALIZATION_T015_P315 30555 +#define IDR_AUDIO_SPATIALIZATION_T015_P330 30556 +#define IDR_AUDIO_SPATIALIZATION_T015_P345 30557 +#define IDR_AUDIO_SPATIALIZATION_T030_P000 30558 +#define IDR_AUDIO_SPATIALIZATION_T030_P015 30559 +#define IDR_AUDIO_SPATIALIZATION_T030_P030 30560 +#define IDR_AUDIO_SPATIALIZATION_T030_P045 30561 +#define IDR_AUDIO_SPATIALIZATION_T030_P060 30562 +#define IDR_AUDIO_SPATIALIZATION_T030_P075 30563 +#define IDR_AUDIO_SPATIALIZATION_T030_P090 30564 +#define IDR_AUDIO_SPATIALIZATION_T030_P315 30565 +#define IDR_AUDIO_SPATIALIZATION_T030_P330 30566 +#define IDR_AUDIO_SPATIALIZATION_T030_P345 30567 +#define IDR_AUDIO_SPATIALIZATION_T045_P000 30568 +#define IDR_AUDIO_SPATIALIZATION_T045_P015 30569 +#define IDR_AUDIO_SPATIALIZATION_T045_P030 30570 +#define IDR_AUDIO_SPATIALIZATION_T045_P045 30571 +#define IDR_AUDIO_SPATIALIZATION_T045_P060 30572 +#define IDR_AUDIO_SPATIALIZATION_T045_P075 30573 +#define IDR_AUDIO_SPATIALIZATION_T045_P090 30574 +#define IDR_AUDIO_SPATIALIZATION_T045_P315 30575 +#define IDR_AUDIO_SPATIALIZATION_T045_P330 30576 +#define IDR_AUDIO_SPATIALIZATION_T045_P345 30577 +#define IDR_AUDIO_SPATIALIZATION_T060_P000 30578 +#define IDR_AUDIO_SPATIALIZATION_T060_P015 30579 +#define IDR_AUDIO_SPATIALIZATION_T060_P030 30580 +#define IDR_AUDIO_SPATIALIZATION_T060_P045 30581 +#define IDR_AUDIO_SPATIALIZATION_T060_P060 30582 +#define IDR_AUDIO_SPATIALIZATION_T060_P075 30583 +#define IDR_AUDIO_SPATIALIZATION_T060_P090 30584 +#define IDR_AUDIO_SPATIALIZATION_T060_P315 30585 +#define IDR_AUDIO_SPATIALIZATION_T060_P330 30586 +#define IDR_AUDIO_SPATIALIZATION_T060_P345 30587 +#define IDR_AUDIO_SPATIALIZATION_T075_P000 30588 +#define IDR_AUDIO_SPATIALIZATION_T075_P015 30589 +#define IDR_AUDIO_SPATIALIZATION_T075_P030 30590 +#define IDR_AUDIO_SPATIALIZATION_T075_P045 30591 +#define IDR_AUDIO_SPATIALIZATION_T075_P060 30592 +#define IDR_AUDIO_SPATIALIZATION_T075_P075 30593 +#define IDR_AUDIO_SPATIALIZATION_T075_P090 30594 +#define IDR_AUDIO_SPATIALIZATION_T075_P315 30595 +#define IDR_AUDIO_SPATIALIZATION_T075_P330 30596 +#define IDR_AUDIO_SPATIALIZATION_T075_P345 30597 +#define IDR_AUDIO_SPATIALIZATION_T090_P000 30598 +#define IDR_AUDIO_SPATIALIZATION_T090_P015 30599 +#define IDR_AUDIO_SPATIALIZATION_T090_P030 30600 +#define IDR_AUDIO_SPATIALIZATION_T090_P045 30601 +#define IDR_AUDIO_SPATIALIZATION_T090_P060 30602 +#define IDR_AUDIO_SPATIALIZATION_T090_P075 30603 +#define IDR_AUDIO_SPATIALIZATION_T090_P090 30604 +#define IDR_AUDIO_SPATIALIZATION_T090_P315 30605 +#define IDR_AUDIO_SPATIALIZATION_T090_P330 30606 +#define IDR_AUDIO_SPATIALIZATION_T090_P345 30607 +#define IDR_AUDIO_SPATIALIZATION_T105_P000 30608 +#define IDR_AUDIO_SPATIALIZATION_T105_P015 30609 +#define IDR_AUDIO_SPATIALIZATION_T105_P030 30610 +#define IDR_AUDIO_SPATIALIZATION_T105_P045 30611 +#define IDR_AUDIO_SPATIALIZATION_T105_P060 30612 +#define IDR_AUDIO_SPATIALIZATION_T105_P075 30613 +#define IDR_AUDIO_SPATIALIZATION_T105_P090 30614 +#define IDR_AUDIO_SPATIALIZATION_T105_P315 30615 +#define IDR_AUDIO_SPATIALIZATION_T105_P330 30616 +#define IDR_AUDIO_SPATIALIZATION_T105_P345 30617 +#define IDR_AUDIO_SPATIALIZATION_T120_P000 30618 +#define IDR_AUDIO_SPATIALIZATION_T120_P015 30619 +#define IDR_AUDIO_SPATIALIZATION_T120_P030 30620 +#define IDR_AUDIO_SPATIALIZATION_T120_P045 30621 +#define IDR_AUDIO_SPATIALIZATION_T120_P060 30622 +#define IDR_AUDIO_SPATIALIZATION_T120_P075 30623 +#define IDR_AUDIO_SPATIALIZATION_T120_P090 30624 +#define IDR_AUDIO_SPATIALIZATION_T120_P315 30625 +#define IDR_AUDIO_SPATIALIZATION_T120_P330 30626 +#define IDR_AUDIO_SPATIALIZATION_T120_P345 30627 +#define IDR_AUDIO_SPATIALIZATION_T135_P000 30628 +#define IDR_AUDIO_SPATIALIZATION_T135_P015 30629 +#define IDR_AUDIO_SPATIALIZATION_T135_P030 30630 +#define IDR_AUDIO_SPATIALIZATION_T135_P045 30631 +#define IDR_AUDIO_SPATIALIZATION_T135_P060 30632 +#define IDR_AUDIO_SPATIALIZATION_T135_P075 30633 +#define IDR_AUDIO_SPATIALIZATION_T135_P090 30634 +#define IDR_AUDIO_SPATIALIZATION_T135_P315 30635 +#define IDR_AUDIO_SPATIALIZATION_T135_P330 30636 +#define IDR_AUDIO_SPATIALIZATION_T135_P345 30637 +#define IDR_AUDIO_SPATIALIZATION_T150_P000 30638 +#define IDR_AUDIO_SPATIALIZATION_T150_P015 30639 +#define IDR_AUDIO_SPATIALIZATION_T150_P030 30640 +#define IDR_AUDIO_SPATIALIZATION_T150_P045 30641 +#define IDR_AUDIO_SPATIALIZATION_T150_P060 30642 +#define IDR_AUDIO_SPATIALIZATION_T150_P075 30643 +#define IDR_AUDIO_SPATIALIZATION_T150_P090 30644 +#define IDR_AUDIO_SPATIALIZATION_T150_P315 30645 +#define IDR_AUDIO_SPATIALIZATION_T150_P330 30646 +#define IDR_AUDIO_SPATIALIZATION_T150_P345 30647 +#define IDR_AUDIO_SPATIALIZATION_T165_P000 30648 +#define IDR_AUDIO_SPATIALIZATION_T165_P015 30649 +#define IDR_AUDIO_SPATIALIZATION_T165_P030 30650 +#define IDR_AUDIO_SPATIALIZATION_T165_P045 30651 +#define IDR_AUDIO_SPATIALIZATION_T165_P060 30652 +#define IDR_AUDIO_SPATIALIZATION_T165_P075 30653 +#define IDR_AUDIO_SPATIALIZATION_T165_P090 30654 +#define IDR_AUDIO_SPATIALIZATION_T165_P315 30655 +#define IDR_AUDIO_SPATIALIZATION_T165_P330 30656 +#define IDR_AUDIO_SPATIALIZATION_T165_P345 30657 +#define IDR_AUDIO_SPATIALIZATION_T180_P000 30658 +#define IDR_AUDIO_SPATIALIZATION_T180_P015 30659 +#define IDR_AUDIO_SPATIALIZATION_T180_P030 30660 +#define IDR_AUDIO_SPATIALIZATION_T180_P045 30661 +#define IDR_AUDIO_SPATIALIZATION_T180_P060 30662 +#define IDR_AUDIO_SPATIALIZATION_T180_P075 30663 +#define IDR_AUDIO_SPATIALIZATION_T180_P090 30664 +#define IDR_AUDIO_SPATIALIZATION_T180_P315 30665 +#define IDR_AUDIO_SPATIALIZATION_T180_P330 30666 +#define IDR_AUDIO_SPATIALIZATION_T180_P345 30667 +#define IDR_AUDIO_SPATIALIZATION_T195_P000 30668 +#define IDR_AUDIO_SPATIALIZATION_T195_P015 30669 +#define IDR_AUDIO_SPATIALIZATION_T195_P030 30670 +#define IDR_AUDIO_SPATIALIZATION_T195_P045 30671 +#define IDR_AUDIO_SPATIALIZATION_T195_P060 30672 +#define IDR_AUDIO_SPATIALIZATION_T195_P075 30673 +#define IDR_AUDIO_SPATIALIZATION_T195_P090 30674 +#define IDR_AUDIO_SPATIALIZATION_T195_P315 30675 +#define IDR_AUDIO_SPATIALIZATION_T195_P330 30676 +#define IDR_AUDIO_SPATIALIZATION_T195_P345 30677 +#define IDR_AUDIO_SPATIALIZATION_T210_P000 30678 +#define IDR_AUDIO_SPATIALIZATION_T210_P015 30679 +#define IDR_AUDIO_SPATIALIZATION_T210_P030 30680 +#define IDR_AUDIO_SPATIALIZATION_T210_P045 30681 +#define IDR_AUDIO_SPATIALIZATION_T210_P060 30682 +#define IDR_AUDIO_SPATIALIZATION_T210_P075 30683 +#define IDR_AUDIO_SPATIALIZATION_T210_P090 30684 +#define IDR_AUDIO_SPATIALIZATION_T210_P315 30685 +#define IDR_AUDIO_SPATIALIZATION_T210_P330 30686 +#define IDR_AUDIO_SPATIALIZATION_T210_P345 30687 +#define IDR_AUDIO_SPATIALIZATION_T225_P000 30688 +#define IDR_AUDIO_SPATIALIZATION_T225_P015 30689 +#define IDR_AUDIO_SPATIALIZATION_T225_P030 30690 +#define IDR_AUDIO_SPATIALIZATION_T225_P045 30691 +#define IDR_AUDIO_SPATIALIZATION_T225_P060 30692 +#define IDR_AUDIO_SPATIALIZATION_T225_P075 30693 +#define IDR_AUDIO_SPATIALIZATION_T225_P090 30694 +#define IDR_AUDIO_SPATIALIZATION_T225_P315 30695 +#define IDR_AUDIO_SPATIALIZATION_T225_P330 30696 +#define IDR_AUDIO_SPATIALIZATION_T225_P345 30697 +#define IDR_AUDIO_SPATIALIZATION_T240_P000 30698 +#define IDR_AUDIO_SPATIALIZATION_T240_P015 30699 +#define IDR_AUDIO_SPATIALIZATION_T240_P030 30700 +#define IDR_AUDIO_SPATIALIZATION_T240_P045 30701 +#define IDR_AUDIO_SPATIALIZATION_T240_P060 30702 +#define IDR_AUDIO_SPATIALIZATION_T240_P075 30703 +#define IDR_AUDIO_SPATIALIZATION_T240_P090 30704 +#define IDR_AUDIO_SPATIALIZATION_T240_P315 30705 +#define IDR_AUDIO_SPATIALIZATION_T240_P330 30706 +#define IDR_AUDIO_SPATIALIZATION_T240_P345 30707 +#define IDR_AUDIO_SPATIALIZATION_T255_P000 30708 +#define IDR_AUDIO_SPATIALIZATION_T255_P015 30709 +#define IDR_AUDIO_SPATIALIZATION_T255_P030 30710 +#define IDR_AUDIO_SPATIALIZATION_T255_P045 30711 +#define IDR_AUDIO_SPATIALIZATION_T255_P060 30712 +#define IDR_AUDIO_SPATIALIZATION_T255_P075 30713 +#define IDR_AUDIO_SPATIALIZATION_T255_P090 30714 +#define IDR_AUDIO_SPATIALIZATION_T255_P315 30715 +#define IDR_AUDIO_SPATIALIZATION_T255_P330 30716 +#define IDR_AUDIO_SPATIALIZATION_T255_P345 30717 +#define IDR_AUDIO_SPATIALIZATION_T270_P000 30718 +#define IDR_AUDIO_SPATIALIZATION_T270_P015 30719 +#define IDR_AUDIO_SPATIALIZATION_T270_P030 30720 +#define IDR_AUDIO_SPATIALIZATION_T270_P045 30721 +#define IDR_AUDIO_SPATIALIZATION_T270_P060 30722 +#define IDR_AUDIO_SPATIALIZATION_T270_P075 30723 +#define IDR_AUDIO_SPATIALIZATION_T270_P090 30724 +#define IDR_AUDIO_SPATIALIZATION_T270_P315 30725 +#define IDR_AUDIO_SPATIALIZATION_T270_P330 30726 +#define IDR_AUDIO_SPATIALIZATION_T270_P345 30727 +#define IDR_AUDIO_SPATIALIZATION_T285_P000 30728 +#define IDR_AUDIO_SPATIALIZATION_T285_P015 30729 +#define IDR_AUDIO_SPATIALIZATION_T285_P030 30730 +#define IDR_AUDIO_SPATIALIZATION_T285_P045 30731 +#define IDR_AUDIO_SPATIALIZATION_T285_P060 30732 +#define IDR_AUDIO_SPATIALIZATION_T285_P075 30733 +#define IDR_AUDIO_SPATIALIZATION_T285_P090 30734 +#define IDR_AUDIO_SPATIALIZATION_T285_P315 30735 +#define IDR_AUDIO_SPATIALIZATION_T285_P330 30736 +#define IDR_AUDIO_SPATIALIZATION_T285_P345 30737 +#define IDR_AUDIO_SPATIALIZATION_T300_P000 30738 +#define IDR_AUDIO_SPATIALIZATION_T300_P015 30739 +#define IDR_AUDIO_SPATIALIZATION_T300_P030 30740 +#define IDR_AUDIO_SPATIALIZATION_T300_P045 30741 +#define IDR_AUDIO_SPATIALIZATION_T300_P060 30742 +#define IDR_AUDIO_SPATIALIZATION_T300_P075 30743 +#define IDR_AUDIO_SPATIALIZATION_T300_P090 30744 +#define IDR_AUDIO_SPATIALIZATION_T300_P315 30745 +#define IDR_AUDIO_SPATIALIZATION_T300_P330 30746 +#define IDR_AUDIO_SPATIALIZATION_T300_P345 30747 +#define IDR_AUDIO_SPATIALIZATION_T315_P000 30748 +#define IDR_AUDIO_SPATIALIZATION_T315_P015 30749 +#define IDR_AUDIO_SPATIALIZATION_T315_P030 30750 +#define IDR_AUDIO_SPATIALIZATION_T315_P045 30751 +#define IDR_AUDIO_SPATIALIZATION_T315_P060 30752 +#define IDR_AUDIO_SPATIALIZATION_T315_P075 30753 +#define IDR_AUDIO_SPATIALIZATION_T315_P090 30754 +#define IDR_AUDIO_SPATIALIZATION_T315_P315 30755 +#define IDR_AUDIO_SPATIALIZATION_T315_P330 30756 +#define IDR_AUDIO_SPATIALIZATION_T315_P345 30757 +#define IDR_AUDIO_SPATIALIZATION_T330_P000 30758 +#define IDR_AUDIO_SPATIALIZATION_T330_P015 30759 +#define IDR_AUDIO_SPATIALIZATION_T330_P030 30760 +#define IDR_AUDIO_SPATIALIZATION_T330_P045 30761 +#define IDR_AUDIO_SPATIALIZATION_T330_P060 30762 +#define IDR_AUDIO_SPATIALIZATION_T330_P075 30763 +#define IDR_AUDIO_SPATIALIZATION_T330_P090 30764 +#define IDR_AUDIO_SPATIALIZATION_T330_P315 30765 +#define IDR_AUDIO_SPATIALIZATION_T330_P330 30766 +#define IDR_AUDIO_SPATIALIZATION_T330_P345 30767 +#define IDR_AUDIO_SPATIALIZATION_T345_P000 30768 +#define IDR_AUDIO_SPATIALIZATION_T345_P015 30769 +#define IDR_AUDIO_SPATIALIZATION_T345_P030 30770 +#define IDR_AUDIO_SPATIALIZATION_T345_P045 30771 +#define IDR_AUDIO_SPATIALIZATION_T345_P060 30772 +#define IDR_AUDIO_SPATIALIZATION_T345_P075 30773 +#define IDR_AUDIO_SPATIALIZATION_T345_P090 30774 +#define IDR_AUDIO_SPATIALIZATION_T345_P315 30775 +#define IDR_AUDIO_SPATIALIZATION_T345_P330 30776 +#define IDR_AUDIO_SPATIALIZATION_T345_P345 30777 + +// --------------------------------------------------------------------------- +// From cef_resources.h: + +#define IDR_CEF_DEVTOOLS_DISCOVERY_PAGE 27500 +#define IDR_CEF_CREDITS_HTML 27501 +#define IDR_CEF_CREDITS_JS 27502 +#define IDR_CEF_LICENSE_TXT 27503 +#define IDR_CEF_VERSION_HTML 27504 +#define IDR_PRINT_PREVIEW_PAGE 27505 + +// --------------------------------------------------------------------------- +// From content_resources.h: + +#define IDR_ACCESSIBILITY_HTML 25000 +#define IDR_ACCESSIBILITY_CSS 25001 +#define IDR_ACCESSIBILITY_JS 25002 +#define IDR_DEVTOOLS_PINCH_CURSOR_ICON 25003 +#define IDR_DEVTOOLS_PINCH_CURSOR_ICON_2X 25004 +#define IDR_DEVTOOLS_TOUCH_CURSOR_ICON 25005 +#define IDR_DEVTOOLS_TOUCH_CURSOR_ICON_2X 25006 +#define IDR_GPU_INTERNALS_HTML 25007 +#define IDR_GPU_INTERNALS_JS 25008 +#define IDR_INDEXED_DB_INTERNALS_HTML 25009 +#define IDR_INDEXED_DB_INTERNALS_JS 25010 +#define IDR_INDEXED_DB_INTERNALS_CSS 25011 +#define IDR_MEDIA_INTERNALS_HTML 25012 +#define IDR_MEDIA_INTERNALS_JS 25013 +#define IDR_SERVICE_WORKER_INTERNALS_HTML 25014 +#define IDR_SERVICE_WORKER_INTERNALS_JS 25015 +#define IDR_SERVICE_WORKER_INTERNALS_CSS 25016 +#define IDR_WEBRTC_INTERNALS_HTML 25017 +#define IDR_WEBRTC_INTERNALS_JS 25018 +#define IDR_GPU_SANDBOX_PROFILE 25019 +#define IDR_COMMON_SANDBOX_PROFILE 25020 +#define IDR_PPAPI_SANDBOX_PROFILE 25021 +#define IDR_RENDERER_SANDBOX_PROFILE 25022 +#define IDR_UTILITY_SANDBOX_PROFILE 25023 +#define IDR_MOJO_BUFFER_JS 25024 +#define IDR_MOJO_CODEC_JS 25025 +#define IDR_MOJO_CONNECTION_JS 25026 +#define IDR_MOJO_CONNECTOR_JS 25027 +#define IDR_MOJO_ROUTER_JS 25028 +#define IDR_MOJO_UNICODE_JS 25029 +#define IDR_MOJO_VALIDATOR_JS 25030 + +// --------------------------------------------------------------------------- +// From devtools_resources.h: + +#define DEVTOOLS_CSS 22000 +#define DEVTOOLS_HTML 22001 +#define DEVTOOLS_JS 22002 +#define TOOLBOX_CSS 22003 +#define TOOLBOX_HTML 22004 +#define TOOLBOX_JS 22005 +#define AUDITS_MODULE_JS 22006 +#define CONSOLE_MODULE_JS 22007 +#define DEVICES_MODULE_JS 22008 +#define DOCUMENTATION_MODULE_JS 22009 +#define ELEMENTS_MODULE_JS 22010 +#define EXTENSIONS_MODULE_JS 22011 +#define HEAP_SNAPSHOT_WORKER_MODULE_JS 22012 +#define LAYERS_MODULE_JS 22013 +#define NETWORK_MODULE_JS 22014 +#define PROFILER_MODULE_JS 22015 +#define PROMISES_MODULE_JS 22016 +#define RESOURCES_MODULE_JS 22017 +#define SCRIPT_FORMATTER_WORKER_MODULE_JS 22018 +#define SETTINGS_MODULE_JS 22019 +#define SOURCE_FRAME_MODULE_JS 22020 +#define SOURCES_MODULE_JS 22021 +#define TEMP_STORAGE_SHARED_WORKER_MODULE_JS 22022 +#define TIMELINE_MODULE_JS 22023 +#define DEVTOOLS_EXTENSION_API_JS 22024 +#define ACCELEROMETER_CSS 22025 +#define AUDITSPANEL_CSS 22026 +#define BREAKPOINTSLIST_CSS 22027 +#define CANVASPROFILER_CSS 22028 +#define CMDEVTOOLS_CSS 22029 +#define DATAGRID_CSS 22030 +#define DEVICESVIEW_CSS 22031 +#define DOCUMENTATIONVIEW_CSS 22032 +#define ELEMENTSPANEL_CSS 22033 +#define FILTER_CSS 22034 +#define FILTEREDITEMSELECTIONDIALOG_CSS 22035 +#define FLAMECHART_CSS 22036 +#define HEAPPROFILER_CSS 22037 +#define HELPSCREEN_CSS 22038 +#define INDEXEDDBVIEWS_CSS 22039 +#define INSPECTORCOMMON_CSS 22040 +#define INSPECTORSYNTAXHIGHLIGHT_CSS 22041 +#define LAYERSPANEL_CSS 22042 +#define NAVIGATORVIEW_CSS 22043 +#define NETWORKLOGVIEW_CSS 22044 +#define NETWORKPANEL_CSS 22045 +#define OVERRIDES_CSS 22046 +#define OVERVIEWGRID_CSS 22047 +#define PANELENABLERVIEW_CSS 22048 +#define PIECHART_CSS 22049 +#define PROFILESPANEL_CSS 22050 +#define PROMISESPANEL_CSS 22051 +#define REQUESTCOOKIESVIEW_CSS 22052 +#define REQUESTHEADERSVIEW_CSS 22053 +#define RESOURCESPANEL_CSS 22054 +#define RESOURCEVIEW_CSS 22055 +#define RESPONSIVEDESIGNVIEW_CSS 22056 +#define REVISIONHISTORY_CSS 22057 +#define SCREENCASTVIEW_CSS 22058 +#define SOURCESPANEL_CSS 22059 +#define SOURCESVIEW_CSS 22060 +#define SPECTRUM_CSS 22061 +#define TIMELINEPANEL_CSS 22062 +#define WEBSOCKETFRAMEVIEW_CSS 22063 +#define CM_CODEMIRROR_CSS 22064 +#define IMAGES_APPLICATIONCACHE_PNG 22065 +#define IMAGES_BACK_PNG 22066 +#define IMAGES_BREAKPOINT_PNG 22067 +#define IMAGES_BREAKPOINTCONDITIONAL_PNG 22068 +#define IMAGES_BREAKPOINTCONDITIONAL_2X_PNG 22069 +#define IMAGES_BREAKPOINT_2X_PNG 22070 +#define IMAGES_CHECKER_PNG 22071 +#define IMAGES_CHROMEDISABLEDSELECT_PNG 22072 +#define IMAGES_CHROMEDISABLEDSELECT_2X_PNG 22073 +#define IMAGES_CHROMESELECT_PNG 22074 +#define IMAGES_CHROMESELECT_2X_PNG 22075 +#define IMAGES_COOKIE_PNG 22076 +#define IMAGES_DATABASE_PNG 22077 +#define IMAGES_DATABASETABLE_PNG 22078 +#define IMAGES_DELETEICON_PNG 22079 +#define IMAGES_DOMAIN_PNG 22080 +#define IMAGES_ERRORWAVE_PNG 22081 +#define IMAGES_ERRORWAVE_2X_PNG 22082 +#define IMAGES_FILESYSTEM_PNG 22083 +#define IMAGES_FORWARD_PNG 22084 +#define IMAGES_FRAME_PNG 22085 +#define IMAGES_GRAPHLABELCALLOUTLEFT_PNG 22086 +#define IMAGES_GRAPHLABELCALLOUTRIGHT_PNG 22087 +#define IMAGES_INDEXEDDB_PNG 22088 +#define IMAGES_INDEXEDDBINDEX_PNG 22089 +#define IMAGES_INDEXEDDBOBJECTSTORE_PNG 22090 +#define IMAGES_LOCALSTORAGE_PNG 22091 +#define IMAGES_NAVIGATIONCONTROLS_PNG 22092 +#define IMAGES_NAVIGATIONCONTROLS_2X_PNG 22093 +#define IMAGES_PANEADDBUTTONS_PNG 22094 +#define IMAGES_PANEELEMENTSTATEBUTTONS_PNG 22095 +#define IMAGES_PANEFILTERBUTTONS_PNG 22096 +#define IMAGES_PANEREFRESHBUTTONS_PNG 22097 +#define IMAGES_POPOVERARROWS_PNG 22098 +#define IMAGES_POPOVERBACKGROUND_PNG 22099 +#define IMAGES_PROFILEGROUPICON_PNG 22100 +#define IMAGES_PROFILEICON_PNG 22101 +#define IMAGES_PROFILESMALLICON_PNG 22102 +#define IMAGES_RADIODOT_PNG 22103 +#define IMAGES_RESOURCECSSICON_PNG 22104 +#define IMAGES_RESOURCEDOCUMENTICON_PNG 22105 +#define IMAGES_RESOURCEDOCUMENTICONSMALL_PNG 22106 +#define IMAGES_RESOURCEJSICON_PNG 22107 +#define IMAGES_RESOURCEPLAINICON_PNG 22108 +#define IMAGES_RESOURCEPLAINICONSMALL_PNG 22109 +#define IMAGES_RESOURCESTIMEGRAPHICON_PNG 22110 +#define IMAGES_RESPONSIVEDESIGN_PNG 22111 +#define IMAGES_RESPONSIVEDESIGN_2X_PNG 22112 +#define IMAGES_SEARCHNEXT_PNG 22113 +#define IMAGES_SEARCHPREV_PNG 22114 +#define IMAGES_SESSIONSTORAGE_PNG 22115 +#define IMAGES_SETTINGSLISTREMOVE_PNG 22116 +#define IMAGES_SETTINGSLISTREMOVE_2X_PNG 22117 +#define IMAGES_STATUSBARBUTTONGLYPHS_PNG 22118 +#define IMAGES_STATUSBARBUTTONGLYPHS_2X_PNG 22119 +#define IMAGES_STATUSBARRESIZERHORIZONTAL_PNG 22120 +#define IMAGES_STATUSBARRESIZERVERTICAL_PNG 22121 +#define IMAGES_THUMBACTIVEHORIZ_PNG 22122 +#define IMAGES_THUMBACTIVEVERT_PNG 22123 +#define IMAGES_THUMBHORIZ_PNG 22124 +#define IMAGES_THUMBHOVERHORIZ_PNG 22125 +#define IMAGES_THUMBHOVERVERT_PNG 22126 +#define IMAGES_THUMBVERT_PNG 22127 +#define IMAGES_TOOLBARITEMSELECTED_PNG 22128 +#define IMAGES_TOUCHCURSOR_PNG 22129 +#define IMAGES_TOUCHCURSOR_2X_PNG 22130 +#define IMAGES_TRANSFORMCONTROLS_PNG 22131 +#define IMAGES_TRANSFORMCONTROLS_2X_PNG 22132 + +// --------------------------------------------------------------------------- +// From net_resources.h: + +#define IDR_DIR_HEADER_HTML 4000 + +// --------------------------------------------------------------------------- +// From ui_resources.h: + +#define IDR_APP_LIST_APPS_ICON 5500 +#define IDR_APP_LIST_EXPERIMENTAL_ICON 5501 +#define IDR_APP_LIST_ITEM_PROGRESS_BACKGROUND 5502 +#define IDR_APP_LIST_ITEM_PROGRESS_LEFT 5503 +#define IDR_APP_LIST_ITEM_PROGRESS_CENTER 5504 +#define IDR_APP_LIST_ITEM_PROGRESS_RIGHT 5505 +#define IDR_APP_LIST_NOTIFICATIONS_ICON 5506 +#define IDR_APP_LIST_TOOLS_HOVER 5507 +#define IDR_APP_LIST_TOOLS_NORMAL 5508 +#define IDR_APP_LIST_TOOLS_PRESSED 5509 +#define IDR_APP_LIST_FOLDER_BACK_NORMAL 5510 +#define IDR_APP_LIST_SEARCH_ICON 5511 +#define IDR_APP_LIST_SPEECH_MIC_ON 5512 +#define IDR_APP_LIST_SPEECH_MIC_OFF 5513 +#define IDR_APP_LIST_SPEECH_MIC_RECORDING 5514 +#define IDR_APP_LIST_USER_INDICATOR 5515 +#define IDR_APP_TOP_CENTER 5516 +#define IDR_APP_TOP_LEFT 5517 +#define IDR_APP_TOP_RIGHT 5518 +#define IDR_AURA_CURSOR_BIG_ALIAS 5519 +#define IDR_AURA_CURSOR_BIG_CELL 5520 +#define IDR_AURA_CURSOR_BIG_COL_RESIZE 5521 +#define IDR_AURA_CURSOR_BIG_CONTEXT_MENU 5522 +#define IDR_AURA_CURSOR_BIG_COPY 5523 +#define IDR_AURA_CURSOR_BIG_CROSSHAIR 5524 +#define IDR_AURA_CURSOR_BIG_EAST_RESIZE 5525 +#define IDR_AURA_CURSOR_BIG_EAST_WEST_RESIZE 5526 +#define IDR_AURA_CURSOR_BIG_HAND 5527 +#define IDR_AURA_CURSOR_BIG_HELP 5528 +#define IDR_AURA_CURSOR_BIG_IBEAM 5529 +#define IDR_AURA_CURSOR_BIG_MOVE 5530 +#define IDR_AURA_CURSOR_BIG_NORTH_EAST_RESIZE 5531 +#define IDR_AURA_CURSOR_BIG_NORTH_EAST_SOUTH_WEST_RESIZE 5532 +#define IDR_AURA_CURSOR_BIG_NORTH_RESIZE 5533 +#define IDR_AURA_CURSOR_BIG_NORTH_SOUTH_RESIZE 5534 +#define IDR_AURA_CURSOR_BIG_NORTH_WEST_RESIZE 5535 +#define IDR_AURA_CURSOR_BIG_NORTH_WEST_SOUTH_EAST_RESIZE 5536 +#define IDR_AURA_CURSOR_BIG_NO_DROP 5537 +#define IDR_AURA_CURSOR_BIG_PTR 5538 +#define IDR_AURA_CURSOR_BIG_ROW_RESIZE 5539 +#define IDR_AURA_CURSOR_BIG_SOUTH_EAST_RESIZE 5540 +#define IDR_AURA_CURSOR_BIG_SOUTH_RESIZE 5541 +#define IDR_AURA_CURSOR_BIG_SOUTH_WEST_RESIZE 5542 +#define IDR_AURA_CURSOR_BIG_WEST_RESIZE 5543 +#define IDR_AURA_CURSOR_BIG_XTERM_HORIZ 5544 +#define IDR_AURA_CURSOR_BIG_ZOOM_IN 5545 +#define IDR_AURA_CURSOR_BIG_ZOOM_OUT 5546 +#define IDR_AURA_CURSOR_BIG_GRAB 5547 +#define IDR_AURA_CURSOR_BIG_GRABBING 5548 +#define IDR_AURA_CURSOR_ALIAS 5549 +#define IDR_AURA_CURSOR_CELL 5550 +#define IDR_AURA_CURSOR_COL_RESIZE 5551 +#define IDR_AURA_CURSOR_CONTEXT_MENU 5552 +#define IDR_AURA_CURSOR_COPY 5553 +#define IDR_AURA_CURSOR_CROSSHAIR 5554 +#define IDR_AURA_CURSOR_EAST_RESIZE 5555 +#define IDR_AURA_CURSOR_EAST_WEST_RESIZE 5556 +#define IDR_AURA_CURSOR_HAND 5557 +#define IDR_AURA_CURSOR_HELP 5558 +#define IDR_AURA_CURSOR_IBEAM 5559 +#define IDR_AURA_CURSOR_MOVE 5560 +#define IDR_AURA_CURSOR_NORTH_EAST_RESIZE 5561 +#define IDR_AURA_CURSOR_NORTH_EAST_SOUTH_WEST_RESIZE 5562 +#define IDR_AURA_CURSOR_NORTH_RESIZE 5563 +#define IDR_AURA_CURSOR_NORTH_SOUTH_RESIZE 5564 +#define IDR_AURA_CURSOR_NORTH_WEST_RESIZE 5565 +#define IDR_AURA_CURSOR_NORTH_WEST_SOUTH_EAST_RESIZE 5566 +#define IDR_AURA_CURSOR_NO_DROP 5567 +#define IDR_AURA_CURSOR_PTR 5568 +#define IDR_AURA_CURSOR_ROW_RESIZE 5569 +#define IDR_AURA_CURSOR_SOUTH_EAST_RESIZE 5570 +#define IDR_AURA_CURSOR_SOUTH_RESIZE 5571 +#define IDR_AURA_CURSOR_SOUTH_WEST_RESIZE 5572 +#define IDR_AURA_CURSOR_WEST_RESIZE 5573 +#define IDR_AURA_CURSOR_XTERM_HORIZ 5574 +#define IDR_AURA_CURSOR_ZOOM_IN 5575 +#define IDR_AURA_CURSOR_ZOOM_OUT 5576 +#define IDR_AURA_CURSOR_GRAB 5577 +#define IDR_AURA_CURSOR_GRABBING 5578 +#define IDR_AURA_SHADOW_ACTIVE 5579 +#define IDR_AURA_SHADOW_INACTIVE 5580 +#define IDR_BACK_ARROW 5581 +#define IDR_FORWARD_ARROW 5582 +#define IDR_BROWSER_ACTION_BADGE_CENTER 5583 +#define IDR_BROWSER_ACTION_BADGE_LEFT 5584 +#define IDR_BROWSER_ACTION_BADGE_RIGHT 5585 +#define IDR_BUBBLE_B 5586 +#define IDR_BUBBLE_BL 5587 +#define IDR_BUBBLE_BR 5588 +#define IDR_BUBBLE_B_ARROW 5589 +#define IDR_BUBBLE_L 5590 +#define IDR_BUBBLE_L_ARROW 5591 +#define IDR_BUBBLE_R 5592 +#define IDR_BUBBLE_R_ARROW 5593 +#define IDR_BUBBLE_T 5594 +#define IDR_BUBBLE_TL 5595 +#define IDR_BUBBLE_TR 5596 +#define IDR_BUBBLE_T_ARROW 5597 +#define IDR_BUTTON_DISABLED 5598 +#define IDR_BUTTON_FOCUSED_HOVER 5599 +#define IDR_BUTTON_FOCUSED_NORMAL 5600 +#define IDR_BUTTON_FOCUSED_PRESSED 5601 +#define IDR_BUTTON_HOVER 5602 +#define IDR_BUTTON_NORMAL 5603 +#define IDR_BUTTON_PRESSED 5604 +#define IDR_BLUE_BUTTON_DISABLED 5605 +#define IDR_BLUE_BUTTON_FOCUSED_HOVER 5606 +#define IDR_BLUE_BUTTON_FOCUSED_NORMAL 5607 +#define IDR_BLUE_BUTTON_FOCUSED_PRESSED 5608 +#define IDR_BLUE_BUTTON_HOVER 5609 +#define IDR_BLUE_BUTTON_NORMAL 5610 +#define IDR_BLUE_BUTTON_PRESSED 5611 +#define IDR_CHECKBOX 5612 +#define IDR_CHECKBOX_CHECKED 5613 +#define IDR_CHECKBOX_CHECKED_DISABLED 5614 +#define IDR_CHECKBOX_CHECKED_HOVER 5615 +#define IDR_CHECKBOX_CHECKED_PRESSED 5616 +#define IDR_CHECKBOX_DISABLED 5617 +#define IDR_CHECKBOX_FOCUSED 5618 +#define IDR_CHECKBOX_FOCUSED_CHECKED 5619 +#define IDR_CHECKBOX_FOCUSED_CHECKED_HOVER 5620 +#define IDR_CHECKBOX_FOCUSED_CHECKED_PRESSED 5621 +#define IDR_CHECKBOX_FOCUSED_HOVER 5622 +#define IDR_CHECKBOX_FOCUSED_PRESSED 5623 +#define IDR_CHECKBOX_HOVER 5624 +#define IDR_CHECKBOX_PRESSED 5625 +#define IDR_CHECKMARK 5626 +#define IDR_CLOSE 5627 +#define IDR_CLOSE_2 5628 +#define IDR_CLOSE_2_H 5629 +#define IDR_CLOSE_2_MASK 5630 +#define IDR_CLOSE_2_P 5631 +#define IDR_CLOSE_3_MASK 5632 +#define IDR_CLOSE_DIALOG 5633 +#define IDR_CLOSE_DIALOG_H 5634 +#define IDR_CLOSE_DIALOG_P 5635 +#define IDR_CLOSE_H 5636 +#define IDR_CLOSE_P 5637 +#define IDR_COMBOBOX_BUTTON_BOTTOM 5638 +#define IDR_COMBOBOX_BUTTON_H_BOTTOM 5639 +#define IDR_COMBOBOX_BUTTON_P_BOTTOM 5640 +#define IDR_COMBOBOX_BUTTON_BOTTOM_LEFT 5641 +#define IDR_COMBOBOX_BUTTON_H_BOTTOM_LEFT 5642 +#define IDR_COMBOBOX_BUTTON_P_BOTTOM_LEFT 5643 +#define IDR_COMBOBOX_BUTTON_BOTTOM_RIGHT 5644 +#define IDR_COMBOBOX_BUTTON_H_BOTTOM_RIGHT 5645 +#define IDR_COMBOBOX_BUTTON_P_BOTTOM_RIGHT 5646 +#define IDR_COMBOBOX_BUTTON_CENTER 5647 +#define IDR_COMBOBOX_BUTTON_H_CENTER 5648 +#define IDR_COMBOBOX_BUTTON_P_CENTER 5649 +#define IDR_COMBOBOX_BUTTON_LEFT 5650 +#define IDR_COMBOBOX_BUTTON_H_LEFT 5651 +#define IDR_COMBOBOX_BUTTON_P_LEFT 5652 +#define IDR_COMBOBOX_BUTTON_RIGHT 5653 +#define IDR_COMBOBOX_BUTTON_H_RIGHT 5654 +#define IDR_COMBOBOX_BUTTON_P_RIGHT 5655 +#define IDR_COMBOBOX_BUTTON_MENU_BOTTOM 5656 +#define IDR_COMBOBOX_BUTTON_H_MENU_BOTTOM 5657 +#define IDR_COMBOBOX_BUTTON_P_MENU_BOTTOM 5658 +#define IDR_COMBOBOX_BUTTON_MENU_CENTER 5659 +#define IDR_COMBOBOX_BUTTON_H_MENU_CENTER 5660 +#define IDR_COMBOBOX_BUTTON_P_MENU_CENTER 5661 +#define IDR_COMBOBOX_BUTTON_MENU_TOP 5662 +#define IDR_COMBOBOX_BUTTON_H_MENU_TOP 5663 +#define IDR_COMBOBOX_BUTTON_P_MENU_TOP 5664 +#define IDR_COMBOBOX_BUTTON_TOP 5665 +#define IDR_COMBOBOX_BUTTON_H_TOP 5666 +#define IDR_COMBOBOX_BUTTON_P_TOP 5667 +#define IDR_COMBOBOX_BUTTON_TOP_LEFT 5668 +#define IDR_COMBOBOX_BUTTON_H_TOP_LEFT 5669 +#define IDR_COMBOBOX_BUTTON_P_TOP_LEFT 5670 +#define IDR_COMBOBOX_BUTTON_TOP_RIGHT 5671 +#define IDR_COMBOBOX_BUTTON_H_TOP_RIGHT 5672 +#define IDR_COMBOBOX_BUTTON_P_TOP_RIGHT 5673 +#define IDR_COMBOBOX_BUTTON_F_BOTTOM 5674 +#define IDR_COMBOBOX_BUTTON_F_H_BOTTOM 5675 +#define IDR_COMBOBOX_BUTTON_F_P_BOTTOM 5676 +#define IDR_COMBOBOX_BUTTON_F_BOTTOM_LEFT 5677 +#define IDR_COMBOBOX_BUTTON_F_H_BOTTOM_LEFT 5678 +#define IDR_COMBOBOX_BUTTON_F_P_BOTTOM_LEFT 5679 +#define IDR_COMBOBOX_BUTTON_F_BOTTOM_RIGHT 5680 +#define IDR_COMBOBOX_BUTTON_F_H_BOTTOM_RIGHT 5681 +#define IDR_COMBOBOX_BUTTON_F_P_BOTTOM_RIGHT 5682 +#define IDR_COMBOBOX_BUTTON_F_CENTER 5683 +#define IDR_COMBOBOX_BUTTON_F_H_CENTER 5684 +#define IDR_COMBOBOX_BUTTON_F_P_CENTER 5685 +#define IDR_COMBOBOX_BUTTON_F_LEFT 5686 +#define IDR_COMBOBOX_BUTTON_F_H_LEFT 5687 +#define IDR_COMBOBOX_BUTTON_F_P_LEFT 5688 +#define IDR_COMBOBOX_BUTTON_F_RIGHT 5689 +#define IDR_COMBOBOX_BUTTON_F_H_RIGHT 5690 +#define IDR_COMBOBOX_BUTTON_F_P_RIGHT 5691 +#define IDR_COMBOBOX_BUTTON_F_MENU_BOTTOM 5692 +#define IDR_COMBOBOX_BUTTON_F_H_MENU_BOTTOM 5693 +#define IDR_COMBOBOX_BUTTON_F_P_MENU_BOTTOM 5694 +#define IDR_COMBOBOX_BUTTON_F_MENU_CENTER 5695 +#define IDR_COMBOBOX_BUTTON_F_H_MENU_CENTER 5696 +#define IDR_COMBOBOX_BUTTON_F_P_MENU_CENTER 5697 +#define IDR_COMBOBOX_BUTTON_F_MENU_TOP 5698 +#define IDR_COMBOBOX_BUTTON_F_H_MENU_TOP 5699 +#define IDR_COMBOBOX_BUTTON_F_P_MENU_TOP 5700 +#define IDR_COMBOBOX_BUTTON_F_TOP 5701 +#define IDR_COMBOBOX_BUTTON_F_H_TOP 5702 +#define IDR_COMBOBOX_BUTTON_F_P_TOP 5703 +#define IDR_COMBOBOX_BUTTON_F_TOP_LEFT 5704 +#define IDR_COMBOBOX_BUTTON_F_H_TOP_LEFT 5705 +#define IDR_COMBOBOX_BUTTON_F_P_TOP_LEFT 5706 +#define IDR_COMBOBOX_BUTTON_F_TOP_RIGHT 5707 +#define IDR_COMBOBOX_BUTTON_F_H_TOP_RIGHT 5708 +#define IDR_COMBOBOX_BUTTON_F_P_TOP_RIGHT 5709 +#define IDR_CONTENT_BOTTOM_CENTER 5710 +#define IDR_CONTENT_BOTTOM_LEFT_CORNER 5711 +#define IDR_CONTENT_BOTTOM_RIGHT_CORNER 5712 +#define IDR_CONTENT_LEFT_SIDE 5713 +#define IDR_CONTENT_RIGHT_SIDE 5714 +#define IDR_DEFAULT_FAVICON 5715 +#define IDR_DEFAULT_FAVICON_32 5716 +#define IDR_DEFAULT_FAVICON_64 5717 +#define IDR_EASY_UNLOCK_HARDLOCKED 5718 +#define IDR_EASY_UNLOCK_HARDLOCKED_HOVER 5719 +#define IDR_EASY_UNLOCK_HARDLOCKED_PRESSED 5720 +#define IDR_EASY_UNLOCK_LOCKED 5721 +#define IDR_EASY_UNLOCK_LOCKED_HOVER 5722 +#define IDR_EASY_UNLOCK_LOCKED_PRESSED 5723 +#define IDR_EASY_UNLOCK_SPINNER 5724 +#define IDR_EASY_UNLOCK_UNLOCKED 5725 +#define IDR_EASY_UNLOCK_UNLOCKED_HOVER 5726 +#define IDR_EASY_UNLOCK_UNLOCKED_PRESSED 5727 +#define IDR_FOLDER_CLOSED 5728 +#define IDR_FOLDER_CLOSED_RTL 5729 +#define IDR_FOLDER_OPEN 5730 +#define IDR_FOLDER_OPEN_RTL 5731 +#define IDR_FRAME 5732 +#define IDR_FRAME_APP_PANEL 5733 +#define IDR_FRAME_INACTIVE 5734 +#define IDR_MAXIMIZE 5735 +#define IDR_MAXIMIZE_H 5736 +#define IDR_MAXIMIZE_P 5737 +#define IDR_MENU_HIERARCHY_ARROW 5738 +#define IDR_MENU_HIERARCHY_ARROW_DARK_BACKGROUND 5739 +#define IDR_MENU_CHECK 5740 +#define IDR_MENU_CHECK_CHECKED 5741 +#define IDR_MENU_CHECK_CHECKED_DARK_BACKGROUND 5742 +#define IDR_MENU_RADIO_EMPTY 5743 +#define IDR_MENU_RADIO_SELECTED 5744 +#define IDR_SLIDER_ACTIVE_LEFT 5745 +#define IDR_SLIDER_ACTIVE_RIGHT 5746 +#define IDR_SLIDER_ACTIVE_CENTER 5747 +#define IDR_SLIDER_DISABLED_LEFT 5748 +#define IDR_SLIDER_DISABLED_RIGHT 5749 +#define IDR_SLIDER_DISABLED_CENTER 5750 +#define IDR_SLIDER_PRESSED_LEFT 5751 +#define IDR_SLIDER_PRESSED_RIGHT 5752 +#define IDR_SLIDER_PRESSED_CENTER 5753 +#define IDR_SLIDER_ACTIVE_THUMB 5754 +#define IDR_SLIDER_DISABLED_THUMB 5755 +#define IDR_MENU_DROPARROW 5756 +#define IDR_MESSAGE_CLOSE 5757 +#define IDR_MINIMIZE 5758 +#define IDR_MINIMIZE_H 5759 +#define IDR_MINIMIZE_P 5760 +#define IDR_NOTIFICATION_ARROW 5761 +#define IDR_NOTIFICATION_ARROW_HOVER 5762 +#define IDR_NOTIFICATION_ARROW_PRESSED 5763 +#define IDR_NOTIFICATION_ADVANCED_SETTINGS 5764 +#define IDR_NOTIFICATION_ADVANCED_SETTINGS_HOVER 5765 +#define IDR_NOTIFICATION_ADVANCED_SETTINGS_PRESSED 5766 +#define IDR_NOTIFICATION_CLEAR_ALL 5767 +#define IDR_NOTIFICATION_CLEAR_ALL_DISABLED 5768 +#define IDR_NOTIFICATION_CLEAR_ALL_HOVER 5769 +#define IDR_NOTIFICATION_CLEAR_ALL_PRESSED 5770 +#define IDR_NOTIFICATION_CLOSE 5771 +#define IDR_NOTIFICATION_CLOSE_HOVER 5772 +#define IDR_NOTIFICATION_CLOSE_PRESSED 5773 +#define IDR_NOTIFICATION_BUBBLE_CLOSE 5774 +#define IDR_NOTIFICATION_BUBBLE_CLOSE_HOVER 5775 +#define IDR_NOTIFICATION_BUBBLE_CLOSE_PRESSED 5776 +#define IDR_NOTIFICATION_DO_NOT_DISTURB 5777 +#define IDR_NOTIFICATION_DO_NOT_DISTURB_HOVER 5778 +#define IDR_NOTIFICATION_DO_NOT_DISTURB_PRESSED 5779 +#define IDR_NOTIFICATION_SETTINGS 5780 +#define IDR_NOTIFICATION_SETTINGS_HOVER 5781 +#define IDR_NOTIFICATION_SETTINGS_PRESSED 5782 +#define IDR_LOCAL_NTP_IMAGES_LOGO_PNG 5783 +#define IDR_LOCAL_NTP_IMAGES_WHITE_LOGO_PNG 5784 +#define IDR_NTP_DEFAULT_FAVICON 5785 +#define IDR_OOBE_ACTION_BOX_BUTTON_HOVER 5786 +#define IDR_OOBE_ACTION_BOX_BUTTON_NORMAL 5787 +#define IDR_OOBE_ACTION_BOX_BUTTON_PRESSED 5788 +#define IDR_PANEL_TOP_LEFT_CORNER 5789 +#define IDR_PANEL_TOP_RIGHT_CORNER 5790 +#define IDR_PANEL_BOTTOM_LEFT_CORNER 5791 +#define IDR_PANEL_BOTTOM_RIGHT_CORNER 5792 +#define IDR_PROGRESS_BAR 5793 +#define IDR_PROGRESS_BORDER_LEFT 5794 +#define IDR_PROGRESS_BORDER_RIGHT 5795 +#define IDR_PROGRESS_VALUE 5796 +#define IDR_RADIO 5797 +#define IDR_RADIO_CHECKED 5798 +#define IDR_RADIO_CHECKED_DISABLED 5799 +#define IDR_RADIO_CHECKED_HOVER 5800 +#define IDR_RADIO_CHECKED_PRESSED 5801 +#define IDR_RADIO_DISABLED 5802 +#define IDR_RADIO_FOCUSED 5803 +#define IDR_RADIO_FOCUSED_CHECKED 5804 +#define IDR_RADIO_FOCUSED_CHECKED_HOVER 5805 +#define IDR_RADIO_FOCUSED_CHECKED_PRESSED 5806 +#define IDR_RADIO_FOCUSED_HOVER 5807 +#define IDR_RADIO_FOCUSED_PRESSED 5808 +#define IDR_RADIO_HOVER 5809 +#define IDR_RADIO_PRESSED 5810 +#define IDR_RESTORE 5811 +#define IDR_RESTORE_H 5812 +#define IDR_RESTORE_P 5813 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_BOTTOM 5814 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_BOTTOM_LEFT 5815 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_BOTTOM_RIGHT 5816 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_CENTER 5817 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_LEFT 5818 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_RIGHT 5819 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_TOP 5820 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_TOP_LEFT 5821 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_HOVER_TOP_RIGHT 5822 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_BOTTOM 5823 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_BOTTOM_LEFT 5824 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_BOTTOM_RIGHT 5825 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_CENTER 5826 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_LEFT 5827 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_RIGHT 5828 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_TOP 5829 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_TOP_LEFT 5830 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_NORMAL_TOP_RIGHT 5831 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_BOTTOM 5832 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_BOTTOM_LEFT 5833 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_BOTTOM_RIGHT 5834 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_CENTER 5835 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_LEFT 5836 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_RIGHT 5837 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_TOP 5838 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_TOP_LEFT 5839 +#define IDR_SCROLLBAR_ARROW_BUTTON_BASE_PRESSED_TOP_RIGHT 5840 +#define IDR_SCROLLBAR_BASE_BOTTOM 5841 +#define IDR_SCROLLBAR_BASE_BOTTOM_LEFT 5842 +#define IDR_SCROLLBAR_BASE_BOTTOM_RIGHT 5843 +#define IDR_SCROLLBAR_BASE_CENTER 5844 +#define IDR_SCROLLBAR_BASE_LEFT 5845 +#define IDR_SCROLLBAR_BASE_RIGHT 5846 +#define IDR_SCROLLBAR_BASE_TOP 5847 +#define IDR_SCROLLBAR_BASE_TOP_LEFT 5848 +#define IDR_SCROLLBAR_BASE_TOP_RIGHT 5849 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_BOTTOM 5850 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_BOTTOM_LEFT 5851 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_BOTTOM_RIGHT 5852 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_CENTER 5853 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_LEFT 5854 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_RIGHT 5855 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_TOP 5856 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_TOP_LEFT 5857 +#define IDR_SCROLLBAR_OVERLAY_THUMB_FILL_TOP_RIGHT 5858 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_BOTTOM 5859 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_BOTTOM_LEFT 5860 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_BOTTOM_RIGHT 5861 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_LEFT 5862 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_RIGHT 5863 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_TOP 5864 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_TOP_LEFT 5865 +#define IDR_SCROLLBAR_OVERLAY_THUMB_STROKE_TOP_RIGHT 5866 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_BOTTOM 5867 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_BOTTOM_LEFT 5868 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_BOTTOM_RIGHT 5869 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_CENTER 5870 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_LEFT 5871 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_RIGHT 5872 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_TOP 5873 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_TOP_LEFT 5874 +#define IDR_SCROLLBAR_THUMB_BASE_HOVER_TOP_RIGHT 5875 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_BOTTOM 5876 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_BOTTOM_LEFT 5877 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_BOTTOM_RIGHT 5878 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_CENTER 5879 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_LEFT 5880 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_RIGHT 5881 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_TOP 5882 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_TOP_LEFT 5883 +#define IDR_SCROLLBAR_THUMB_BASE_NORMAL_TOP_RIGHT 5884 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_BOTTOM 5885 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_BOTTOM_LEFT 5886 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_BOTTOM_RIGHT 5887 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_CENTER 5888 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_LEFT 5889 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_RIGHT 5890 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_TOP 5891 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_TOP_LEFT 5892 +#define IDR_SCROLLBAR_THUMB_BASE_PRESSED_TOP_RIGHT 5893 +#define IDR_TEXTBUTTON_HOVER_BOTTOM 5894 +#define IDR_TEXTBUTTON_HOVER_BOTTOM_LEFT 5895 +#define IDR_TEXTBUTTON_HOVER_BOTTOM_RIGHT 5896 +#define IDR_TEXTBUTTON_HOVER_CENTER 5897 +#define IDR_TEXTBUTTON_HOVER_LEFT 5898 +#define IDR_TEXTBUTTON_HOVER_RIGHT 5899 +#define IDR_TEXTBUTTON_HOVER_TOP 5900 +#define IDR_TEXTBUTTON_HOVER_TOP_LEFT 5901 +#define IDR_TEXTBUTTON_HOVER_TOP_RIGHT 5902 +#define IDR_TEXTBUTTON_PRESSED_BOTTOM 5903 +#define IDR_TEXTBUTTON_PRESSED_BOTTOM_LEFT 5904 +#define IDR_TEXTBUTTON_PRESSED_BOTTOM_RIGHT 5905 +#define IDR_TEXTBUTTON_PRESSED_CENTER 5906 +#define IDR_TEXTBUTTON_PRESSED_LEFT 5907 +#define IDR_TEXTBUTTON_PRESSED_RIGHT 5908 +#define IDR_TEXTBUTTON_PRESSED_TOP 5909 +#define IDR_TEXTBUTTON_PRESSED_TOP_LEFT 5910 +#define IDR_TEXTBUTTON_PRESSED_TOP_RIGHT 5911 +#define IDR_TEXT_SELECTION_HANDLE 5912 +#define IDR_THROBBER 5913 +#define IDR_TOUCH_DRAG_TIP_COPY 5914 +#define IDR_TOUCH_DRAG_TIP_MOVE 5915 +#define IDR_TOUCH_DRAG_TIP_LINK 5916 +#define IDR_TOUCH_DRAG_TIP_NODROP 5917 +#define IDR_DARK_TRAY_ATTENTION 5918 +#define IDR_DARK_TRAY_PRESSED 5919 +#define IDR_DARK_TRAY_DO_NOT_DISTURB_ATTENTION 5920 +#define IDR_DARK_TRAY_DO_NOT_DISTURB_PRESSED 5921 +#define IDR_DARK_TRAY_DO_NOT_DISTURB_EMPTY 5922 +#define IDR_DARK_TRAY_EMPTY 5923 +#define IDR_TRAY_ATTENTION 5924 +#define IDR_TRAY_ATTENTION_PRESSED 5925 +#define IDR_TRAY_DO_NOT_DISTURB_ATTENTION 5926 +#define IDR_TRAY_DO_NOT_DISTURB_ATTENTION_PRESSED 5927 +#define IDR_TRAY_DO_NOT_DISTURB_EMPTY 5928 +#define IDR_TRAY_DO_NOT_DISTURB_EMPTY_PRESSED 5929 +#define IDR_TRAY_EMPTY 5930 +#define IDR_TRAY_EMPTY_PRESSED 5931 +#define IDR_WINDOW_BOTTOM_CENTER 5932 +#define IDR_WINDOW_BOTTOM_LEFT_CORNER 5933 +#define IDR_WINDOW_BOTTOM_RIGHT_CORNER 5934 +#define IDR_WINDOW_LEFT_SIDE 5935 +#define IDR_WINDOW_RIGHT_SIDE 5936 +#define IDR_WINDOW_TOP_CENTER 5937 +#define IDR_WINDOW_TOP_LEFT_CORNER 5938 +#define IDR_WINDOW_TOP_RIGHT_CORNER 5939 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_BOTTOM 5940 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_BOTTOM_LEFT 5941 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_BOTTOM_RIGHT 5942 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_LEFT 5943 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_RIGHT 5944 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_TOP 5945 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_TOP_LEFT 5946 +#define IDR_WINDOW_BUBBLE_SHADOW_BIG_TOP_RIGHT 5947 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_BOTTOM 5948 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_LEFT 5949 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_RIGHT 5950 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_BIG_TOP 5951 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL 5952 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_BOTTOM 5953 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_BOTTOM_LEFT 5954 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_BOTTOM_RIGHT 5955 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_LEFT 5956 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_RIGHT 5957 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_TOP 5958 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_TOP_LEFT 5959 +#define IDR_WINDOW_BUBBLE_SHADOW_SMALL_TOP_RIGHT 5960 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_BOTTOM 5961 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_LEFT 5962 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_RIGHT 5963 +#define IDR_WINDOW_BUBBLE_SHADOW_SPIKE_SMALL_TOP 5964 + +#endif // CEF_INCLUDE_CEF_PACK_RESOURCES_H_ diff --git a/vendor/cef3/include/cef_pack_strings.h b/vendor/cef3/include/cef_pack_strings.h new file mode 100644 index 00000000000..2cb1e4d6b4f --- /dev/null +++ b/vendor/cef3/include/cef_pack_strings.h @@ -0,0 +1,629 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file is generated by the make_pack_header.py tool. +// + +#ifndef CEF_INCLUDE_CEF_PACK_STRINGS_H_ +#define CEF_INCLUDE_CEF_PACK_STRINGS_H_ +#pragma once + +// --------------------------------------------------------------------------- +// From cef_strings.h: + +#define IDS_MENU_BACK 28000 +#define IDS_MENU_FORWARD 28001 +#define IDS_MENU_RELOAD 28002 +#define IDS_MENU_RELOAD_NOCACHE 28003 +#define IDS_MENU_STOPLOAD 28004 +#define IDS_MENU_UNDO 28005 +#define IDS_MENU_REDO 28006 +#define IDS_MENU_CUT 28007 +#define IDS_MENU_COPY 28008 +#define IDS_MENU_PASTE 28009 +#define IDS_MENU_DELETE 28010 +#define IDS_MENU_SELECT_ALL 28011 +#define IDS_MENU_FIND 28012 +#define IDS_MENU_PRINT 28013 +#define IDS_MENU_VIEW_SOURCE 28014 +#define IDS_APP_AUDIO_FILES 28015 +#define IDS_APP_IMAGE_FILES 28016 +#define IDS_APP_TEXT_FILES 28017 +#define IDS_APP_VIDEO_FILES 28018 +#define IDS_DEFAULT_PRINT_DOCUMENT_TITLE 28019 +#define IDS_PRINT_SPOOL_FAILED_TITLE_TEXT 28020 +#define IDS_PRINT_SPOOL_FAILED_ERROR_TEXT 28021 +#define IDS_PRINT_INVALID_PRINTER_SETTINGS 28022 +#define IDS_SPELLCHECK_DICTIONARY 28023 +#define IDS_CONTENT_CONTEXT_ADD_TO_DICTIONARY 28024 +#define IDS_CONTENT_CONTEXT_NO_SPELLING_SUGGESTIONS 28025 + +// --------------------------------------------------------------------------- +// From components_strings.h: + +#define IDS_AUTOFILL_CLEAR_FORM_MENU_ITEM 30000 +#define IDS_AUTOFILL_WARNING_FORM_DISABLED 30001 +#define IDS_AUTOFILL_WARNING_INSECURE_CONNECTION 30002 +#define IDS_AUTOFILL_CC_AMEX 30003 +#define IDS_AUTOFILL_CC_DINERS 30004 +#define IDS_AUTOFILL_CC_DISCOVER 30005 +#define IDS_AUTOFILL_CC_JCB 30006 +#define IDS_AUTOFILL_CC_MASTERCARD 30007 +#define IDS_AUTOFILL_CC_UNION_PAY 30008 +#define IDS_AUTOFILL_CC_VISA 30009 +#define IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR 30010 +#define IDS_AUTOFILL_ADDRESS_SUMMARY_SEPARATOR 30011 +#define IDS_CREDIT_CARD_NUMBER_PREVIEW_FORMAT 30012 +#define IDS_AUTOFILL_FIELD_LABEL_STATE 30013 +#define IDS_AUTOFILL_FIELD_LABEL_AREA 30014 +#define IDS_AUTOFILL_FIELD_LABEL_COUNTY 30015 +#define IDS_AUTOFILL_FIELD_LABEL_DEPARTMENT 30016 +#define IDS_AUTOFILL_FIELD_LABEL_DISTRICT 30017 +#define IDS_AUTOFILL_FIELD_LABEL_EMIRATE 30018 +#define IDS_AUTOFILL_FIELD_LABEL_ISLAND 30019 +#define IDS_AUTOFILL_FIELD_LABEL_PARISH 30020 +#define IDS_AUTOFILL_FIELD_LABEL_PREFECTURE 30021 +#define IDS_AUTOFILL_FIELD_LABEL_PROVINCE 30022 +#define IDS_AUTOFILL_FIELD_LABEL_ZIP_CODE 30023 +#define IDS_AUTOFILL_FIELD_LABEL_POSTAL_CODE 30024 +#define IDS_AUTOFILL_FIELD_LABEL_COUNTRY 30025 +#define IDS_AUTOFILL_SHOW_PREDICTIONS_TITLE 30026 +#define IDS_AUTOFILL_DIALOG_PRIVACY_POLICY_LINK 30027 +#define IDS_AUTOFILL_OPTIONS_POPUP 30028 +#define IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET 30029 +#define IDS_AUTOFILL_CREDIT_CARD_NOT_SUPPORTED_BY_WALLET_FOR_MERCHANT 30030 +#define IDS_BOOKMARK_BAR_FOLDER_NAME 30032 +#define IDS_BOOKMARK_BAR_MOBILE_FOLDER_NAME 30033 +#define IDS_BOOKMARK_BAR_OTHER_FOLDER_NAME 30034 +#define IDS_BOOKMARK_BAR_MANAGED_FOLDER_DOMAIN_NAME 30035 +#define IDS_BOOKMARK_BAR_MANAGED_FOLDER_DEFAULT_NAME 30036 +#define IDS_DOM_DISTILLER_WEBUI_TITLE 30037 +#define IDS_DOM_DISTILLER_WEBUI_ENTRY_URL 30038 +#define IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD 30039 +#define IDS_DOM_DISTILLER_WEBUI_ENTRY_ADD_FAILED 30040 +#define IDS_DOM_DISTILLER_WEBUI_VIEW_URL 30041 +#define IDS_DOM_DISTILLER_WEBUI_VIEW_URL_FAILED 30042 +#define IDS_DOM_DISTILLER_WEBUI_REFRESH 30043 +#define IDS_DOM_DISTILLER_WEBUI_FETCHING_ENTRIES 30044 +#define IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_TITLE 30045 +#define IDS_DOM_DISTILLER_VIEWER_FAILED_TO_FIND_ARTICLE_CONTENT 30046 +#define IDS_DOM_DISTILLER_VIEWER_NO_DATA_TITLE 30047 +#define IDS_DOM_DISTILLER_VIEWER_NO_DATA_CONTENT 30048 +#define IDS_DOM_DISTILLER_VIEWER_VIEW_ORIGINAL 30049 +#define IDS_DOM_DISTILLER_VIEWER_LOADING_STRING 30050 +#define IDS_GOOGLE_URL_TRACKER_INFOBAR_MESSAGE 30051 +#define IDS_GOOGLE_URL_TRACKER_INFOBAR_SWITCH 30052 +#define IDS_GOOGLE_URL_TRACKER_INFOBAR_DONT_SWITCH 30053 +#define IDS_GOOGLE_URL_TRACKER_INFOBAR_LEARN_MORE 30054 +#define IDS_AUTOCOMPLETE_SEARCH_DESCRIPTION 30055 +#define IDS_KEYWORD_SEARCH 30056 +#define IDS_EXTENSION_KEYWORD_COMMAND 30057 +#define IDS_EMPTY_KEYWORD_VALUE 30058 +#define IDS_PDF_NEED_PASSWORD 30059 +#define IDS_PDF_PAGE_LOADING 30060 +#define IDS_PDF_PAGE_LOAD_FAILED 30061 +#define IDS_PDF_PROGRESS_LOADING 30062 +#define IDS_POLICY_DM_STATUS_SUCCESS 30063 +#define IDS_POLICY_DM_STATUS_REQUEST_INVALID 30064 +#define IDS_POLICY_DM_STATUS_REQUEST_FAILED 30065 +#define IDS_POLICY_DM_STATUS_TEMPORARY_UNAVAILABLE 30066 +#define IDS_POLICY_DM_STATUS_HTTP_STATUS_ERROR 30067 +#define IDS_POLICY_DM_STATUS_RESPONSE_DECODING_ERROR 30068 +#define IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED 30069 +#define IDS_POLICY_DM_STATUS_SERVICE_DEVICE_NOT_FOUND 30070 +#define IDS_POLICY_DM_STATUS_SERVICE_MANAGEMENT_TOKEN_INVALID 30071 +#define IDS_POLICY_DM_STATUS_SERVICE_ACTIVATION_PENDING 30072 +#define IDS_POLICY_DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER 30073 +#define IDS_POLICY_DM_STATUS_SERVICE_DEVICE_ID_CONFLICT 30074 +#define IDS_POLICY_DM_STATUS_SERVICE_MISSING_LICENSES 30075 +#define IDS_POLICY_DM_STATUS_SERVICE_DEPROVISIONED 30076 +#define IDS_POLICY_DM_STATUS_SERVICE_POLICY_NOT_FOUND 30077 +#define IDS_POLICY_DM_STATUS_UNKNOWN_ERROR 30078 +#define IDS_POLICY_DM_STATUS_SERVICE_DOMAIN_MISMATCH 30079 +#define IDS_POLICY_VALIDATION_OK 30080 +#define IDS_POLICY_VALIDATION_BAD_INITIAL_SIGNATURE 30081 +#define IDS_POLICY_VALIDATION_BAD_SIGNATURE 30082 +#define IDS_POLICY_VALIDATION_ERROR_CODE_PRESENT 30083 +#define IDS_POLICY_VALIDATION_PAYLOAD_PARSE_ERROR 30084 +#define IDS_POLICY_VALIDATION_WRONG_POLICY_TYPE 30085 +#define IDS_POLICY_VALIDATION_WRONG_SETTINGS_ENTITY_ID 30086 +#define IDS_POLICY_VALIDATION_BAD_TIMESTAMP 30087 +#define IDS_POLICY_VALIDATION_WRONG_TOKEN 30088 +#define IDS_POLICY_VALIDATION_BAD_USERNAME 30089 +#define IDS_POLICY_VALIDATION_POLICY_PARSE_ERROR 30090 +#define IDS_POLICY_VALIDATION_BAD_KEY_VERIFICATION_SIGNATURE 30091 +#define IDS_POLICY_VALIDATION_UNKNOWN_ERROR 30092 +#define IDS_POLICY_STORE_STATUS_OK 30093 +#define IDS_POLICY_STORE_STATUS_LOAD_ERROR 30094 +#define IDS_POLICY_STORE_STATUS_STORE_ERROR 30095 +#define IDS_POLICY_STORE_STATUS_PARSE_ERROR 30096 +#define IDS_POLICY_STORE_STATUS_SERIALIZE_ERROR 30097 +#define IDS_POLICY_STORE_STATUS_VALIDATION_ERROR 30098 +#define IDS_POLICY_STORE_STATUS_BAD_STATE 30099 +#define IDS_POLICY_STORE_STATUS_UNKNOWN_ERROR 30100 +#define IDS_POLICY_ASSOCIATION_STATE_ACTIVE 30101 +#define IDS_POLICY_ASSOCIATION_STATE_UNMANAGED 30102 +#define IDS_POLICY_ASSOCIATION_STATE_DEPROVISIONED 30103 +#define IDS_POLICY_TYPE_ERROR 30104 +#define IDS_POLICY_OUT_OF_RANGE_ERROR 30105 +#define IDS_POLICY_VALUE_FORMAT_ERROR 30106 +#define IDS_POLICY_DEFAULT_SEARCH_DISABLED 30107 +#define IDS_POLICY_NOT_SPECIFIED_ERROR 30108 +#define IDS_POLICY_SUBKEY_ERROR 30109 +#define IDS_POLICY_LIST_ENTRY_ERROR 30110 +#define IDS_POLICY_SCHEMA_VALIDATION_ERROR 30111 +#define IDS_POLICY_INVALID_SEARCH_URL_ERROR 30112 +#define IDS_POLICY_INVALID_PROXY_MODE_ERROR 30113 +#define IDS_POLICY_PROXY_MODE_DISABLED_ERROR 30114 +#define IDS_POLICY_PROXY_MODE_AUTO_DETECT_ERROR 30115 +#define IDS_POLICY_PROXY_MODE_PAC_URL_ERROR 30116 +#define IDS_POLICY_PROXY_MODE_FIXED_SERVERS_ERROR 30117 +#define IDS_POLICY_PROXY_MODE_SYSTEM_ERROR 30118 +#define IDS_POLICY_PROXY_BOTH_SPECIFIED_ERROR 30119 +#define IDS_POLICY_PROXY_NEITHER_SPECIFIED_ERROR 30120 +#define IDS_POLICY_OVERRIDDEN 30121 +#define IDS_POLICY_DEPRECATED 30122 +#define IDS_POLICY_VALUE_DEPRECATED 30123 +#define IDS_POLICY_LEVEL_ERROR 30128 +#define IDS_POLICY_OK 30129 +#define IDS_POLICY_UNSET 30130 +#define IDS_POLICY_UNKNOWN 30131 +#define IDS_POLICY_TITLE 30132 +#define IDS_POLICY_FILTER_PLACEHOLDER 30133 +#define IDS_POLICY_RELOAD_POLICIES 30134 +#define IDS_POLICY_STATUS 30135 +#define IDS_POLICY_STATUS_DEVICE 30136 +#define IDS_POLICY_STATUS_USER 30137 +#define IDS_POLICY_LABEL_DOMAIN 30138 +#define IDS_POLICY_LABEL_USERNAME 30139 +#define IDS_POLICY_LABEL_CLIENT_ID 30140 +#define IDS_POLICY_LABEL_TIME_SINCE_LAST_REFRESH 30141 +#define IDS_POLICY_NEVER_FETCHED 30142 +#define IDS_POLICY_LABEL_REFRESH_INTERVAL 30143 +#define IDS_POLICY_LABEL_STATUS 30144 +#define IDS_POLICY_SHOW_UNSET 30145 +#define IDS_POLICY_NO_POLICIES_SET 30146 +#define IDS_POLICY_HEADER_SCOPE 30147 +#define IDS_POLICY_HEADER_LEVEL 30148 +#define IDS_POLICY_HEADER_NAME 30149 +#define IDS_POLICY_HEADER_VALUE 30150 +#define IDS_POLICY_HEADER_STATUS 30151 +#define IDS_POLICY_SHOW_EXPANDED_VALUE 30152 +#define IDS_POLICY_HIDE_EXPANDED_VALUE 30153 +#define IDS_POLICY_SCOPE_USER 30154 +#define IDS_POLICY_SCOPE_DEVICE 30155 +#define IDS_POLICY_LEVEL_RECOMMENDED 30156 +#define IDS_POLICY_LEVEL_MANDATORY 30157 +#define IDS_POLICY_INVALID_BOOKMARK 30158 +#define IDS_TRANSLATE_INFOBAR_OPTIONS 30159 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_LANG 30160 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_NEVER_TRANSLATE_SITE 30161 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_ALWAYS 30162 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_REPORT_ERROR 30163 +#define IDS_TRANSLATE_INFOBAR_OPTIONS_ABOUT 30164 +#define IDS_TRANSLATE_INFOBAR_BEFORE_MESSAGE 30165 +#define IDS_TRANSLATE_INFOBAR_ACCEPT 30167 +#define IDS_TRANSLATE_INFOBAR_DENY 30168 +#define IDS_TRANSLATE_INFOBAR_NEVER_TRANSLATE 30169 +#define IDS_TRANSLATE_INFOBAR_ALWAYS_TRANSLATE 30170 +#define IDS_TRANSLATE_INFOBAR_TRANSLATING_TO 30171 +#define IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE 30172 +#define IDS_TRANSLATE_INFOBAR_AFTER_MESSAGE_AUTODETERMINED_SOURCE_LANGUAGE 30173 +#define IDS_TRANSLATE_INFOBAR_REVERT 30175 +#define IDS_TRANSLATE_INFOBAR_RETRY 30176 +#define IDS_TRANSLATE_INFOBAR_ERROR_CANT_CONNECT 30177 +#define IDS_TRANSLATE_INFOBAR_ERROR_CANT_TRANSLATE 30178 +#define IDS_TRANSLATE_INFOBAR_UNKNOWN_PAGE_LANGUAGE 30179 +#define IDS_TRANSLATE_INFOBAR_ERROR_SAME_LANGUAGE 30180 +#define IDS_TRANSLATE_INFOBAR_UNSUPPORTED_PAGE_LANGUAGE 30181 +#define IDS_LEARN_MORE 30183 + +// --------------------------------------------------------------------------- +// From content_strings.h: + +#define IDS_DETAILS_WITHOUT_SUMMARY_LABEL 18500 +#define IDS_SEARCHABLE_INDEX_INTRO 18501 +#define IDS_FORM_CALENDAR_CLEAR 18502 +#define IDS_FORM_CALENDAR_TODAY 18503 +#define IDS_FORM_DATE_FORMAT_DAY_IN_MONTH 18504 +#define IDS_FORM_DATE_FORMAT_MONTH 18505 +#define IDS_FORM_DATE_FORMAT_YEAR 18506 +#define IDS_FORM_SUBMIT_LABEL 18507 +#define IDS_FORM_INPUT_ALT 18508 +#define IDS_FORM_RESET_LABEL 18509 +#define IDS_FORM_FILE_BUTTON_LABEL 18510 +#define IDS_FORM_MULTIPLE_FILES_BUTTON_LABEL 18511 +#define IDS_FORM_FILE_NO_FILE_LABEL 18512 +#define IDS_FORM_FILE_MULTIPLE_UPLOAD 18513 +#define IDS_FORM_OTHER_COLOR_LABEL 18514 +#define IDS_FORM_OTHER_DATE_LABEL 18515 +#define IDS_FORM_OTHER_MONTH_LABEL 18516 +#define IDS_FORM_OTHER_TIME_LABEL 18517 +#define IDS_FORM_OTHER_WEEK_LABEL 18518 +#define IDS_FORM_PLACEHOLDER_FOR_DAY_OF_MONTH_FIELD 18519 +#define IDS_FORM_PLACEHOLDER_FOR_MONTH_FIELD 18520 +#define IDS_FORM_PLACEHOLDER_FOR_YEAR_FIELD 18521 +#define IDS_FORM_SELECT_MENU_LIST_TEXT 18522 +#define IDS_FORM_THIS_MONTH_LABEL 18523 +#define IDS_FORM_THIS_WEEK_LABEL 18524 +#define IDS_FORM_WEEK_NUMBER_LABEL 18525 +#define IDS_RECENT_SEARCHES_NONE 18526 +#define IDS_RECENT_SEARCHES 18527 +#define IDS_RECENT_SEARCHES_CLEAR 18528 +#define IDS_AX_CALENDAR_SHOW_MONTH_SELECTOR 18529 +#define IDS_AX_CALENDAR_SHOW_NEXT_MONTH 18530 +#define IDS_AX_CALENDAR_SHOW_PREVIOUS_MONTH 18531 +#define IDS_AX_CALENDAR_WEEK_DESCRIPTION 18532 +#define IDS_AX_ROLE_WEB_AREA 18533 +#define IDS_AX_ROLE_LINK 18534 +#define IDS_AX_ROLE_LIST_MARKER 18535 +#define IDS_AX_ROLE_IMAGE_MAP 18536 +#define IDS_AX_ROLE_HEADING 18537 +#define IDS_AX_BUTTON_ACTION_VERB 18541 +#define IDS_AX_RADIO_BUTTON_ACTION_VERB 18542 +#define IDS_AX_TEXT_FIELD_ACTION_VERB 18543 +#define IDS_AX_CHECKED_CHECK_BOX_ACTION_VERB 18544 +#define IDS_AX_UNCHECKED_CHECK_BOX_ACTION_VERB 18545 +#define IDS_AX_LINK_ACTION_VERB 18546 +#define IDS_AX_AM_PM_FIELD_TEXT 18547 +#define IDS_AX_DAY_OF_MONTH_FIELD_TEXT 18548 +#define IDS_AX_DATE_TIME_FIELD_EMPTY_VALUE_TEXT 18549 +#define IDS_AX_HOUR_FIELD_TEXT 18550 +#define IDS_AX_MEDIA_DEFAULT 18551 +#define IDS_AX_MEDIA_AUDIO_ELEMENT 18552 +#define IDS_AX_MEDIA_VIDEO_ELEMENT 18553 +#define IDS_AX_MEDIA_MUTE_BUTTON 18554 +#define IDS_AX_MEDIA_UNMUTE_BUTTON 18555 +#define IDS_AX_MEDIA_PLAY_BUTTON 18556 +#define IDS_AX_MEDIA_PAUSE_BUTTON 18557 +#define IDS_AX_MEDIA_SLIDER 18558 +#define IDS_AX_MEDIA_SLIDER_THUMB 18559 +#define IDS_AX_MEDIA_CURRENT_TIME_DISPLAY 18560 +#define IDS_AX_MEDIA_TIME_REMAINING_DISPLAY 18561 +#define IDS_AX_MEDIA_STATUS_DISPLAY 18562 +#define IDS_AX_MEDIA_ENTER_FULL_SCREEN_BUTTON 18563 +#define IDS_AX_MEDIA_EXIT_FULL_SCREEN_BUTTON 18564 +#define IDS_AX_MEDIA_SHOW_CLOSED_CAPTIONS_BUTTON 18565 +#define IDS_AX_MEDIA_HIDE_CLOSED_CAPTIONS_BUTTON 18566 +#define IDS_AX_MEDIA_CAST_OFF_BUTTON 18567 +#define IDS_AX_MEDIA_CAST_ON_BUTTON 18568 +#define IDS_AX_MEDIA_AUDIO_ELEMENT_HELP 18569 +#define IDS_AX_MEDIA_VIDEO_ELEMENT_HELP 18570 +#define IDS_AX_MEDIA_MUTE_BUTTON_HELP 18571 +#define IDS_AX_MEDIA_UNMUTE_BUTTON_HELP 18572 +#define IDS_AX_MEDIA_PLAY_BUTTON_HELP 18573 +#define IDS_AX_MEDIA_PAUSE_BUTTON_HELP 18574 +#define IDS_AX_MEDIA_SLIDER_HELP 18575 +#define IDS_AX_MEDIA_SLIDER_THUMB_HELP 18576 +#define IDS_AX_MEDIA_CURRENT_TIME_DISPLAY_HELP 18577 +#define IDS_AX_MEDIA_TIME_REMAINING_DISPLAY_HELP 18578 +#define IDS_AX_MEDIA_STATUS_DISPLAY_HELP 18579 +#define IDS_AX_MEDIA_ENTER_FULL_SCREEN_BUTTON_HELP 18580 +#define IDS_AX_MEDIA_EXIT_FULL_SCREEN_BUTTON_HELP 18581 +#define IDS_AX_MEDIA_SHOW_CLOSED_CAPTIONS_BUTTON_HELP 18582 +#define IDS_AX_MEDIA_HIDE_CLOSED_CAPTIONS_BUTTON_HELP 18583 +#define IDS_AX_MEDIA_CAST_OFF_BUTTON_HELP 18584 +#define IDS_AX_MEDIA_CAST_ON_BUTTON_HELP 18585 +#define IDS_AX_MILLISECOND_FIELD_TEXT 18586 +#define IDS_AX_MINUTE_FIELD_TEXT 18587 +#define IDS_AX_MONTH_FIELD_TEXT 18588 +#define IDS_AX_SECOND_FIELD_TEXT 18589 +#define IDS_AX_WEEK_OF_YEAR_FIELD_TEXT 18590 +#define IDS_AX_YEAR_FIELD_TEXT 18591 +#define IDS_KEYGEN_HIGH_GRADE_KEY 18592 +#define IDS_KEYGEN_MED_GRADE_KEY 18593 +#define IDS_FORM_INPUT_WEEK_TEMPLATE 18594 +#define IDS_FORM_VALIDATION_VALUE_MISSING_MULTIPLE_FILE 18595 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH 18596 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY 18597 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_DOMAIN 18598 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_EMPTY_LOCAL 18599 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOMAIN 18600 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_DOTS 18601 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_INVALID_LOCAL 18602 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL_NO_AT_SIGN 18603 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_MULTIPLE_EMAIL 18604 +#define IDS_FORM_VALIDATION_RANGE_UNDERFLOW 18605 +#define IDS_FORM_VALIDATION_RANGE_UNDERFLOW_DATETIME 18606 +#define IDS_FORM_VALIDATION_RANGE_OVERFLOW 18607 +#define IDS_FORM_VALIDATION_RANGE_OVERFLOW_DATETIME 18608 +#define IDS_FORM_VALIDATION_BAD_INPUT_DATETIME 18609 +#define IDS_FORM_VALIDATION_BAD_INPUT_NUMBER 18610 +#define IDS_FORM_VALIDATION_VALUE_MISSING 18611 +#define IDS_FORM_VALIDATION_VALUE_MISSING_CHECKBOX 18612 +#define IDS_FORM_VALIDATION_VALUE_MISSING_FILE 18613 +#define IDS_FORM_VALIDATION_VALUE_MISSING_RADIO 18614 +#define IDS_FORM_VALIDATION_VALUE_MISSING_SELECT 18615 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_EMAIL 18616 +#define IDS_FORM_VALIDATION_TYPE_MISMATCH_URL 18617 +#define IDS_FORM_VALIDATION_PATTERN_MISMATCH 18618 +#define IDS_FORM_VALIDATION_STEP_MISMATCH 18619 +#define IDS_FORM_VALIDATION_STEP_MISMATCH_CLOSE_TO_LIMIT 18620 +#define IDS_FORM_VALIDATION_TOO_LONG 18621 +#define IDS_PLUGIN_INITIALIZATION_ERROR 18622 + +// --------------------------------------------------------------------------- +// From ui_strings.h: + +#define IDS_TIME_SECS_DEFAULT 11000 +#define IDS_TIME_SECS_SINGULAR 11001 +#define IDS_TIME_SECS_ZERO 11002 +#define IDS_TIME_SECS_TWO 11003 +#define IDS_TIME_SECS_FEW 11004 +#define IDS_TIME_SECS_MANY 11005 +#define IDS_TIME_LONG_SECS_DEFAULT 11006 +#define IDS_TIME_LONG_SECS_SINGULAR 11007 +#define IDS_TIME_LONG_SECS_ZERO 11008 +#define IDS_TIME_LONG_SECS_TWO 11009 +#define IDS_TIME_LONG_SECS_FEW 11010 +#define IDS_TIME_LONG_SECS_MANY 11011 +#define IDS_TIME_LONG_SECS_2ND_DEFAULT 11012 +#define IDS_TIME_LONG_SECS_2ND_SINGULAR 11013 +#define IDS_TIME_LONG_SECS_2ND_ZERO 11015 +#define IDS_TIME_LONG_SECS_2ND_TWO 11016 +#define IDS_TIME_LONG_SECS_2ND_FEW 11017 +#define IDS_TIME_LONG_SECS_2ND_MANY 11018 +#define IDS_TIME_MINS_DEFAULT 11019 +#define IDS_TIME_MINS_SINGULAR 11020 +#define IDS_TIME_MINS_ZERO 11021 +#define IDS_TIME_MINS_TWO 11022 +#define IDS_TIME_MINS_FEW 11023 +#define IDS_TIME_MINS_MANY 11024 +#define IDS_TIME_LONG_MINS_DEFAULT 11025 +#define IDS_TIME_LONG_MINS_SINGULAR 11026 +#define IDS_TIME_LONG_MINS_ZERO 11027 +#define IDS_TIME_LONG_MINS_TWO 11028 +#define IDS_TIME_LONG_MINS_FEW 11029 +#define IDS_TIME_LONG_MINS_MANY 11030 +#define IDS_TIME_LONG_MINS_1ST_DEFAULT 11031 +#define IDS_TIME_LONG_MINS_1ST_SINGULAR 11032 +#define IDS_TIME_LONG_MINS_1ST_ZERO 11033 +#define IDS_TIME_LONG_MINS_1ST_TWO 11034 +#define IDS_TIME_LONG_MINS_1ST_FEW 11035 +#define IDS_TIME_LONG_MINS_1ST_MANY 11036 +#define IDS_TIME_LONG_MINS_2ND_DEFAULT 11037 +#define IDS_TIME_LONG_MINS_2ND_SINGULAR 11038 +#define IDS_TIME_LONG_MINS_2ND_ZERO 11039 +#define IDS_TIME_LONG_MINS_2ND_TWO 11040 +#define IDS_TIME_LONG_MINS_2ND_FEW 11041 +#define IDS_TIME_LONG_MINS_2ND_MANY 11042 +#define IDS_TIME_HOURS_DEFAULT 11043 +#define IDS_TIME_HOURS_SINGULAR 11044 +#define IDS_TIME_HOURS_ZERO 11045 +#define IDS_TIME_HOURS_TWO 11046 +#define IDS_TIME_HOURS_FEW 11047 +#define IDS_TIME_HOURS_MANY 11048 +#define IDS_TIME_HOURS_1ST_DEFAULT 11049 +#define IDS_TIME_HOURS_1ST_SINGULAR 11050 +#define IDS_TIME_HOURS_1ST_ZERO 11051 +#define IDS_TIME_HOURS_1ST_TWO 11052 +#define IDS_TIME_HOURS_1ST_FEW 11053 +#define IDS_TIME_HOURS_1ST_MANY 11054 +#define IDS_TIME_HOURS_2ND_DEFAULT 11055 +#define IDS_TIME_HOURS_2ND_SINGULAR 11056 +#define IDS_TIME_HOURS_2ND_ZERO 11057 +#define IDS_TIME_HOURS_2ND_TWO 11058 +#define IDS_TIME_HOURS_2ND_FEW 11059 +#define IDS_TIME_HOURS_2ND_MANY 11060 +#define IDS_TIME_DAYS_DEFAULT 11061 +#define IDS_TIME_DAYS_SINGULAR 11062 +#define IDS_TIME_DAYS_ZERO 11063 +#define IDS_TIME_DAYS_TWO 11064 +#define IDS_TIME_DAYS_FEW 11065 +#define IDS_TIME_DAYS_MANY 11066 +#define IDS_TIME_DAYS_1ST_DEFAULT 11067 +#define IDS_TIME_DAYS_1ST_SINGULAR 11068 +#define IDS_TIME_DAYS_1ST_ZERO 11069 +#define IDS_TIME_DAYS_1ST_TWO 11070 +#define IDS_TIME_DAYS_1ST_FEW 11071 +#define IDS_TIME_DAYS_1ST_MANY 11072 +#define IDS_TIME_REMAINING_SECS_DEFAULT 11073 +#define IDS_TIME_REMAINING_SECS_SINGULAR 11074 +#define IDS_TIME_REMAINING_SECS_ZERO 11075 +#define IDS_TIME_REMAINING_SECS_TWO 11076 +#define IDS_TIME_REMAINING_SECS_FEW 11077 +#define IDS_TIME_REMAINING_SECS_MANY 11078 +#define IDS_TIME_REMAINING_LONG_SECS_DEFAULT 11079 +#define IDS_TIME_REMAINING_LONG_SECS_SINGULAR 11080 +#define IDS_TIME_REMAINING_LONG_SECS_ZERO 11081 +#define IDS_TIME_REMAINING_LONG_SECS_TWO 11082 +#define IDS_TIME_REMAINING_LONG_SECS_FEW 11083 +#define IDS_TIME_REMAINING_LONG_SECS_MANY 11084 +#define IDS_TIME_REMAINING_MINS_DEFAULT 11085 +#define IDS_TIME_REMAINING_MINS_SINGULAR 11086 +#define IDS_TIME_REMAINING_MINS_ZERO 11087 +#define IDS_TIME_REMAINING_MINS_TWO 11088 +#define IDS_TIME_REMAINING_MINS_FEW 11089 +#define IDS_TIME_REMAINING_MINS_MANY 11090 +#define IDS_TIME_REMAINING_LONG_MINS_DEFAULT 11091 +#define IDS_TIME_REMAINING_LONG_MINS_SINGULAR 11092 +#define IDS_TIME_REMAINING_LONG_MINS_ZERO 11093 +#define IDS_TIME_REMAINING_LONG_MINS_TWO 11094 +#define IDS_TIME_REMAINING_LONG_MINS_FEW 11095 +#define IDS_TIME_REMAINING_LONG_MINS_MANY 11096 +#define IDS_TIME_REMAINING_HOURS_DEFAULT 11097 +#define IDS_TIME_REMAINING_HOURS_SINGULAR 11098 +#define IDS_TIME_REMAINING_HOURS_ZERO 11099 +#define IDS_TIME_REMAINING_HOURS_TWO 11100 +#define IDS_TIME_REMAINING_HOURS_FEW 11101 +#define IDS_TIME_REMAINING_HOURS_MANY 11102 +#define IDS_TIME_REMAINING_DAYS_DEFAULT 11103 +#define IDS_TIME_REMAINING_DAYS_SINGULAR 11104 +#define IDS_TIME_REMAINING_DAYS_ZERO 11105 +#define IDS_TIME_REMAINING_DAYS_TWO 11106 +#define IDS_TIME_REMAINING_DAYS_FEW 11107 +#define IDS_TIME_REMAINING_DAYS_MANY 11108 +#define IDS_TIME_ELAPSED_SECS_DEFAULT 11109 +#define IDS_TIME_ELAPSED_SECS_SINGULAR 11110 +#define IDS_TIME_ELAPSED_SECS_ZERO 11111 +#define IDS_TIME_ELAPSED_SECS_TWO 11112 +#define IDS_TIME_ELAPSED_SECS_FEW 11113 +#define IDS_TIME_ELAPSED_SECS_MANY 11114 +#define IDS_TIME_ELAPSED_MINS_DEFAULT 11115 +#define IDS_TIME_ELAPSED_MINS_SINGULAR 11116 +#define IDS_TIME_ELAPSED_MINS_ZERO 11117 +#define IDS_TIME_ELAPSED_MINS_TWO 11118 +#define IDS_TIME_ELAPSED_MINS_FEW 11119 +#define IDS_TIME_ELAPSED_MINS_MANY 11120 +#define IDS_TIME_ELAPSED_HOURS_DEFAULT 11121 +#define IDS_TIME_ELAPSED_HOURS_SINGULAR 11122 +#define IDS_TIME_ELAPSED_HOURS_ZERO 11123 +#define IDS_TIME_ELAPSED_HOURS_TWO 11124 +#define IDS_TIME_ELAPSED_HOURS_FEW 11125 +#define IDS_TIME_ELAPSED_HOURS_MANY 11126 +#define IDS_TIME_ELAPSED_DAYS_DEFAULT 11127 +#define IDS_TIME_ELAPSED_DAYS_SINGULAR 11128 +#define IDS_TIME_ELAPSED_DAYS_ZERO 11129 +#define IDS_TIME_ELAPSED_DAYS_TWO 11130 +#define IDS_TIME_ELAPSED_DAYS_FEW 11131 +#define IDS_TIME_ELAPSED_DAYS_MANY 11132 +#define IDS_PAST_TIME_TODAY 11133 +#define IDS_PAST_TIME_YESTERDAY 11134 +#define IDS_APP_MENU_EMPTY_SUBMENU 11135 +#define IDS_APP_UNTITLED_SHORTCUT_FILE_NAME 11136 +#define IDS_APP_SAVEAS_ALL_FILES 11137 +#define IDS_APP_SAVEAS_EXTENSION_FORMAT 11138 +#define IDS_SELECT_UPLOAD_FOLDER_DIALOG_TITLE 11139 +#define IDS_SELECT_FOLDER_DIALOG_TITLE 11142 +#define IDS_SAVE_AS_DIALOG_TITLE 11143 +#define IDS_OPEN_FILE_DIALOG_TITLE 11144 +#define IDS_OPEN_FILES_DIALOG_TITLE 11145 +#define IDS_SAVEAS_ALL_FILES 11146 +#define IDS_SELECT_UPLOAD_FOLDER_DIALOG_UPLOAD_BUTTON 11147 +#define IDS_APP_ACCACTION_PRESS 11148 +#define IDS_APP_ACCNAME_CLOSE 11149 +#define IDS_APP_ACCNAME_MINIMIZE 11150 +#define IDS_APP_ACCNAME_MAXIMIZE 11151 +#define IDS_APP_ACCNAME_RESTORE 11152 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLHERE 11153 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLLEFTEDGE 11154 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLRIGHTEDGE 11155 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLHOME 11156 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLEND 11157 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEUP 11158 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLPAGEDOWN 11159 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLLEFT 11160 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLRIGHT 11161 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLUP 11162 +#define IDS_APP_SCROLLBAR_CXMENU_SCROLLDOWN 11163 +#define IDS_APP_UNDO 11164 +#define IDS_APP_CUT 11165 +#define IDS_APP_COPY 11166 +#define IDS_APP_PASTE 11167 +#define IDS_APP_DELETE 11168 +#define IDS_APP_SELECT_ALL 11169 +#define IDS_DELETE_BACKWARD 11170 +#define IDS_DELETE_FORWARD 11171 +#define IDS_DELETE_TO_BEGINNING_OF_LINE 11172 +#define IDS_DELETE_TO_END_OF_LINE 11173 +#define IDS_DELETE_WORD_BACKWARD 11174 +#define IDS_DELETE_WORD_FORWARD 11175 +#define IDS_MOVE_DOWN 11176 +#define IDS_MOVE_LEFT 11177 +#define IDS_MOVE_LEFT_AND_MODIFY_SELECTION 11178 +#define IDS_MOVE_RIGHT 11179 +#define IDS_MOVE_RIGHT_AND_MODIFY_SELECTION 11180 +#define IDS_MOVE_WORD_LEFT 11181 +#define IDS_MOVE_WORD_LEFT_AND_MODIFY_SELECTION 11182 +#define IDS_MOVE_WORD_RIGHT 11183 +#define IDS_MOVE_WORD_RIGHT_AND_MODIFY_SELECTION 11184 +#define IDS_MOVE_TO_BEGINNING_OF_LINE 11185 +#define IDS_MOVE_TO_BEGINNING_OF_LINE_AND_MODIFY_SELECTION 11186 +#define IDS_MOVE_TO_END_OF_LINE 11187 +#define IDS_MOVE_TO_END_OF_LINE_AND_MODIFY_SELECTION 11188 +#define IDS_MOVE_UP 11189 +#define IDS_APP_REDO 11190 +#define IDS_APP_OK 11191 +#define IDS_APP_CANCEL 11192 +#define IDS_APP_CLOSE 11193 +#define IDS_APP_ESC_KEY 11194 +#define IDS_APP_TAB_KEY 11195 +#define IDS_APP_INSERT_KEY 11196 +#define IDS_APP_HOME_KEY 11197 +#define IDS_APP_DELETE_KEY 11198 +#define IDS_APP_END_KEY 11199 +#define IDS_APP_PAGEUP_KEY 11200 +#define IDS_APP_PAGEDOWN_KEY 11201 +#define IDS_APP_LEFT_ARROW_KEY 11202 +#define IDS_APP_RIGHT_ARROW_KEY 11203 +#define IDS_APP_UP_ARROW_KEY 11204 +#define IDS_APP_DOWN_ARROW_KEY 11205 +#define IDS_APP_ENTER_KEY 11206 +#define IDS_APP_F1_KEY 11207 +#define IDS_APP_F11_KEY 11208 +#define IDS_APP_BACKSPACE_KEY 11209 +#define IDS_APP_COMMA_KEY 11210 +#define IDS_APP_PERIOD_KEY 11211 +#define IDS_APP_MEDIA_NEXT_TRACK_KEY 11212 +#define IDS_APP_MEDIA_PLAY_PAUSE_KEY 11213 +#define IDS_APP_MEDIA_PREV_TRACK_KEY 11214 +#define IDS_APP_MEDIA_STOP_KEY 11215 +#define IDS_APP_CONTROL_MODIFIER 11216 +#define IDS_APP_ALT_MODIFIER 11217 +#define IDS_APP_SHIFT_MODIFIER 11218 +#define IDS_APP_COMMAND_MODIFIER 11219 +#define IDS_APP_BYTES 11220 +#define IDS_APP_KIBIBYTES 11221 +#define IDS_APP_MEBIBYTES 11222 +#define IDS_APP_GIBIBYTES 11223 +#define IDS_APP_TEBIBYTES 11224 +#define IDS_APP_PEBIBYTES 11225 +#define IDS_APP_BYTES_PER_SECOND 11226 +#define IDS_APP_KIBIBYTES_PER_SECOND 11227 +#define IDS_APP_MEBIBYTES_PER_SECOND 11228 +#define IDS_APP_GIBIBYTES_PER_SECOND 11229 +#define IDS_APP_TEBIBYTES_PER_SECOND 11230 +#define IDS_APP_PEBIBYTES_PER_SECOND 11231 +#define IDS_MESSAGE_CENTER_ACCESSIBLE_NAME 11232 +#define IDS_MESSAGE_CENTER_NOTIFIER_DISABLE 11233 +#define IDS_MESSAGE_CENTER_FOOTER_TITLE 11234 +#define IDS_MESSAGE_CENTER_SETTINGS_BUTTON_LABEL 11235 +#define IDS_MESSAGE_CENTER_SETTINGS_DIALOG_DESCRIPTION 11237 +#define IDS_MESSAGE_CENTER_SETTINGS_DESCRIPTION_MULTIUSER 11238 +#define IDS_MESSAGE_CENTER_SETTINGS 11239 +#define IDS_MESSAGE_CENTER_CLEAR_ALL 11240 +#define IDS_MESSAGE_CENTER_QUIET_MODE_BUTTON_TOOLTIP 11241 +#define IDS_MESSAGE_CENTER_NO_MESSAGES 11242 +#define IDS_MESSAGE_CENTER_QUIET_MODE 11243 +#define IDS_MESSAGE_CENTER_QUIET_MODE_1HOUR 11244 +#define IDS_MESSAGE_CENTER_QUIET_MODE_1DAY 11245 +#define IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_ACCESSIBLE_NAME 11246 +#define IDS_APP_LIST_HELP 11249 +#define IDS_APP_LIST_OPEN_SETTINGS 11250 +#define IDS_APP_LIST_OPEN_FEEDBACK 11251 +#define IDS_APP_LIST_FOLDER_NAME_PLACEHOLDER 11252 +#define IDS_APP_LIST_FOLDER_BUTTON_ACCESSIBILE_NAME 11253 +#define IDS_APP_LIST_FOLDER_OPEN_FOLDER_ACCESSIBILE_NAME 11254 +#define IDS_APP_LIST_FOLDER_CLOSE_FOLDER_ACCESSIBILE_NAME 11255 +#define IDS_APP_LIST_SPEECH_HINT_TEXT 11256 +#define IDS_APP_LIST_SPEECH_NETWORK_ERROR_HINT_TEXT 11257 + +#endif // CEF_INCLUDE_CEF_PACK_STRINGS_H_ diff --git a/vendor/cef3/include/cef_path_util.h b/vendor/cef3/include/cef_path_util.h new file mode 100644 index 00000000000..552f4ba5977 --- /dev/null +++ b/vendor/cef3/include/cef_path_util.h @@ -0,0 +1,52 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PATH_UTIL_H_ +#define CEF_INCLUDE_CEF_PATH_UTIL_H_ +#pragma once + +#include "include/cef_base.h" + +typedef cef_path_key_t PathKey; + +/// +// Retrieve the path associated with the specified |key|. Returns true on +// success. Can be called on any thread in the browser process. +/// +/*--cef()--*/ +bool CefGetPath(PathKey key, CefString& path); + +#endif // CEF_INCLUDE_CEF_PATH_UTIL_H_ diff --git a/vendor/cef3/include/cef_print_handler.h b/vendor/cef3/include/cef_print_handler.h new file mode 100644 index 00000000000..a157cbbd64d --- /dev/null +++ b/vendor/cef3/include/cef_print_handler.h @@ -0,0 +1,120 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PRINT_HANDLER_H_ +#define CEF_INCLUDE_CEF_PRINT_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_print_settings.h" + +/// +// Callback interface for asynchronous continuation of print dialog requests. +/// +/*--cef(source=library)--*/ +class CefPrintDialogCallback : public virtual CefBase { + public: + /// + // Continue printing with the specified |settings|. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(CefRefPtr settings) =0; + + /// + // Cancel the printing. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +/// +// Callback interface for asynchronous continuation of print job requests. +/// +/*--cef(source=library)--*/ +class CefPrintJobCallback : public virtual CefBase { + public: + /// + // Indicate completion of the print job. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue() =0; +}; + + +/// +// Implement this interface to handle printing on Linux. The methods of this +// class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefPrintHandler : public virtual CefBase { + public: + /// + // Synchronize |settings| with client state. If |get_defaults| is true then + // populate |settings| with the default print settings. Do not keep a + // reference to |settings| outside of this callback. + /// + /*--cef()--*/ + virtual void OnPrintSettings(CefRefPtr settings, + bool get_defaults) =0; + + /// + // Show the print dialog. Execute |callback| once the dialog is dismissed. + // Return true if the dialog will be displayed or false to cancel the + // printing immediately. + /// + /*--cef()--*/ + virtual bool OnPrintDialog(bool has_selection, + CefRefPtr callback) =0; + + /// + // Send the print job to the printer. Execute |callback| once the job is + // completed. Return true if the job will proceed or false to cancel the job + // immediately. + /// + /*--cef()--*/ + virtual bool OnPrintJob(const CefString& document_name, + const CefString& pdf_file_path, + CefRefPtr callback) =0; + + /// + // Reset client state related to printing. + /// + /*--cef()--*/ + virtual void OnPrintReset() =0; +}; + +#endif // CEF_INCLUDE_CEF_PRINT_HANDLER_H_ diff --git a/vendor/cef3/include/cef_print_settings.h b/vendor/cef3/include/cef_print_settings.h new file mode 100644 index 00000000000..af3fff4f531 --- /dev/null +++ b/vendor/cef3/include/cef_print_settings.h @@ -0,0 +1,208 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PRINT_SETTINGS_H_ +#define CEF_INCLUDE_CEF_PRINT_SETTINGS_H_ +#pragma once + +#include + +#include "include/cef_base.h" + +/// +// Class representing print settings. +/// +/*--cef(source=library)--*/ +class CefPrintSettings : public virtual CefBase { + public: + typedef cef_color_model_t ColorModel; + typedef cef_duplex_mode_t DuplexMode; + typedef std::vector PageRangeList; + + /// + // Create a new CefPrintSettings object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Set the page orientation. + /// + /*--cef()--*/ + virtual void SetOrientation(bool landscape) =0; + + /// + // Returns true if the orientation is landscape. + /// + /*--cef()--*/ + virtual bool IsLandscape() =0; + + /// + // Set the printer printable area in device units. + // Some platforms already provide flipped area. Set |landscape_needs_flip| + // to false on those platforms to avoid double flipping. + /// + /*--cef()--*/ + virtual void SetPrinterPrintableArea( + const CefSize& physical_size_device_units, + const CefRect& printable_area_device_units, + bool landscape_needs_flip) =0; + + /// + // Set the device name. + /// + /*--cef(optional_param=name)--*/ + virtual void SetDeviceName(const CefString& name) =0; + + /// + // Get the device name. + /// + /*--cef()--*/ + virtual CefString GetDeviceName() =0; + + /// + // Set the DPI (dots per inch). + /// + /*--cef()--*/ + virtual void SetDPI(int dpi) =0; + + /// + // Get the DPI (dots per inch). + /// + /*--cef()--*/ + virtual int GetDPI() =0; + + /// + // Set the page ranges. + /// + /*--cef()--*/ + virtual void SetPageRanges(const PageRangeList& ranges) =0; + + /// + // Returns the number of page ranges that currently exist. + /// + /*--cef()--*/ + virtual size_t GetPageRangesCount() =0; + + /// + // Retrieve the page ranges. + /// + /*--cef(count_func=ranges:GetPageRangesCount)--*/ + virtual void GetPageRanges(PageRangeList& ranges) =0; + + /// + // Set whether only the selection will be printed. + /// + /*--cef()--*/ + virtual void SetSelectionOnly(bool selection_only) =0; + + /// + // Returns true if only the selection will be printed. + /// + /*--cef()--*/ + virtual bool IsSelectionOnly() =0; + + /// + // Set whether pages will be collated. + /// + /*--cef()--*/ + virtual void SetCollate(bool collate) =0; + + /// + // Returns true if pages will be collated. + /// + /*--cef()--*/ + virtual bool WillCollate() =0; + + /// + // Set the color model. + /// + /*--cef()--*/ + virtual void SetColorModel(ColorModel model) =0; + + /// + // Get the color model. + /// + /*--cef(default_retval=COLOR_MODEL_UNKNOWN)--*/ + virtual ColorModel GetColorModel() =0; + + /// + // Set the number of copies. + /// + /*--cef()--*/ + virtual void SetCopies(int copies) =0; + + /// + // Get the number of copies. + /// + /*--cef()--*/ + virtual int GetCopies() =0; + + /// + // Set the duplex mode. + /// + /*--cef()--*/ + virtual void SetDuplexMode(DuplexMode mode) =0; + + /// + // Get the duplex mode. + /// + /*--cef(default_retval=DUPLEX_MODE_UNKNOWN)--*/ + virtual DuplexMode GetDuplexMode() =0; +}; + +#endif // CEF_INCLUDE_CEF_PRINT_SETTINGS_H_ + diff --git a/vendor/cef3/include/cef_process_message.h b/vendor/cef3/include/cef_process_message.h new file mode 100644 index 00000000000..1e27bd68129 --- /dev/null +++ b/vendor/cef3/include/cef_process_message.h @@ -0,0 +1,91 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_MESSAGE_H_ +#define CEF_INCLUDE_CEF_MESSAGE_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_values.h" + +typedef cef_process_id_t CefProcessId; + +/// +// Class representing a message. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefProcessMessage : public virtual CefBase { + public: + /// + // Create a new CefProcessMessage object with the specified name. + /// + /*--cef()--*/ + static CefRefPtr Create(const CefString& name); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // function returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Returns the message name. + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the list of arguments. + /// + /*--cef()--*/ + virtual CefRefPtr GetArgumentList() =0; +}; + +#endif // CEF_INCLUDE_CEF_MESSAGE_H_ diff --git a/vendor/cef3/include/cef_process_util.h b/vendor/cef3/include/cef_process_util.h new file mode 100644 index 00000000000..4fce778e7e8 --- /dev/null +++ b/vendor/cef3/include/cef_process_util.h @@ -0,0 +1,57 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_PROCESS_UTIL_H_ +#define CEF_INCLUDE_CEF_PROCESS_UTIL_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_command_line.h" + +/// +// Launches the process specified via |command_line|. Returns true upon +// success. Must be called on the browser process TID_PROCESS_LAUNCHER thread. +// +// Unix-specific notes: +// - All file descriptors open in the parent process will be closed in the +// child process except for stdin, stdout, and stderr. +// - If the first argument on the command line does not contain a slash, +// PATH will be searched. (See man execvp.) +/// +/*--cef()--*/ +bool CefLaunchProcess(CefRefPtr command_line); + +#endif // CEF_INCLUDE_CEF_PROCESS_UTIL_H_ diff --git a/vendor/cef3/include/cef_render_handler.h b/vendor/cef3/include/cef_render_handler.h new file mode 100644 index 00000000000..812c00a2947 --- /dev/null +++ b/vendor/cef3/include/cef_render_handler.h @@ -0,0 +1,174 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RENDER_HANDLER_H_ +#define CEF_INCLUDE_CEF_RENDER_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_drag_data.h" +#include + +/// +// Implement this interface to handle events when window rendering is disabled. +// The methods of this class will be called on the UI thread. +/// +/*--cef(source=client)--*/ +class CefRenderHandler : public virtual CefBase { + public: + typedef cef_cursor_type_t CursorType; + typedef cef_drag_operations_mask_t DragOperation; + typedef cef_drag_operations_mask_t DragOperationsMask; + typedef cef_paint_element_type_t PaintElementType; + typedef std::vector RectList; + + /// + // Called to retrieve the root window rectangle in screen coordinates. Return + // true if the rectangle was provided. + /// + /*--cef()--*/ + virtual bool GetRootScreenRect(CefRefPtr browser, + CefRect& rect) { return false; } + + /// + // Called to retrieve the view rectangle which is relative to screen + // coordinates. Return true if the rectangle was provided. + /// + /*--cef()--*/ + virtual bool GetViewRect(CefRefPtr browser, CefRect& rect) =0; + + /// + // Called to retrieve the translation from view coordinates to actual screen + // coordinates. Return true if the screen coordinates were provided. + /// + /*--cef()--*/ + virtual bool GetScreenPoint(CefRefPtr browser, + int viewX, + int viewY, + int& screenX, + int& screenY) { return false; } + + /// + // Called to allow the client to fill in the CefScreenInfo object with + // appropriate values. Return true if the |screen_info| structure has been + // modified. + // + // If the screen info rectangle is left empty the rectangle from GetViewRect + // will be used. If the rectangle is still empty or invalid popups may not be + // drawn correctly. + /// + /*--cef()--*/ + virtual bool GetScreenInfo(CefRefPtr browser, + CefScreenInfo& screen_info) { return false; } + + /// + // Called when the browser wants to show or hide the popup widget. The popup + // should be shown if |show| is true and hidden if |show| is false. + /// + /*--cef()--*/ + virtual void OnPopupShow(CefRefPtr browser, + bool show) {} + + /// + // Called when the browser wants to move or resize the popup widget. |rect| + // contains the new location and size. + /// + /*--cef()--*/ + virtual void OnPopupSize(CefRefPtr browser, + const CefRect& rect) {} + + /// + // Called when an element should be painted. |type| indicates whether the + // element is the view or the popup widget. |buffer| contains the pixel data + // for the whole image. |dirtyRects| contains the set of rectangles that need + // to be repainted. |buffer| will be |width|*|height|*4 bytes in size and + // represents a BGRA image with an upper-left origin. + /// + /*--cef()--*/ + virtual void OnPaint(CefRefPtr browser, + PaintElementType type, + const RectList& dirtyRects, + const void* buffer, + int width, int height) =0; + + /// + // Called when the browser's cursor has changed. If |type| is CT_CUSTOM then + // |custom_cursor_info| will be populated with the custom cursor information. + /// + /*--cef()--*/ + virtual void OnCursorChange(CefRefPtr browser, + CefCursorHandle cursor, + CursorType type, + const CefCursorInfo& custom_cursor_info) {} + + /// + // Called when the user starts dragging content in the web view. Contextual + // information about the dragged content is supplied by |drag_data|. + // OS APIs that run a system message loop may be used within the + // StartDragging call. + // + // Return false to abort the drag operation. Don't call any of + // CefBrowserHost::DragSource*Ended* methods after returning false. + // + // Return true to handle the drag operation. Call + // CefBrowserHost::DragSourceEndedAt and DragSourceSystemDragEnded either + // synchronously or asynchronously to inform the web view that the drag + // operation has ended. + /// + /*--cef()--*/ + virtual bool StartDragging(CefRefPtr browser, + CefRefPtr drag_data, + DragOperationsMask allowed_ops, + int x, int y) { return false; } + + /// + // Called when the web view wants to update the mouse cursor during a + // drag & drop operation. |operation| describes the allowed operation + // (none, move, copy, link). + /// + /*--cef()--*/ + virtual void UpdateDragCursor(CefRefPtr browser, + DragOperation operation) {} + + /// + // Called when the scroll offset has changed. + /// + /*--cef()--*/ + virtual void OnScrollOffsetChanged(CefRefPtr browser) {} +}; + +#endif // CEF_INCLUDE_CEF_RENDER_HANDLER_H_ diff --git a/vendor/cef3/include/cef_render_process_handler.h b/vendor/cef3/include/cef_render_process_handler.h new file mode 100644 index 00000000000..98ab391bccd --- /dev/null +++ b/vendor/cef3/include/cef_render_process_handler.h @@ -0,0 +1,168 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_ +#define CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_dom.h" +#include "include/cef_frame.h" +#include "include/cef_load_handler.h" +#include "include/cef_process_message.h" +#include "include/cef_v8.h" +#include "include/cef_values.h" + +/// +// Class used to implement render process callbacks. The methods of this class +// will be called on the render process main thread (TID_RENDERER) unless +// otherwise indicated. +/// +/*--cef(source=client)--*/ +class CefRenderProcessHandler : public virtual CefBase { + public: + typedef cef_navigation_type_t NavigationType; + + /// + // Called after the render process main thread has been created. |extra_info| + // is a read-only value originating from + // CefBrowserProcessHandler::OnRenderProcessThreadCreated(). Do not keep a + // reference to |extra_info| outside of this method. + /// + /*--cef()--*/ + virtual void OnRenderThreadCreated(CefRefPtr extra_info) {} + + /// + // Called after WebKit has been initialized. + /// + /*--cef()--*/ + virtual void OnWebKitInitialized() {} + + /// + // Called after a browser has been created. When browsing cross-origin a new + // browser will be created before the old browser with the same identifier is + // destroyed. + /// + /*--cef()--*/ + virtual void OnBrowserCreated(CefRefPtr browser) {} + + /// + // Called before a browser is destroyed. + /// + /*--cef()--*/ + virtual void OnBrowserDestroyed(CefRefPtr browser) {} + + /// + // Return the handler for browser load status events. + /// + /*--cef()--*/ + virtual CefRefPtr GetLoadHandler() { + return NULL; + } + + /// + // Called before browser navigation. Return true to cancel the navigation or + // false to allow the navigation to proceed. The |request| object cannot be + // modified in this callback. + /// + /*--cef()--*/ + virtual bool OnBeforeNavigation(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + NavigationType navigation_type, + bool is_redirect) { return false; } + + /// + // Called immediately after the V8 context for a frame has been created. To + // retrieve the JavaScript 'window' object use the CefV8Context::GetGlobal() + // method. V8 handles can only be accessed from the thread on which they are + // created. A task runner for posting tasks on the associated thread can be + // retrieved via the CefV8Context::GetTaskRunner() method. + /// + /*--cef()--*/ + virtual void OnContextCreated(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) {} + + /// + // Called immediately before the V8 context for a frame is released. No + // references to the context should be kept after this method is called. + /// + /*--cef()--*/ + virtual void OnContextReleased(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) {} + + /// + // Called for global uncaught exceptions in a frame. Execution of this + // callback is disabled by default. To enable set + // CefSettings.uncaught_exception_stack_size > 0. + /// + /*--cef()--*/ + virtual void OnUncaughtException(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context, + CefRefPtr exception, + CefRefPtr stackTrace) {} + + /// + // Called when a new node in the the browser gets focus. The |node| value may + // be empty if no specific node has gained focus. The node object passed to + // this method represents a snapshot of the DOM at the time this method is + // executed. DOM objects are only valid for the scope of this method. Do not + // keep references to or attempt to access any DOM objects outside the scope + // of this method. + /// + /*--cef(optional_param=frame,optional_param=node)--*/ + virtual void OnFocusedNodeChanged(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr node) {} + + /// + // Called when a new message is received from a different process. Return true + // if the message was handled or false otherwise. Do not keep a reference to + // or attempt to access the message outside of this callback. + /// + /*--cef()--*/ + virtual bool OnProcessMessageReceived(CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) { + return false; + } +}; + +#endif // CEF_INCLUDE_CEF_RENDER_PROCESS_HANDLER_H_ diff --git a/vendor/cef3/include/cef_request.h b/vendor/cef3/include/cef_request.h new file mode 100644 index 00000000000..8dd86791ad5 --- /dev/null +++ b/vendor/cef3/include/cef_request.h @@ -0,0 +1,297 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_H_ +#define CEF_INCLUDE_CEF_REQUEST_H_ +#pragma once + +#include "include/cef_base.h" +#include +#include + +class CefPostData; +class CefPostDataElement; + +/// +// Class used to represent a web request. The methods of this class may be +// called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefRequest : public virtual CefBase { + public: + typedef std::multimap HeaderMap; + typedef cef_resource_type_t ResourceType; + typedef cef_transition_type_t TransitionType; + + /// + // Create a new CefRequest object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Get the fully qualified URL. + /// + /*--cef()--*/ + virtual CefString GetURL() =0; + + /// + // Set the fully qualified URL. + /// + /*--cef()--*/ + virtual void SetURL(const CefString& url) =0; + + /// + // Get the request method type. The value will default to POST if post data + // is provided and GET otherwise. + /// + /*--cef()--*/ + virtual CefString GetMethod() =0; + + /// + // Set the request method type. + /// + /*--cef()--*/ + virtual void SetMethod(const CefString& method) =0; + + /// + // Get the post data. + /// + /*--cef()--*/ + virtual CefRefPtr GetPostData() =0; + + /// + // Set the post data. + /// + /*--cef()--*/ + virtual void SetPostData(CefRefPtr postData) =0; + + /// + // Get the header values. + /// + /*--cef()--*/ + virtual void GetHeaderMap(HeaderMap& headerMap) =0; + + /// + // Set the header values. + /// + /*--cef()--*/ + virtual void SetHeaderMap(const HeaderMap& headerMap) =0; + + /// + // Set all values at one time. + /// + /*--cef(optional_param=postData)--*/ + virtual void Set(const CefString& url, + const CefString& method, + CefRefPtr postData, + const HeaderMap& headerMap) =0; + + /// + // Get the flags used in combination with CefURLRequest. See + // cef_urlrequest_flags_t for supported values. + /// + /*--cef(default_retval=UR_FLAG_NONE)--*/ + virtual int GetFlags() =0; + + /// + // Set the flags used in combination with CefURLRequest. See + // cef_urlrequest_flags_t for supported values. + /// + /*--cef()--*/ + virtual void SetFlags(int flags) =0; + + /// + // Set the URL to the first party for cookies used in combination with + // CefURLRequest. + /// + /*--cef()--*/ + virtual CefString GetFirstPartyForCookies() =0; + + /// + // Get the URL to the first party for cookies used in combination with + // CefURLRequest. + /// + /*--cef()--*/ + virtual void SetFirstPartyForCookies(const CefString& url) =0; + + /// + // Get the resource type for this request. Only available in the browser + // process. + /// + /*--cef(default_retval=RT_SUB_RESOURCE)--*/ + virtual ResourceType GetResourceType() =0; + + /// + // Get the transition type for this request. Only available in the browser + // process and only applies to requests that represent a main frame or + // sub-frame navigation. + /// + /*--cef(default_retval=TT_EXPLICIT)--*/ + virtual TransitionType GetTransitionType() =0; +}; + + +/// +// Class used to represent post data for a web request. The methods of this +// class may be called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefPostData : public virtual CefBase { + public: + typedef std::vector > ElementVector; + + /// + // Create a new CefPostData object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns the number of existing post data elements. + /// + /*--cef()--*/ + virtual size_t GetElementCount() =0; + + /// + // Retrieve the post data elements. + /// + /*--cef(count_func=elements:GetElementCount)--*/ + virtual void GetElements(ElementVector& elements) =0; + + /// + // Remove the specified post data element. Returns true if the removal + // succeeds. + /// + /*--cef()--*/ + virtual bool RemoveElement(CefRefPtr element) =0; + + /// + // Add the specified post data element. Returns true if the add succeeds. + /// + /*--cef()--*/ + virtual bool AddElement(CefRefPtr element) =0; + + /// + // Remove all existing post data elements. + /// + /*--cef()--*/ + virtual void RemoveElements() =0; +}; + + +/// +// Class used to represent a single element in the request post data. The +// methods of this class may be called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefPostDataElement : public virtual CefBase { + public: + /// + // Post data elements may represent either bytes or files. + /// + typedef cef_postdataelement_type_t Type; + + /// + // Create a new CefPostDataElement object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Remove all contents from the post data element. + /// + /*--cef()--*/ + virtual void SetToEmpty() =0; + + /// + // The post data element will represent a file. + /// + /*--cef()--*/ + virtual void SetToFile(const CefString& fileName) =0; + + /// + // The post data element will represent bytes. The bytes passed + // in will be copied. + /// + /*--cef()--*/ + virtual void SetToBytes(size_t size, const void* bytes) =0; + + /// + // Return the type of this post data element. + /// + /*--cef(default_retval=PDE_TYPE_EMPTY)--*/ + virtual Type GetType() =0; + + /// + // Return the file name. + /// + /*--cef()--*/ + virtual CefString GetFile() =0; + + /// + // Return the number of bytes. + /// + /*--cef()--*/ + virtual size_t GetBytesCount() =0; + + /// + // Read up to |size| bytes into |bytes| and return the number of bytes + // actually read. + /// + /*--cef()--*/ + virtual size_t GetBytes(size_t size, void* bytes) =0; +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_H_ diff --git a/vendor/cef3/include/cef_request_context.h b/vendor/cef3/include/cef_request_context.h new file mode 100644 index 00000000000..32495a95239 --- /dev/null +++ b/vendor/cef3/include/cef_request_context.h @@ -0,0 +1,94 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ +#define CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ +#pragma once + +#include "include/cef_request_context_handler.h" + +/// +// A request context provides request handling for a set of related browser +// objects. A request context is specified when creating a new browser object +// via the CefBrowserHost static factory methods. Browser objects with different +// request contexts will never be hosted in the same render process. Browser +// objects with the same request context may or may not be hosted in the same +// render process depending on the process model. Browser objects created +// indirectly via the JavaScript window.open function or targeted links will +// share the same render process and the same request context as the source +// browser. When running in single-process mode there is only a single render +// process (the main process) and so all browsers created in single-process mode +// will share the same request context. This will be the first request context +// passed into a CefBrowserHost static factory method and all other request +// context objects will be ignored. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefRequestContext : public virtual CefBase { + public: + /// + // Returns the global context object. + /// + /*--cef()--*/ + static CefRefPtr GetGlobalContext(); + + /// + // Creates a new context object with the specified handler. + /// + /*--cef(optional_param=handler)--*/ + static CefRefPtr CreateContext( + CefRefPtr handler); + + /// + // Returns true if this object is pointing to the same context as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr other) =0; + + /// + // Returns true if this object is the global context. + /// + /*--cef()--*/ + virtual bool IsGlobal() =0; + + /// + // Returns the handler for this context if any. + /// + /*--cef()--*/ + virtual CefRefPtr GetHandler() =0; +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_H_ diff --git a/vendor/cef3/include/cef_request_context_handler.h b/vendor/cef3/include/cef_request_context_handler.h new file mode 100644 index 00000000000..f77259efe55 --- /dev/null +++ b/vendor/cef3/include/cef_request_context_handler.h @@ -0,0 +1,58 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_ +#define CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_cookie.h" + +/// +// Implement this interface to provide handler implementations. +/// +/*--cef(source=client,no_debugct_check)--*/ +class CefRequestContextHandler : public virtual CefBase { + public: + /// + // Called on the IO thread to retrieve the cookie manager. The global cookie + // manager will be used if this method returns NULL. + /// + /*--cef()--*/ + virtual CefRefPtr GetCookieManager() { return NULL; } +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_CONTEXT_HANDLER_H_ diff --git a/vendor/cef3/include/cef_request_handler.h b/vendor/cef3/include/cef_request_handler.h new file mode 100644 index 00000000000..0f434310b32 --- /dev/null +++ b/vendor/cef3/include/cef_request_handler.h @@ -0,0 +1,245 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ +#define CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ +#pragma once + +#include "include/cef_auth_callback.h" +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_resource_handler.h" +#include "include/cef_response.h" +#include "include/cef_request.h" +#include "include/cef_web_plugin.h" + +/// +// Callback interface used for asynchronous continuation of quota requests. +/// +/*--cef(source=library)--*/ +class CefQuotaCallback : public virtual CefBase { + public: + /// + // Continue the quota request. If |allow| is true the request will be + // allowed. Otherwise, the request will be denied. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(bool allow) =0; + + /// + // Cancel the quota request. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + + +/// +// Callback interface used for asynchronous continuation of url requests when +// invalid SSL certificates are encountered. +/// +/*--cef(source=library)--*/ +class CefAllowCertificateErrorCallback : public virtual CefBase { + public: + /// + // Continue the url request. If |allow| is true the request will be + // continued. Otherwise, the request will be canceled. + /// + /*--cef(capi_name=cont)--*/ + virtual void Continue(bool allow) =0; +}; + + +/// +// Implement this interface to handle events related to browser requests. The +// methods of this class will be called on the thread indicated. +/// +/*--cef(source=client)--*/ +class CefRequestHandler : public virtual CefBase { + public: + typedef cef_termination_status_t TerminationStatus; + + /// + // Called on the UI thread before browser navigation. Return true to cancel + // the navigation or false to allow the navigation to proceed. The |request| + // object cannot be modified in this callback. + // CefLoadHandler::OnLoadingStateChange will be called twice in all cases. + // If the navigation is allowed CefLoadHandler::OnLoadStart and + // CefLoadHandler::OnLoadEnd will be called. If the navigation is canceled + // CefLoadHandler::OnLoadError will be called with an |errorCode| value of + // ERR_ABORTED. + /// + /*--cef()--*/ + virtual bool OnBeforeBrowse(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request, + bool is_redirect) { + return false; + } + + /// + // Called on the IO thread before a resource request is loaded. The |request| + // object may be modified. To cancel the request return true otherwise return + // false. + /// + /*--cef()--*/ + virtual bool OnBeforeResourceLoad(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request) { + return false; + } + + /// + // Called on the IO thread before a resource is loaded. To allow the resource + // to load normally return NULL. To specify a handler for the resource return + // a CefResourceHandler object. The |request| object should not be modified in + // this callback. + /// + /*--cef()--*/ + virtual CefRefPtr GetResourceHandler( + CefRefPtr browser, + CefRefPtr frame, + CefRefPtr request) { + return NULL; + } + + /// + // Called on the IO thread when a resource load is redirected. The |old_url| + // parameter will contain the old URL. The |new_url| parameter will contain + // the new URL and can be changed if desired. + /// + /*--cef()--*/ + virtual void OnResourceRedirect(CefRefPtr browser, + CefRefPtr frame, + const CefString& old_url, + CefString& new_url) {} + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true to continue the + // request and call CefAuthCallback::Continue() when the authentication + // information is available. Return false to cancel the request. + /// + /*--cef(optional_param=realm)--*/ + virtual bool GetAuthCredentials(CefRefPtr browser, + CefRefPtr frame, + bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) { + return false; + } + + /// + // Called on the IO thread when JavaScript requests a specific storage quota + // size via the webkitStorageInfo.requestQuota function. |origin_url| is the + // origin of the page making the request. |new_size| is the requested quota + // size in bytes. Return true and call CefQuotaCallback::Continue() either in + // this method or at a later time to grant or deny the request. Return false + // to cancel the request. + /// + /*--cef()--*/ + virtual bool OnQuotaRequest(CefRefPtr browser, + const CefString& origin_url, + int64 new_size, + CefRefPtr callback) { + return false; + } + + /// + // Called on the UI thread to handle requests for URLs with an unknown + // protocol component. Set |allow_os_execution| to true to attempt execution + // via the registered OS protocol handler, if any. + // SECURITY WARNING: YOU SHOULD USE THIS METHOD TO ENFORCE RESTRICTIONS BASED + // ON SCHEME, HOST OR OTHER URL ANALYSIS BEFORE ALLOWING OS EXECUTION. + /// + /*--cef()--*/ + virtual void OnProtocolExecution(CefRefPtr browser, + const CefString& url, + bool& allow_os_execution) {} + + /// + // Called on the UI thread to handle requests for URLs with an invalid + // SSL certificate. Return true and call CefAllowCertificateErrorCallback:: + // Continue() either in this method or at a later time to continue or cancel + // the request. Return false to cancel the request immediately. If |callback| + // is empty the error cannot be recovered from and the request will be + // canceled automatically. If CefSettings.ignore_certificate_errors is set + // all invalid certificates will be accepted without calling this method. + /// + /*--cef()--*/ + virtual bool OnCertificateError( + cef_errorcode_t cert_error, + const CefString& request_url, + CefRefPtr callback) { + return false; + } + + /// + // Called on the browser process IO thread before a plugin is loaded. Return + // true to block loading of the plugin. + /// + /*--cef(optional_param=url,optional_param=policy_url)--*/ + virtual bool OnBeforePluginLoad(CefRefPtr browser, + const CefString& url, + const CefString& policy_url, + CefRefPtr info) { + return false; + } + + /// + // Called on the browser process UI thread when a plugin has crashed. + // |plugin_path| is the path of the plugin that crashed. + /// + /*--cef()--*/ + virtual void OnPluginCrashed(CefRefPtr browser, + const CefString& plugin_path) {} + + /// + // Called on the browser process UI thread when the render process + // terminates unexpectedly. |status| indicates how the process + // terminated. + /// + /*--cef()--*/ + virtual void OnRenderProcessTerminated(CefRefPtr browser, + TerminationStatus status) {} +}; + +#endif // CEF_INCLUDE_CEF_REQUEST_HANDLER_H_ diff --git a/vendor/cef3/include/cef_resource_bundle_handler.h b/vendor/cef3/include/cef_resource_bundle_handler.h new file mode 100644 index 00000000000..2cd39a5eba1 --- /dev/null +++ b/vendor/cef3/include/cef_resource_bundle_handler.h @@ -0,0 +1,73 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_ +#define CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" + +/// +// Class used to implement a custom resource bundle interface. The methods of +// this class may be called on multiple threads. +/// +/*--cef(source=client)--*/ +class CefResourceBundleHandler : public virtual CefBase { + public: + /// + // Called to retrieve a localized translation for the string specified by + // |message_id|. To provide the translation set |string| to the translation + // string and return true. To use the default translation return false. + // Supported message IDs are listed in cef_pack_strings.h. + /// + /*--cef()--*/ + virtual bool GetLocalizedString(int message_id, + CefString& string) =0; + + /// + // Called to retrieve data for the resource specified by |resource_id|. To + // provide the resource data set |data| and |data_size| to the data pointer + // and size respectively and return true. To use the default resource data + // return false. The resource data will not be copied and must remain resident + // in memory. Supported resource IDs are listed in cef_pack_resources.h. + /// + /*--cef()--*/ + virtual bool GetDataResource(int resource_id, + void*& data, + size_t& data_size) =0; +}; + +#endif // CEF_INCLUDE_CEF_RESOURCE_BUNDLE_HANDLER_H_ diff --git a/vendor/cef3/include/cef_resource_handler.h b/vendor/cef3/include/cef_resource_handler.h new file mode 100644 index 00000000000..57c8b7fc07f --- /dev/null +++ b/vendor/cef3/include/cef_resource_handler.h @@ -0,0 +1,116 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_ +#define CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_callback.h" +#include "include/cef_cookie.h" +#include "include/cef_request.h" +#include "include/cef_response.h" + +/// +// Class used to implement a custom request handler interface. The methods of +// this class will always be called on the IO thread. +/// +/*--cef(source=client)--*/ +class CefResourceHandler : public virtual CefBase { + public: + /// + // Begin processing the request. To handle the request return true and call + // CefCallback::Continue() once the response header information is available + // (CefCallback::Continue() can also be called from inside this method if + // header information is available immediately). To cancel the request return + // false. + /// + /*--cef()--*/ + virtual bool ProcessRequest(CefRefPtr request, + CefRefPtr callback) =0; + + /// + // Retrieve response header information. If the response length is not known + // set |response_length| to -1 and ReadResponse() will be called until it + // returns false. If the response length is known set |response_length| + // to a positive value and ReadResponse() will be called until it returns + // false or the specified number of bytes have been read. Use the |response| + // object to set the mime type, http status code and other optional header + // values. To redirect the request to a new URL set |redirectUrl| to the new + // URL. + /// + /*--cef()--*/ + virtual void GetResponseHeaders(CefRefPtr response, + int64& response_length, + CefString& redirectUrl) =0; + + /// + // Read response data. If data is available immediately copy up to + // |bytes_to_read| bytes into |data_out|, set |bytes_read| to the number of + // bytes copied, and return true. To read the data at a later time set + // |bytes_read| to 0, return true and call CefCallback::Continue() when the + // data is available. To indicate response completion return false. + /// + /*--cef()--*/ + virtual bool ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) =0; + + /// + // Return true if the specified cookie can be sent with the request or false + // otherwise. If false is returned for any cookie then no cookies will be sent + // with the request. + /// + /*--cef()--*/ + virtual bool CanGetCookie(const CefCookie& cookie) { return true; } + + /// + // Return true if the specified cookie returned with the response can be set + // or false otherwise. + /// + /*--cef()--*/ + virtual bool CanSetCookie(const CefCookie& cookie) { return true; } + + /// + // Request processing has been canceled. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +#endif // CEF_INCLUDE_CEF_RESOURCE_HANDLER_H_ diff --git a/vendor/cef3/include/cef_response.h b/vendor/cef3/include/cef_response.h new file mode 100644 index 00000000000..32fbef1b0e2 --- /dev/null +++ b/vendor/cef3/include/cef_response.h @@ -0,0 +1,120 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_RESPONSE_H_ +#define CEF_INCLUDE_CEF_RESPONSE_H_ +#pragma once + +#include "include/cef_base.h" +#include + +/// +// Class used to represent a web response. The methods of this class may be +// called on any thread. +/// +/*--cef(source=library,no_debugct_check)--*/ +class CefResponse : public virtual CefBase { + public: + typedef std::multimap HeaderMap; + + /// + // Create a new CefResponse object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is read-only. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Get the response status code. + /// + /*--cef()--*/ + virtual int GetStatus() =0; + + /// + // Set the response status code. + /// + /*--cef()--*/ + virtual void SetStatus(int status) = 0; + + /// + // Get the response status text. + /// + /*--cef()--*/ + virtual CefString GetStatusText() =0; + + /// + // Set the response status text. + /// + /*--cef()--*/ + virtual void SetStatusText(const CefString& statusText) = 0; + + /// + // Get the response mime type. + /// + /*--cef()--*/ + virtual CefString GetMimeType() = 0; + + /// + // Set the response mime type. + /// + /*--cef()--*/ + virtual void SetMimeType(const CefString& mimeType) = 0; + + /// + // Get the value for the specified response header field. + /// + /*--cef()--*/ + virtual CefString GetHeader(const CefString& name) =0; + + /// + // Get all response header fields. + /// + /*--cef()--*/ + virtual void GetHeaderMap(HeaderMap& headerMap) =0; + + /// + // Set all response header fields. + /// + /*--cef()--*/ + virtual void SetHeaderMap(const HeaderMap& headerMap) =0; +}; + +#endif // CEF_INCLUDE_CEF_RESPONSE_H_ diff --git a/vendor/cef3/include/cef_runnable.h b/vendor/cef3/include/cef_runnable.h new file mode 100644 index 00000000000..32e2df17a9a --- /dev/null +++ b/vendor/cef3/include/cef_runnable.h @@ -0,0 +1,342 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. Portions Copyright (c) +// 2006-2011 Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// The contents of this file are a modified extract of base/task.h + +#ifndef CEF_INCLUDE_CEF_RUNNABLE_H_ +#define CEF_INCLUDE_CEF_RUNNABLE_H_ +#pragma once + +#include "include/base/cef_tuple.h" +#include "include/cef_base.h" +#include "include/cef_task.h" + +// CefRunnableMethodTraits ----------------------------------------------------- +// +// This traits-class is used by CefRunnableMethod to manage the lifetime of the +// callee object. By default, it is assumed that the callee supports AddRef +// and Release methods. A particular class can specialize this template to +// define other lifetime management. For example, if the callee is known to +// live longer than the CefRunnableMethod object, then a CefRunnableMethodTraits +// struct could be defined with empty RetainCallee and ReleaseCallee methods. +// +// The DISABLE_RUNNABLE_METHOD_REFCOUNT macro is provided as a convenient way +// for declaring a CefRunnableMethodTraits that disables refcounting. + +template +struct CefRunnableMethodTraits { + CefRunnableMethodTraits() { + } + + ~CefRunnableMethodTraits() { + } + + void RetainCallee(T* obj) { +#ifndef NDEBUG + // Catch NewCefRunnableMethod being called in an object's constructor. + // This isn't safe since the method can be invoked before the constructor + // completes, causing the object to be deleted. + obj->AddRef(); + obj->Release(); +#endif + obj->AddRef(); + } + + void ReleaseCallee(T* obj) { + obj->Release(); + } +}; + +// Convenience macro for declaring a CefRunnableMethodTraits that disables +// refcounting of a class. This is useful if you know that the callee +// will outlive the CefRunnableMethod object and thus do not need the ref +// counts. +// +// The invocation of DISABLE_RUNNABLE_METHOD_REFCOUNT should be done at the +// global namespace scope. Example: +// +// namespace foo { +// class Bar { +// ... +// }; +// } // namespace foo +// +// DISABLE_RUNNABLE_METHOD_REFCOUNT(foo::Bar); +// +// This is different from DISALLOW_COPY_AND_ASSIGN which is declared inside the +// class. +#define DISABLE_RUNNABLE_METHOD_REFCOUNT(TypeName) \ + template <> \ + struct CefRunnableMethodTraits { \ + void RetainCallee(TypeName* manager) {} \ + void ReleaseCallee(TypeName* manager) {} \ + } + +// CefRunnableMethod and CefRunnableFunction ---------------------------------- +// +// CefRunnable methods are a type of task that call a function on an object +// when they are run. We implement both an object and a set of +// NewCefRunnableMethod and NewCefRunnableFunction functions for convenience. +// These functions are overloaded and will infer the template types, +// simplifying calling code. +// +// The template definitions all use the following names: +// T - the class type of the object you're supplying +// this is not needed for the Static version of the call +// Method/Function - the signature of a pointer to the method or function you +// want to call +// Param - the parameter(s) to the method, possibly packed as a Tuple +// A - the first parameter (if any) to the method +// B - the second parameter (if any) to the method +// +// Put these all together and you get an object that can call a method whose +// signature is: +// R T::MyFunction([A[, B]]) +// +// Usage: +// CefPostTask(TID_UI, NewCefRunnableMethod(object, &Object::method[, a[, b]]) +// CefPostTask(TID_UI, NewCefRunnableFunction(&function[, a[, b]]) + +// CefRunnableMethod and NewCefRunnableMethod implementation ------------------ + +template +class CefRunnableMethod : public CefTask { + public: + CefRunnableMethod(T* obj, Method meth, const Params& params) + : obj_(obj), meth_(meth), params_(params) { + traits_.RetainCallee(obj_); + } + + ~CefRunnableMethod() { + T* obj = obj_; + obj_ = NULL; + if (obj) + traits_.ReleaseCallee(obj); + } + + virtual void Execute() { + if (obj_) + DispatchToMethod(obj_, meth_, params_); + } + + private: + T* obj_; + Method meth_; + Params params_; + CefRunnableMethodTraits traits_; + + IMPLEMENT_REFCOUNTING(CefRunnableMethod); +}; + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method) { + return new CefRunnableMethod(object, method, MakeTuple()); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b) { + return new CefRunnableMethod >(object, method, + MakeTuple(a, b)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c) { + return new CefRunnableMethod >(object, method, + MakeTuple(a, b, + c)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d) { + return new CefRunnableMethod >(object, method, + MakeTuple(a, b, + c, + d)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d, + const E& e) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a, b, c, d, + e)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a, b, c, d, + e, f)); +} + +template +inline CefRefPtr NewCefRunnableMethod(T* object, Method method, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g) { + return new CefRunnableMethod >(object, + method, + MakeTuple(a, b, c, + d, e, f, + g)); +} + +// CefRunnableFunction and NewCefRunnableFunction implementation -------------- + +template +class CefRunnableFunction : public CefTask { + public: + CefRunnableFunction(Function function, const Params& params) + : function_(function), params_(params) { + } + + ~CefRunnableFunction() { + } + + virtual void Execute() { + if (function_) + DispatchToFunction(function_, params_); + } + + private: + Function function_; + Params params_; + + IMPLEMENT_REFCOUNTING(CefRunnableFunction); +}; + +template +inline CefRefPtr NewCefRunnableFunction(Function function) { + return new CefRunnableFunction(function, MakeTuple()); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a) { + return new CefRunnableFunction >(function, MakeTuple(a)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b) { + return new CefRunnableFunction >(function, + MakeTuple(a, b)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, + c)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, + c, + d)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, c, d, e)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f) { + return new CefRunnableFunction >(function, + MakeTuple(a, b, c, d, e, f)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g) { + return new CefRunnableFunction >( + function, MakeTuple(a, b, c, d, e, f, g)); +} + +template +inline CefRefPtr NewCefRunnableFunction(Function function, + const A& a, const B& b, + const C& c, const D& d, + const E& e, const F& f, + const G& g, const H& h) { + return new CefRunnableFunction >( + function, MakeTuple(a, b, c, d, e, f, g, h)); +} + +#endif // CEF_INCLUDE_CEF_RUNNABLE_H_ diff --git a/vendor/cef3/include/cef_sandbox_win.h b/vendor/cef3/include/cef_sandbox_win.h new file mode 100644 index 00000000000..9b6c48b09b3 --- /dev/null +++ b/vendor/cef3/include/cef_sandbox_win.h @@ -0,0 +1,92 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_CEF_SANDBOX_WIN_H_ +#define CEF_INCLUDE_CEF_SANDBOX_WIN_H_ +#pragma once + +#include "include/cef_base.h" + +#if defined(OS_WIN) + +#ifdef __cplusplus +extern "C" { +#endif + +// The sandbox is used to restrict sub-processes (renderer, plugin, GPU, etc) +// from directly accessing system resources. This helps to protect the user +// from untrusted and potentially malicious Web content. +// See http://www.chromium.org/developers/design-documents/sandbox for +// complete details. +// +// To enable the sandbox on Windows the following requirements must be met: +// 1. Use the same executable for the browser process and all sub-processes. +// 2. Link the executable with the cef_sandbox static library. +// 3. Call the cef_sandbox_info_create() function from within the executable +// (not from a separate DLL) and pass the resulting pointer into both the +// CefExecutProcess() and CefInitialize() functions via the +// |windows_sandbox_info| parameter. + +/// +// Create the sandbox information object for this process. It is safe to create +// multiple of this object and to destroy the object immediately after passing +// into the CefExecutProcess() and/or CefInitialize() functions. +/// +void* cef_sandbox_info_create(); + +/// +// Destroy the specified sandbox information object. +/// +void cef_sandbox_info_destroy(void* sandbox_info); + +#ifdef __cplusplus +} + +/// +// Manages the life span of a sandbox information object. +/// +class CefScopedSandboxInfo { + public: + CefScopedSandboxInfo() { + sandbox_info_ = cef_sandbox_info_create(); + } + ~CefScopedSandboxInfo() { + cef_sandbox_info_destroy(sandbox_info_); + } + + void* sandbox_info() const { return sandbox_info_; } + + private: + void* sandbox_info_; +}; +#endif // __cplusplus + +#endif // defined(OS_WIN) + +#endif // CEF_INCLUDE_CEF_SANDBOX_WIN_H_ diff --git a/vendor/cef3/include/cef_scheme.h b/vendor/cef3/include/cef_scheme.h new file mode 100644 index 00000000000..cd8415c07e6 --- /dev/null +++ b/vendor/cef3/include/cef_scheme.h @@ -0,0 +1,161 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_SCHEME_H_ +#define CEF_INCLUDE_CEF_SCHEME_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_request.h" +#include "include/cef_response.h" +#include "include/cef_resource_handler.h" + +class CefSchemeHandlerFactory; + + +/// +// Register a scheme handler factory for the specified |scheme_name| and +// optional |domain_name|. An empty |domain_name| value for a standard scheme +// will cause the factory to match all domain names. The |domain_name| value +// will be ignored for non-standard schemes. If |scheme_name| is a built-in +// scheme and no handler is returned by |factory| then the built-in scheme +// handler factory will be called. If |scheme_name| is a custom scheme then +// also implement the CefApp::OnRegisterCustomSchemes() method in all processes. +// This function may be called multiple times to change or remove the factory +// that matches the specified |scheme_name| and optional |domain_name|. +// Returns false if an error occurs. This function may be called on any thread +// in the browser process. +/// +/*--cef(optional_param=domain_name,optional_param=factory)--*/ +bool CefRegisterSchemeHandlerFactory( + const CefString& scheme_name, + const CefString& domain_name, + CefRefPtr factory); + +/// +// Clear all registered scheme handler factories. Returns false on error. This +// function may be called on any thread in the browser process. +/// +/*--cef()--*/ +bool CefClearSchemeHandlerFactories(); + + +/// +// Class that manages custom scheme registrations. +/// +/*--cef(source=library)--*/ +class CefSchemeRegistrar : public virtual CefBase { + public: + /// + // Register a custom scheme. This method should not be called for the built-in + // HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes. + // + // If |is_standard| is true the scheme will be treated as a standard scheme. + // Standard schemes are subject to URL canonicalization and parsing rules as + // defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available + // at http://www.ietf.org/rfc/rfc1738.txt + // + // In particular, the syntax for standard scheme URLs must be of the form: + //
+  //  [scheme]://[username]:[password]@[host]:[port]/[url-path]
+  // 
+ // Standard scheme URLs must have a host component that is a fully qualified + // domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of + // RFC 1123. These URLs will be canonicalized to "scheme://host/path" in the + // simplest case and "scheme://username:password@host:port/path" in the most + // explicit case. For example, "scheme:host/path" and "scheme:///host/path" + // will both be canonicalized to "scheme://host/path". The origin of a + // standard scheme URL is the combination of scheme, host and port (i.e., + // "scheme://host:port" in the most explicit case). + // + // For non-standard scheme URLs only the "scheme:" component is parsed and + // canonicalized. The remainder of the URL will be passed to the handler + // as-is. For example, "scheme:///some%20text" will remain the same. + // Non-standard scheme URLs cannot be used as a target for form submission. + // + // If |is_local| is true the scheme will be treated as local (i.e., with the + // same security rules as those applied to "file" URLs). Normal pages cannot + // link to or access local URLs. Also, by default, local URLs can only perform + // XMLHttpRequest calls to the same URL (origin + path) that originated the + // request. To allow XMLHttpRequest calls from a local URL to other URLs with + // the same origin set the CefSettings.file_access_from_file_urls_allowed + // value to true. To allow XMLHttpRequest calls from a local URL to all + // origins set the CefSettings.universal_access_from_file_urls_allowed value + // to true. + // + // If |is_display_isolated| is true the scheme will be treated as display- + // isolated. This means that pages cannot display these URLs unless they are + // from the same scheme. For example, pages in another origin cannot create + // iframes or hyperlinks to URLs with this scheme. + // + // This function may be called on any thread. It should only be called once + // per unique |scheme_name| value. If |scheme_name| is already registered or + // if an error occurs this method will return false. + /// + /*--cef()--*/ + virtual bool AddCustomScheme(const CefString& scheme_name, + bool is_standard, + bool is_local, + bool is_display_isolated) =0; +}; + + +/// +// Class that creates CefResourceHandler instances for handling scheme requests. +// The methods of this class will always be called on the IO thread. +/// +/*--cef(source=client)--*/ +class CefSchemeHandlerFactory : public virtual CefBase { + public: + /// + // Return a new resource handler instance to handle the request or an empty + // reference to allow default handling of the request. |browser| and |frame| + // will be the browser window and frame respectively that originated the + // request or NULL if the request did not originate from a browser window + // (for example, if the request came from CefURLRequest). The |request| object + // passed to this method will not contain cookie data. + /// + /*--cef(optional_param=browser,optional_param=frame)--*/ + virtual CefRefPtr Create( + CefRefPtr browser, + CefRefPtr frame, + const CefString& scheme_name, + CefRefPtr request) =0; +}; + +#endif // CEF_INCLUDE_CEF_SCHEME_H_ diff --git a/vendor/cef3/include/cef_stream.h b/vendor/cef3/include/cef_stream.h new file mode 100644 index 00000000000..3d0633c2562 --- /dev/null +++ b/vendor/cef3/include/cef_stream.h @@ -0,0 +1,242 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_STREAM_H_ +#define CEF_INCLUDE_CEF_STREAM_H_ + +#include "include/cef_base.h" + +/// +// Interface the client can implement to provide a custom stream reader. The +// methods of this class may be called on any thread. +/// +/*--cef(source=client)--*/ +class CefReadHandler : public virtual CefBase { + public: + /// + // Read raw binary data. + /// + /*--cef()--*/ + virtual size_t Read(void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Return non-zero if at end of file. + /// + /*--cef()--*/ + virtual int Eof() =0; + + /// + // Return true if this handler performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // handler from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + + +/// +// Class used to read data from a stream. The methods of this class may be +// called on any thread. +/// +/*--cef(source=library)--*/ +class CefStreamReader : public virtual CefBase { + public: + /// + // Create a new CefStreamReader object from a file. + /// + /*--cef()--*/ + static CefRefPtr CreateForFile(const CefString& fileName); + /// + // Create a new CefStreamReader object from data. + /// + /*--cef()--*/ + static CefRefPtr CreateForData(void* data, size_t size); + /// + // Create a new CefStreamReader object from a custom handler. + /// + /*--cef()--*/ + static CefRefPtr CreateForHandler( + CefRefPtr handler); + + /// + // Read raw binary data. + /// + /*--cef()--*/ + virtual size_t Read(void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Return non-zero if at end of file. + /// + /*--cef()--*/ + virtual int Eof() =0; + + /// + // Returns true if this reader performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // reader from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + + +/// +// Interface the client can implement to provide a custom stream writer. The +// methods of this class may be called on any thread. +/// +/*--cef(source=client)--*/ +class CefWriteHandler : public virtual CefBase { + public: + /// + // Write raw binary data. + /// + /*--cef()--*/ + virtual size_t Write(const void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Return zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Flush the stream. + /// + /*--cef()--*/ + virtual int Flush() =0; + + /// + // Return true if this handler performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // handler from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + + +/// +// Class used to write data to a stream. The methods of this class may be called +// on any thread. +/// +/*--cef(source=library)--*/ +class CefStreamWriter : public virtual CefBase { + public: + /// + // Create a new CefStreamWriter object for a file. + /// + /*--cef()--*/ + static CefRefPtr CreateForFile(const CefString& fileName); + /// + // Create a new CefStreamWriter object for a custom handler. + /// + /*--cef()--*/ + static CefRefPtr CreateForHandler( + CefRefPtr handler); + + /// + // Write raw binary data. + /// + /*--cef()--*/ + virtual size_t Write(const void* ptr, size_t size, size_t n) =0; + + /// + // Seek to the specified offset position. |whence| may be any one of + // SEEK_CUR, SEEK_END or SEEK_SET. Returns zero on success and non-zero on + // failure. + /// + /*--cef()--*/ + virtual int Seek(int64 offset, int whence) =0; + + /// + // Return the current offset position. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Flush the stream. + /// + /*--cef()--*/ + virtual int Flush() =0; + + /// + // Returns true if this writer performs work like accessing the file system + // which may block. Used as a hint for determining the thread to access the + // writer from. + /// + /*--cef()--*/ + virtual bool MayBlock() =0; +}; + +#endif // CEF_INCLUDE_CEF_STREAM_H_ diff --git a/vendor/cef3/include/cef_string_visitor.h b/vendor/cef3/include/cef_string_visitor.h new file mode 100644 index 00000000000..549371473c1 --- /dev/null +++ b/vendor/cef3/include/cef_string_visitor.h @@ -0,0 +1,55 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_STRING_VISITOR_H_ +#define CEF_INCLUDE_CEF_STRING_VISITOR_H_ + +#include "include/cef_base.h" + +/// +// Implement this interface to receive string values asynchronously. +/// +/*--cef(source=client)--*/ +class CefStringVisitor : public virtual CefBase { + public: + /// + // Method that will be executed. + /// + /*--cef(optional_param=string)--*/ + virtual void Visit(const CefString& string) =0; +}; + +#endif // CEF_INCLUDE_CEF_STRING_VISITOR_H_ diff --git a/vendor/cef3/include/cef_task.h b/vendor/cef3/include/cef_task.h new file mode 100644 index 00000000000..0ecaa75264b --- /dev/null +++ b/vendor/cef3/include/cef_task.h @@ -0,0 +1,148 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_TASK_H_ +#define CEF_INCLUDE_CEF_TASK_H_ + +#include "include/cef_base.h" + +typedef cef_thread_id_t CefThreadId; + +/// +// Implement this interface for asynchronous task execution. If the task is +// posted successfully and if the associated message loop is still running then +// the Execute() method will be called on the target thread. If the task fails +// to post then the task object may be destroyed on the source thread instead of +// the target thread. For this reason be cautious when performing work in the +// task object destructor. +/// +/*--cef(source=client)--*/ +class CefTask : public virtual CefBase { + public: + /// + // Method that will be executed on the target thread. + /// + /*--cef()--*/ + virtual void Execute() =0; +}; + +/// +// Class that asynchronously executes tasks on the associated thread. It is safe +// to call the methods of this class on any thread. +// +// CEF maintains multiple internal threads that are used for handling different +// types of tasks in different processes. The cef_thread_id_t definitions in +// cef_types.h list the common CEF threads. Task runners are also available for +// other CEF threads as appropriate (for example, V8 WebWorker threads). +/// +/*--cef(source=library)--*/ +class CefTaskRunner : public virtual CefBase { + public: + /// + // Returns the task runner for the current thread. Only CEF threads will have + // task runners. An empty reference will be returned if this method is called + // on an invalid thread. + /// + /*--cef()--*/ + static CefRefPtr GetForCurrentThread(); + + /// + // Returns the task runner for the specified CEF thread. + /// + /*--cef()--*/ + static CefRefPtr GetForThread(CefThreadId threadId); + + /// + // Returns true if this object is pointing to the same task runner as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Returns true if this task runner belongs to the current thread. + /// + /*--cef()--*/ + virtual bool BelongsToCurrentThread() =0; + + /// + // Returns true if this task runner is for the specified CEF thread. + /// + /*--cef()--*/ + virtual bool BelongsToThread(CefThreadId threadId) =0; + + /// + // Post a task for execution on the thread associated with this task runner. + // Execution will occur asynchronously. + /// + /*--cef()--*/ + virtual bool PostTask(CefRefPtr task) =0; + + /// + // Post a task for delayed execution on the thread associated with this task + // runner. Execution will occur asynchronously. Delayed tasks are not + // supported on V8 WebWorker threads and will be executed without the + // specified delay. + /// + /*--cef()--*/ + virtual bool PostDelayedTask(CefRefPtr task, int64 delay_ms) =0; +}; + + +/// +// Returns true if called on the specified thread. Equivalent to using +// CefTaskRunner::GetForThread(threadId)->BelongsToCurrentThread(). +/// +/*--cef()--*/ +bool CefCurrentlyOn(CefThreadId threadId); + +/// +// Post a task for execution on the specified thread. Equivalent to +// using CefTaskRunner::GetForThread(threadId)->PostTask(task). +/// +/*--cef()--*/ +bool CefPostTask(CefThreadId threadId, CefRefPtr task); + +/// +// Post a task for delayed execution on the specified thread. Equivalent to +// using CefTaskRunner::GetForThread(threadId)->PostDelayedTask(task, delay_ms). +/// +/*--cef()--*/ +bool CefPostDelayedTask(CefThreadId threadId, CefRefPtr task, + int64 delay_ms); + + +#endif // CEF_INCLUDE_CEF_TASK_H_ diff --git a/vendor/cef3/include/cef_trace.h b/vendor/cef3/include/cef_trace.h new file mode 100644 index 00000000000..5b977c6e5d3 --- /dev/null +++ b/vendor/cef3/include/cef_trace.h @@ -0,0 +1,111 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. Portons copyright (c) 2012 +// Google Inc. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +// See cef_trace_event.h for trace macros and additonal documentation. + +#ifndef CEF_INCLUDE_CEF_TRACE_H_ +#define CEF_INCLUDE_CEF_TRACE_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_callback.h" + +/// +// Implement this interface to receive notification when tracing has completed. +// The methods of this class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefEndTracingCallback : public virtual CefBase { + public: + /// + // Called after all processes have sent their trace data. |tracing_file| is + // the path at which tracing data was written. The client is responsible for + // deleting |tracing_file|. + /// + /*--cef()--*/ + virtual void OnEndTracingComplete(const CefString& tracing_file) =0; +}; + + +/// +// Start tracing events on all processes. Tracing is initialized asynchronously +// and |callback| will be executed on the UI thread after initialization is +// complete. +// +// If CefBeginTracing was called previously, or if a CefEndTracingAsync call is +// pending, CefBeginTracing will fail and return false. +// +// |categories| is a comma-delimited list of category wildcards. A category can +// have an optional '-' prefix to make it an excluded category. Having both +// included and excluded categories in the same list is not supported. +// +// Example: "test_MyTest*" +// Example: "test_MyTest*,test_OtherStuff" +// Example: "-excluded_category1,-excluded_category2" +// +// This function must be called on the browser process UI thread. +/// +/*--cef(optional_param=categories,optional_param=callback)--*/ +bool CefBeginTracing(const CefString& categories, + CefRefPtr callback); + +/// +// Stop tracing events on all processes. +// +// This function will fail and return false if a previous call to +// CefEndTracingAsync is already pending or if CefBeginTracing was not called. +// +// |tracing_file| is the path at which tracing data will be written and +// |callback| is the callback that will be executed once all processes have +// sent their trace data. If |tracing_file| is empty a new temporary file path +// will be used. If |callback| is empty no trace data will be written. +// +// This function must be called on the browser process UI thread. +/// +/*--cef(optional_param=tracing_file,optional_param=callback)--*/ +bool CefEndTracing(const CefString& tracing_file, + CefRefPtr callback); + +/// +// Returns the current system trace time or, if none is defined, the current +// high-res time. Can be used by clients to synchronize with the time +// information in trace events. +/// +/*--cef()--*/ +int64 CefNowFromSystemTraceTime(); + +#endif // CEF_INCLUDE_CEF_TRACE_H_ diff --git a/vendor/cef3/include/cef_url.h b/vendor/cef3/include/cef_url.h new file mode 100644 index 00000000000..d2def08e96f --- /dev/null +++ b/vendor/cef3/include/cef_url.h @@ -0,0 +1,77 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_URL_H_ +#define CEF_INCLUDE_CEF_URL_H_ +#pragma once + +#include + +#include "include/cef_base.h" + +/// +// Parse the specified |url| into its component parts. +// Returns false if the URL is empty or invalid. +/// +/*--cef()--*/ +bool CefParseURL(const CefString& url, + CefURLParts& parts); + +/// +// Creates a URL from the specified |parts|, which must contain a non-empty +// spec or a non-empty host and path (at a minimum), but not both. +// Returns false if |parts| isn't initialized as described. +/// +/*--cef()--*/ +bool CefCreateURL(const CefURLParts& parts, + CefString& url); + +/// +// Returns the mime type for the specified file extension or an empty string if +// unknown. +/// +/*--cef()--*/ +CefString CefGetMimeType(const CefString& extension); + +// Get the extensions associated with the given mime type. This should be passed +// in lower case. There could be multiple extensions for a given mime type, like +// "html,htm" for "text/html", or "txt,text,html,..." for "text/*". Any existing +// elements in the provided vector will not be erased. +/*--cef()--*/ +void CefGetExtensionsForMimeType(const CefString& mime_type, + std::vector& extensions); + +#endif // CEF_INCLUDE_CEF_URL_H_ diff --git a/vendor/cef3/include/cef_urlrequest.h b/vendor/cef3/include/cef_urlrequest.h new file mode 100644 index 00000000000..02a9da68436 --- /dev/null +++ b/vendor/cef3/include/cef_urlrequest.h @@ -0,0 +1,183 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_URLREQUEST_H_ +#define CEF_INCLUDE_CEF_URLREQUEST_H_ +#pragma once + +#include "include/cef_auth_callback.h" +#include "include/cef_base.h" +#include "include/cef_request.h" +#include "include/cef_response.h" + +class CefURLRequestClient; + +/// +// Class used to make a URL request. URL requests are not associated with a +// browser instance so no CefClient callbacks will be executed. URL requests +// can be created on any valid CEF thread in either the browser or render +// process. Once created the methods of the URL request object must be accessed +// on the same thread that created it. +/// +/*--cef(source=library)--*/ +class CefURLRequest : public virtual CefBase { + public: + typedef cef_urlrequest_status_t Status; + typedef cef_errorcode_t ErrorCode; + + /// + // Create a new URL request. Only GET, POST, HEAD, DELETE and PUT request + // methods are supported. Multiple post data elements are not supported and + // elements of type PDE_TYPE_FILE are only supported for requests originating + // from the browser process. Requests originating from the render process will + // receive the same handling as requests originating from Web content -- if + // the response contains Content-Disposition or Mime-Type header values that + // would not normally be rendered then the response may receive special + // handling inside the browser (for example, via the file download code path + // instead of the URL request code path). The |request| object will be marked + // as read-only after calling this method. + /// + /*--cef()--*/ + static CefRefPtr Create( + CefRefPtr request, + CefRefPtr client); + + /// + // Returns the request object used to create this URL request. The returned + // object is read-only and should not be modified. + /// + /*--cef()--*/ + virtual CefRefPtr GetRequest() =0; + + /// + // Returns the client. + /// + /*--cef()--*/ + virtual CefRefPtr GetClient() =0; + + /// + // Returns the request status. + /// + /*--cef(default_retval=UR_UNKNOWN)--*/ + virtual Status GetRequestStatus() =0; + + /// + // Returns the request error if status is UR_CANCELED or UR_FAILED, or 0 + // otherwise. + /// + /*--cef(default_retval=ERR_NONE)--*/ + virtual ErrorCode GetRequestError() =0; + + /// + // Returns the response, or NULL if no response information is available. + // Response information will only be available after the upload has completed. + // The returned object is read-only and should not be modified. + /// + /*--cef()--*/ + virtual CefRefPtr GetResponse() =0; + + /// + // Cancel the request. + /// + /*--cef()--*/ + virtual void Cancel() =0; +}; + +/// +// Interface that should be implemented by the CefURLRequest client. The +// methods of this class will be called on the same thread that created the +// request unless otherwise documented. +/// +/*--cef(source=client)--*/ +class CefURLRequestClient : public virtual CefBase { + public: + /// + // Notifies the client that the request has completed. Use the + // CefURLRequest::GetRequestStatus method to determine if the request was + // successful or not. + /// + /*--cef()--*/ + virtual void OnRequestComplete(CefRefPtr request) =0; + + /// + // Notifies the client of upload progress. |current| denotes the number of + // bytes sent so far and |total| is the total size of uploading data (or -1 if + // chunked upload is enabled). This method will only be called if the + // UR_FLAG_REPORT_UPLOAD_PROGRESS flag is set on the request. + /// + /*--cef()--*/ + virtual void OnUploadProgress(CefRefPtr request, + uint64 current, + uint64 total) =0; + + /// + // Notifies the client of download progress. |current| denotes the number of + // bytes received up to the call and |total| is the expected total size of the + // response (or -1 if not determined). + /// + /*--cef()--*/ + virtual void OnDownloadProgress(CefRefPtr request, + uint64 current, + uint64 total) =0; + + /// + // Called when some part of the response is read. |data| contains the current + // bytes received since the last call. This method will not be called if the + // UR_FLAG_NO_DOWNLOAD_DATA flag is set on the request. + /// + /*--cef()--*/ + virtual void OnDownloadData(CefRefPtr request, + const void* data, + size_t data_length) =0; + + /// + // Called on the IO thread when the browser needs credentials from the user. + // |isProxy| indicates whether the host is a proxy server. |host| contains the + // hostname and |port| contains the port number. Return true to continue the + // request and call CefAuthCallback::Continue() when the authentication + // information is available. Return false to cancel the request. This method + // will only be called for requests initiated from the browser process. + /// + /*--cef(optional_param=realm)--*/ + virtual bool GetAuthCredentials(bool isProxy, + const CefString& host, + int port, + const CefString& realm, + const CefString& scheme, + CefRefPtr callback) =0; +}; + +#endif // CEF_INCLUDE_CEF_URLREQUEST_H_ diff --git a/vendor/cef3/include/cef_v8.h b/vendor/cef3/include/cef_v8.h new file mode 100644 index 00000000000..3f05b802e8f --- /dev/null +++ b/vendor/cef3/include/cef_v8.h @@ -0,0 +1,879 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + + +#ifndef CEF_INCLUDE_CEF_V8_H_ +#define CEF_INCLUDE_CEF_V8_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_frame.h" +#include "include/cef_task.h" +#include + +class CefV8Exception; +class CefV8Handler; +class CefV8StackFrame; +class CefV8Value; + + +/// +// Register a new V8 extension with the specified JavaScript extension code and +// handler. Functions implemented by the handler are prototyped using the +// keyword 'native'. The calling of a native function is restricted to the scope +// in which the prototype of the native function is defined. This function may +// only be called on the render process main thread. +// +// Example JavaScript extension code: +//
+//   // create the 'example' global object if it doesn't already exist.
+//   if (!example)
+//     example = {};
+//   // create the 'example.test' global object if it doesn't already exist.
+//   if (!example.test)
+//     example.test = {};
+//   (function() {
+//     // Define the function 'example.test.myfunction'.
+//     example.test.myfunction = function() {
+//       // Call CefV8Handler::Execute() with the function name 'MyFunction'
+//       // and no arguments.
+//       native function MyFunction();
+//       return MyFunction();
+//     };
+//     // Define the getter function for parameter 'example.test.myparam'.
+//     example.test.__defineGetter__('myparam', function() {
+//       // Call CefV8Handler::Execute() with the function name 'GetMyParam'
+//       // and no arguments.
+//       native function GetMyParam();
+//       return GetMyParam();
+//     });
+//     // Define the setter function for parameter 'example.test.myparam'.
+//     example.test.__defineSetter__('myparam', function(b) {
+//       // Call CefV8Handler::Execute() with the function name 'SetMyParam'
+//       // and a single argument.
+//       native function SetMyParam();
+//       if(b) SetMyParam(b);
+//     });
+//
+//     // Extension definitions can also contain normal JavaScript variables
+//     // and functions.
+//     var myint = 0;
+//     example.test.increment = function() {
+//       myint += 1;
+//       return myint;
+//     };
+//   })();
+// 
+// Example usage in the page: +//
+//   // Call the function.
+//   example.test.myfunction();
+//   // Set the parameter.
+//   example.test.myparam = value;
+//   // Get the parameter.
+//   value = example.test.myparam;
+//   // Call another function.
+//   example.test.increment();
+// 
+/// +/*--cef(optional_param=handler)--*/ +bool CefRegisterExtension(const CefString& extension_name, + const CefString& javascript_code, + CefRefPtr handler); + + +/// +// Class representing a V8 context handle. V8 handles can only be accessed from +// the thread on which they are created. Valid threads for creating a V8 handle +// include the render process main thread (TID_RENDERER) and WebWorker threads. +// A task runner for posting tasks on the associated thread can be retrieved via +// the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8Context : public virtual CefBase { + public: + /// + // Returns the current (top) context object in the V8 context stack. + /// + /*--cef()--*/ + static CefRefPtr GetCurrentContext(); + + /// + // Returns the entered (bottom) context object in the V8 context stack. + /// + /*--cef()--*/ + static CefRefPtr GetEnteredContext(); + + /// + // Returns true if V8 is currently inside a context. + /// + /*--cef()--*/ + static bool InContext(); + + /// + // Returns the task runner associated with this context. V8 handles can only + // be accessed from the thread on which they are created. This method can be + // called on any render process thread. + /// + /*--cef()--*/ + virtual CefRefPtr GetTaskRunner() =0; + + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the browser for this context. This method will return an empty + // reference for WebWorker contexts. + /// + /*--cef()--*/ + virtual CefRefPtr GetBrowser() =0; + + /// + // Returns the frame for this context. This method will return an empty + // reference for WebWorker contexts. + /// + /*--cef()--*/ + virtual CefRefPtr GetFrame() =0; + + /// + // Returns the global object for this context. The context must be entered + // before calling this method. + /// + /*--cef()--*/ + virtual CefRefPtr GetGlobal() =0; + + /// + // Enter this context. A context must be explicitly entered before creating a + // V8 Object, Array, Function or Date asynchronously. Exit() must be called + // the same number of times as Enter() before releasing this context. V8 + // objects belong to the context in which they are created. Returns true if + // the scope was entered successfully. + /// + /*--cef()--*/ + virtual bool Enter() =0; + + /// + // Exit this context. Call this method only after calling Enter(). Returns + // true if the scope was exited successfully. + /// + /*--cef()--*/ + virtual bool Exit() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Evaluates the specified JavaScript code using this context's global object. + // On success |retval| will be set to the return value, if any, and the + // function will return true. On failure |exception| will be set to the + // exception, if any, and the function will return false. + /// + /*--cef()--*/ + virtual bool Eval(const CefString& code, + CefRefPtr& retval, + CefRefPtr& exception) =0; +}; + + +typedef std::vector > CefV8ValueList; + +/// +// Interface that should be implemented to handle V8 function calls. The methods +// of this class will be called on the thread associated with the V8 function. +/// +/*--cef(source=client)--*/ +class CefV8Handler : public virtual CefBase { + public: + /// + // Handle execution of the function identified by |name|. |object| is the + // receiver ('this' object) of the function. |arguments| is the list of + // arguments passed to the function. If execution succeeds set |retval| to the + // function return value. If execution fails set |exception| to the exception + // that will be thrown. Return true if execution was handled. + /// + /*--cef()--*/ + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) =0; +}; + +/// +// Interface that should be implemented to handle V8 accessor calls. Accessor +// identifiers are registered by calling CefV8Value::SetValue(). The methods +// of this class will be called on the thread associated with the V8 accessor. +/// +/*--cef(source=client)--*/ +class CefV8Accessor : public virtual CefBase { + public: + /// + // Handle retrieval the accessor value identified by |name|. |object| is the + // receiver ('this' object) of the accessor. If retrieval succeeds set + // |retval| to the return value. If retrieval fails set |exception| to the + // exception that will be thrown. Return true if accessor retrieval was + // handled. + /// + /*--cef()--*/ + virtual bool Get(const CefString& name, + const CefRefPtr object, + CefRefPtr& retval, + CefString& exception) =0; + + /// + // Handle assignment of the accessor value identified by |name|. |object| is + // the receiver ('this' object) of the accessor. |value| is the new value + // being assigned to the accessor. If assignment fails set |exception| to the + // exception that will be thrown. Return true if accessor assignment was + // handled. + /// + /*--cef()--*/ + virtual bool Set(const CefString& name, + const CefRefPtr object, + const CefRefPtr value, + CefString& exception) =0; +}; + +/// +// Class representing a V8 exception. The methods of this class may be called on +// any render process thread. +/// +/*--cef(source=library)--*/ +class CefV8Exception : public virtual CefBase { + public: + /// + // Returns the exception message. + /// + /*--cef()--*/ + virtual CefString GetMessage() =0; + + /// + // Returns the line of source code that the exception occurred within. + /// + /*--cef()--*/ + virtual CefString GetSourceLine() =0; + + /// + // Returns the resource name for the script from where the function causing + // the error originates. + /// + /*--cef()--*/ + virtual CefString GetScriptResourceName() =0; + + /// + // Returns the 1-based number of the line where the error occurred or 0 if the + // line number is unknown. + /// + /*--cef()--*/ + virtual int GetLineNumber() =0; + + /// + // Returns the index within the script of the first character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetStartPosition() =0; + + /// + // Returns the index within the script of the last character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetEndPosition() =0; + + /// + // Returns the index within the line of the first character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetStartColumn() =0; + + /// + // Returns the index within the line of the last character where the error + // occurred. + /// + /*--cef()--*/ + virtual int GetEndColumn() =0; +}; + +/// +// Class representing a V8 value handle. V8 handles can only be accessed from +// the thread on which they are created. Valid threads for creating a V8 handle +// include the render process main thread (TID_RENDERER) and WebWorker threads. +// A task runner for posting tasks on the associated thread can be retrieved via +// the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8Value : public virtual CefBase { + public: + typedef cef_v8_accesscontrol_t AccessControl; + typedef cef_v8_propertyattribute_t PropertyAttribute; + + /// + // Create a new CefV8Value object of type undefined. + /// + /*--cef()--*/ + static CefRefPtr CreateUndefined(); + + /// + // Create a new CefV8Value object of type null. + /// + /*--cef()--*/ + static CefRefPtr CreateNull(); + + /// + // Create a new CefV8Value object of type bool. + /// + /*--cef()--*/ + static CefRefPtr CreateBool(bool value); + + /// + // Create a new CefV8Value object of type int. + /// + /*--cef()--*/ + static CefRefPtr CreateInt(int32 value); + + /// + // Create a new CefV8Value object of type unsigned int. + /// + /*--cef()--*/ + static CefRefPtr CreateUInt(uint32 value); + + /// + // Create a new CefV8Value object of type double. + /// + /*--cef()--*/ + static CefRefPtr CreateDouble(double value); + + /// + // Create a new CefV8Value object of type Date. This method should only be + // called from within the scope of a CefV8ContextHandler, CefV8Handler or + // CefV8Accessor callback, or in combination with calling Enter() and Exit() + // on a stored CefV8Context reference. + /// + /*--cef()--*/ + static CefRefPtr CreateDate(const CefTime& date); + + /// + // Create a new CefV8Value object of type string. + /// + /*--cef(optional_param=value)--*/ + static CefRefPtr CreateString(const CefString& value); + + /// + // Create a new CefV8Value object of type object with optional accessor. This + // method should only be called from within the scope of a + // CefV8ContextHandler, CefV8Handler or CefV8Accessor callback, or in + // combination with calling Enter() and Exit() on a stored CefV8Context + // reference. + /// + /*--cef(optional_param=accessor)--*/ + static CefRefPtr CreateObject(CefRefPtr accessor); + + /// + // Create a new CefV8Value object of type array with the specified |length|. + // If |length| is negative the returned array will have length 0. This method + // should only be called from within the scope of a CefV8ContextHandler, + // CefV8Handler or CefV8Accessor callback, or in combination with calling + // Enter() and Exit() on a stored CefV8Context reference. + /// + /*--cef()--*/ + static CefRefPtr CreateArray(int length); + + /// + // Create a new CefV8Value object of type function. This method should only be + // called from within the scope of a CefV8ContextHandler, CefV8Handler or + // CefV8Accessor callback, or in combination with calling Enter() and Exit() + // on a stored CefV8Context reference. + /// + /*--cef()--*/ + static CefRefPtr CreateFunction(const CefString& name, + CefRefPtr handler); + + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // True if the value type is undefined. + /// + /*--cef()--*/ + virtual bool IsUndefined() =0; + + /// + // True if the value type is null. + /// + /*--cef()--*/ + virtual bool IsNull() =0; + + /// + // True if the value type is bool. + /// + /*--cef()--*/ + virtual bool IsBool() =0; + + /// + // True if the value type is int. + /// + /*--cef()--*/ + virtual bool IsInt() =0; + + /// + // True if the value type is unsigned int. + /// + /*--cef()--*/ + virtual bool IsUInt() =0; + + /// + // True if the value type is double. + /// + /*--cef()--*/ + virtual bool IsDouble() =0; + + /// + // True if the value type is Date. + /// + /*--cef()--*/ + virtual bool IsDate() =0; + + /// + // True if the value type is string. + /// + /*--cef()--*/ + virtual bool IsString() =0; + + /// + // True if the value type is object. + /// + /*--cef()--*/ + virtual bool IsObject() =0; + + /// + // True if the value type is array. + /// + /*--cef()--*/ + virtual bool IsArray() =0; + + /// + // True if the value type is function. + /// + /*--cef()--*/ + virtual bool IsFunction() =0; + + /// + // Returns true if this object is pointing to the same handle as |that| + // object. + /// + /*--cef()--*/ + virtual bool IsSame(CefRefPtr that) =0; + + /// + // Return a bool value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual bool GetBoolValue() =0; + + /// + // Return an int value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual int32 GetIntValue() =0; + + /// + // Return an unisgned int value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual uint32 GetUIntValue() =0; + + /// + // Return a double value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual double GetDoubleValue() =0; + + /// + // Return a Date value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual CefTime GetDateValue() =0; + + /// + // Return a string value. The underlying data will be converted to if + // necessary. + /// + /*--cef()--*/ + virtual CefString GetStringValue() =0; + + + // OBJECT METHODS - These methods are only available on objects. Arrays and + // functions are also objects. String- and integer-based keys can be used + // interchangably with the framework converting between them as necessary. + + /// + // Returns true if this is a user created object. + /// + /*--cef()--*/ + virtual bool IsUserCreated() =0; + + /// + // Returns true if the last method call resulted in an exception. This + // attribute exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool HasException() =0; + + /// + // Returns the exception resulting from the last method call. This attribute + // exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual CefRefPtr GetException() =0; + + /// + // Clears the last exception and returns true on success. + /// + /*--cef()--*/ + virtual bool ClearException() =0; + + /// + // Returns true if this object will re-throw future exceptions. This attribute + // exists only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool WillRethrowExceptions() =0; + + /// + // Set whether this object will re-throw future exceptions. By default + // exceptions are not re-thrown. If a exception is re-thrown the current + // context should not be accessed again until after the exception has been + // caught and not re-thrown. Returns true on success. This attribute exists + // only in the scope of the current CEF value object. + /// + /*--cef()--*/ + virtual bool SetRethrowExceptions(bool rethrow) =0; + + /// + // Returns true if the object has a value with the specified identifier. + /// + /*--cef(capi_name=has_value_bykey,optional_param=key)--*/ + virtual bool HasValue(const CefString& key) =0; + + /// + // Returns true if the object has a value with the specified identifier. + /// + /*--cef(capi_name=has_value_byindex,index_param=index)--*/ + virtual bool HasValue(int index) =0; + + /// + // Deletes the value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only and don't-delete values this method will return + // true even though deletion failed. + /// + /*--cef(capi_name=delete_value_bykey,optional_param=key)--*/ + virtual bool DeleteValue(const CefString& key) =0; + + /// + // Deletes the value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly, deletion fails + // or an exception is thrown. For read-only and don't-delete values this + // method will return true even though deletion failed. + /// + /*--cef(capi_name=delete_value_byindex,index_param=index)--*/ + virtual bool DeleteValue(int index) =0; + + /// + // Returns the value with the specified identifier on success. Returns NULL + // if this method is called incorrectly or an exception is thrown. + /// + /*--cef(capi_name=get_value_bykey,optional_param=key)--*/ + virtual CefRefPtr GetValue(const CefString& key) =0; + + /// + // Returns the value with the specified identifier on success. Returns NULL + // if this method is called incorrectly or an exception is thrown. + /// + /*--cef(capi_name=get_value_byindex,index_param=index)--*/ + virtual CefRefPtr GetValue(int index) =0; + + /// + // Associates a value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only values this method will return true even though + // assignment failed. + /// + /*--cef(capi_name=set_value_bykey,optional_param=key)--*/ + virtual bool SetValue(const CefString& key, CefRefPtr value, + PropertyAttribute attribute) =0; + + /// + // Associates a value with the specified identifier and returns true on + // success. Returns false if this method is called incorrectly or an exception + // is thrown. For read-only values this method will return true even though + // assignment failed. + /// + /*--cef(capi_name=set_value_byindex,index_param=index)--*/ + virtual bool SetValue(int index, CefRefPtr value) =0; + + /// + // Registers an identifier and returns true on success. Access to the + // identifier will be forwarded to the CefV8Accessor instance passed to + // CefV8Value::CreateObject(). Returns false if this method is called + // incorrectly or an exception is thrown. For read-only values this method + // will return true even though assignment failed. + /// + /*--cef(capi_name=set_value_byaccessor,optional_param=key)--*/ + virtual bool SetValue(const CefString& key, AccessControl settings, + PropertyAttribute attribute) =0; + + /// + // Read the keys for the object's values into the specified vector. Integer- + // based keys will also be returned as strings. + /// + /*--cef()--*/ + virtual bool GetKeys(std::vector& keys) =0; + + /// + // Sets the user data for this object and returns true on success. Returns + // false if this method is called incorrectly. This method can only be called + // on user created objects. + /// + /*--cef(optional_param=user_data)--*/ + virtual bool SetUserData(CefRefPtr user_data) =0; + + /// + // Returns the user data, if any, assigned to this object. + /// + /*--cef()--*/ + virtual CefRefPtr GetUserData() =0; + + /// + // Returns the amount of externally allocated memory registered for the + // object. + /// + /*--cef()--*/ + virtual int GetExternallyAllocatedMemory() =0; + + /// + // Adjusts the amount of registered external memory for the object. Used to + // give V8 an indication of the amount of externally allocated memory that is + // kept alive by JavaScript objects. V8 uses this information to decide when + // to perform global garbage collection. Each CefV8Value tracks the amount of + // external memory associated with it and automatically decreases the global + // total by the appropriate amount on its destruction. |change_in_bytes| + // specifies the number of bytes to adjust by. This method returns the number + // of bytes associated with the object after the adjustment. This method can + // only be called on user created objects. + /// + /*--cef()--*/ + virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) =0; + + + // ARRAY METHODS - These methods are only available on arrays. + + /// + // Returns the number of elements in the array. + /// + /*--cef()--*/ + virtual int GetArrayLength() =0; + + + // FUNCTION METHODS - These methods are only available on functions. + + /// + // Returns the function name. + /// + /*--cef()--*/ + virtual CefString GetFunctionName() =0; + + /// + // Returns the function handler or NULL if not a CEF-created function. + /// + /*--cef()--*/ + virtual CefRefPtr GetFunctionHandler() =0; + + /// + // Execute the function using the current V8 context. This method should only + // be called from within the scope of a CefV8Handler or CefV8Accessor + // callback, or in combination with calling Enter() and Exit() on a stored + // CefV8Context reference. |object| is the receiver ('this' object) of the + // function. If |object| is empty the current context's global object will be + // used. |arguments| is the list of arguments that will be passed to the + // function. Returns the function return value on success. Returns NULL if + // this method is called incorrectly or an exception is thrown. + /// + /*--cef(optional_param=object)--*/ + virtual CefRefPtr ExecuteFunction( + CefRefPtr object, + const CefV8ValueList& arguments) =0; + + /// + // Execute the function using the specified V8 context. |object| is the + // receiver ('this' object) of the function. If |object| is empty the + // specified context's global object will be used. |arguments| is the list of + // arguments that will be passed to the function. Returns the function return + // value on success. Returns NULL if this method is called incorrectly or an + // exception is thrown. + /// + /*--cef(optional_param=object)--*/ + virtual CefRefPtr ExecuteFunctionWithContext( + CefRefPtr context, + CefRefPtr object, + const CefV8ValueList& arguments) =0; +}; + +/// +// Class representing a V8 stack trace handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8StackTrace : public virtual CefBase { + public: + /// + // Returns the stack trace for the currently active context. |frame_limit| is + // the maximum number of frames that will be captured. + /// + /*--cef()--*/ + static CefRefPtr GetCurrent(int frame_limit); + + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the number of stack frames. + /// + /*--cef()--*/ + virtual int GetFrameCount() =0; + + /// + // Returns the stack frame at the specified 0-based index. + /// + /*--cef()--*/ + virtual CefRefPtr GetFrame(int index) =0; +}; + +/// +// Class representing a V8 stack frame handle. V8 handles can only be accessed +// from the thread on which they are created. Valid threads for creating a V8 +// handle include the render process main thread (TID_RENDERER) and WebWorker +// threads. A task runner for posting tasks on the associated thread can be +// retrieved via the CefV8Context::GetTaskRunner() method. +/// +/*--cef(source=library)--*/ +class CefV8StackFrame : public virtual CefBase { + public: + /// + // Returns true if the underlying handle is valid and it can be accessed on + // the current thread. Do not call any other methods if this method returns + // false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns the name of the resource script that contains the function. + /// + /*--cef()--*/ + virtual CefString GetScriptName() =0; + + /// + // Returns the name of the resource script that contains the function or the + // sourceURL value if the script name is undefined and its source ends with + // a "//@ sourceURL=..." string. + /// + /*--cef()--*/ + virtual CefString GetScriptNameOrSourceURL() =0; + + /// + // Returns the name of the function. + /// + /*--cef()--*/ + virtual CefString GetFunctionName() =0; + + /// + // Returns the 1-based line number for the function call or 0 if unknown. + /// + /*--cef()--*/ + virtual int GetLineNumber() =0; + + /// + // Returns the 1-based column offset on the line for the function call or 0 if + // unknown. + /// + /*--cef()--*/ + virtual int GetColumn() =0; + + /// + // Returns true if the function was compiled using eval(). + /// + /*--cef()--*/ + virtual bool IsEval() =0; + + /// + // Returns true if the function was called as a constructor via "new". + /// + /*--cef()--*/ + virtual bool IsConstructor() =0; +}; + +#endif // CEF_INCLUDE_CEF_V8_H_ diff --git a/vendor/cef3/include/cef_values.h b/vendor/cef3/include/cef_values.h new file mode 100644 index 00000000000..9a640ab77d8 --- /dev/null +++ b/vendor/cef3/include/cef_values.h @@ -0,0 +1,471 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_VALUES_H_ +#define CEF_INCLUDE_CEF_VALUES_H_ +#pragma once + +#include +#include "include/cef_base.h" + +class CefDictionaryValue; +class CefListValue; + +typedef cef_value_type_t CefValueType; + +/// +// Class representing a binary value. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefBinaryValue : public virtual CefBase { + public: + /// + // Creates a new object that is not owned by any other object. The specified + // |data| will be copied. + /// + /*--cef()--*/ + static CefRefPtr Create(const void* data, + size_t data_size); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // method returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if this object is currently owned by another object. + /// + /*--cef()--*/ + virtual bool IsOwned() =0; + + /// + // Returns a copy of this object. The data in this object will also be copied. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Returns the data size. + /// + /*--cef()--*/ + virtual size_t GetSize() =0; + + /// + // Read up to |buffer_size| number of bytes into |buffer|. Reading begins at + // the specified byte |data_offset|. Returns the number of bytes read. + /// + /*--cef()--*/ + virtual size_t GetData(void* buffer, + size_t buffer_size, + size_t data_offset) =0; +}; + + +/// +// Class representing a dictionary value. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefDictionaryValue : public virtual CefBase { + public: + typedef std::vector KeyList; + + /// + // Creates a new object that is not owned by any other object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // method returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if this object is currently owned by another object. + /// + /*--cef()--*/ + virtual bool IsOwned() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. If |exclude_empty_children| is true + // any empty dictionaries or lists will be excluded from the copy. + /// + /*--cef()--*/ + virtual CefRefPtr Copy(bool exclude_empty_children) =0; + + /// + // Returns the number of values. + /// + /*--cef()--*/ + virtual size_t GetSize() =0; + + /// + // Removes all values. Returns true on success. + /// + /*--cef()--*/ + virtual bool Clear() =0; + + /// + // Returns true if the current dictionary has a value for the given key. + /// + /*--cef()--*/ + virtual bool HasKey(const CefString& key) =0; + + /// + // Reads all keys for this dictionary into the specified vector. + /// + /*--cef()--*/ + virtual bool GetKeys(KeyList& keys) =0; + + /// + // Removes the value at the specified key. Returns true is the value was + // removed successfully. + /// + /*--cef()--*/ + virtual bool Remove(const CefString& key) =0; + + /// + // Returns the value type for the specified key. + /// + /*--cef(default_retval=VTYPE_INVALID)--*/ + virtual CefValueType GetType(const CefString& key) =0; + + /// + // Returns the value at the specified key as type bool. + /// + /*--cef()--*/ + virtual bool GetBool(const CefString& key) =0; + + /// + // Returns the value at the specified key as type int. + /// + /*--cef()--*/ + virtual int GetInt(const CefString& key) =0; + + /// + // Returns the value at the specified key as type double. + /// + /*--cef()--*/ + virtual double GetDouble(const CefString& key) =0; + + /// + // Returns the value at the specified key as type string. + /// + /*--cef()--*/ + virtual CefString GetString(const CefString& key) =0; + + /// + // Returns the value at the specified key as type binary. + /// + /*--cef()--*/ + virtual CefRefPtr GetBinary(const CefString& key) =0; + + /// + // Returns the value at the specified key as type dictionary. + /// + /*--cef()--*/ + virtual CefRefPtr GetDictionary(const CefString& key) =0; + + /// + // Returns the value at the specified key as type list. + /// + /*--cef()--*/ + virtual CefRefPtr GetList(const CefString& key) =0; + + /// + // Sets the value at the specified key as type null. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetNull(const CefString& key) =0; + + /// + // Sets the value at the specified key as type bool. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetBool(const CefString& key, bool value) =0; + + /// + // Sets the value at the specified key as type int. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetInt(const CefString& key, int value) =0; + + /// + // Sets the value at the specified key as type double. Returns true if the + // value was set successfully. + /// + /*--cef()--*/ + virtual bool SetDouble(const CefString& key, double value) =0; + + /// + // Sets the value at the specified key as type string. Returns true if the + // value was set successfully. + /// + /*--cef(optional_param=value)--*/ + virtual bool SetString(const CefString& key, const CefString& value) =0; + + /// + // Sets the value at the specified key as type binary. Returns true if the + // value was set successfully. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef()--*/ + virtual bool SetBinary(const CefString& key, + CefRefPtr value) =0; + + /// + // Sets the value at the specified key as type dict. Returns true if the + // value was set successfully. After calling this method the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef()--*/ + virtual bool SetDictionary(const CefString& key, + CefRefPtr value) =0; + + /// + // Sets the value at the specified key as type list. Returns true if the + // value was set successfully. After calling this method the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef()--*/ + virtual bool SetList(const CefString& key, + CefRefPtr value) =0; +}; + + +/// +// Class representing a list value. Can be used on any process and thread. +/// +/*--cef(source=library)--*/ +class CefListValue : public virtual CefBase { + public: + /// + // Creates a new object that is not owned by any other object. + /// + /*--cef()--*/ + static CefRefPtr Create(); + + /// + // Returns true if this object is valid. Do not call any other methods if this + // method returns false. + /// + /*--cef()--*/ + virtual bool IsValid() =0; + + /// + // Returns true if this object is currently owned by another object. + /// + /*--cef()--*/ + virtual bool IsOwned() =0; + + /// + // Returns true if the values of this object are read-only. Some APIs may + // expose read-only objects. + /// + /*--cef()--*/ + virtual bool IsReadOnly() =0; + + /// + // Returns a writable copy of this object. + /// + /*--cef()--*/ + virtual CefRefPtr Copy() =0; + + /// + // Sets the number of values. If the number of values is expanded all + // new value slots will default to type null. Returns true on success. + /// + /*--cef()--*/ + virtual bool SetSize(size_t size) =0; + + /// + // Returns the number of values. + /// + /*--cef()--*/ + virtual size_t GetSize() =0; + + /// + // Removes all values. Returns true on success. + /// + /*--cef()--*/ + virtual bool Clear() =0; + + /// + // Removes the value at the specified index. + /// + /*--cef(index_param=index)--*/ + virtual bool Remove(int index) =0; + + /// + // Returns the value type at the specified index. + /// + /*--cef(default_retval=VTYPE_INVALID,index_param=index)--*/ + virtual CefValueType GetType(int index) =0; + + /// + // Returns the value at the specified index as type bool. + /// + /*--cef(index_param=index)--*/ + virtual bool GetBool(int index) =0; + + /// + // Returns the value at the specified index as type int. + /// + /*--cef(index_param=index)--*/ + virtual int GetInt(int index) =0; + + /// + // Returns the value at the specified index as type double. + /// + /*--cef(index_param=index)--*/ + virtual double GetDouble(int index) =0; + + /// + // Returns the value at the specified index as type string. + /// + /*--cef(index_param=index)--*/ + virtual CefString GetString(int index) =0; + + /// + // Returns the value at the specified index as type binary. + /// + /*--cef(index_param=index)--*/ + virtual CefRefPtr GetBinary(int index) =0; + + /// + // Returns the value at the specified index as type dictionary. + /// + /*--cef(index_param=index)--*/ + virtual CefRefPtr GetDictionary(int index) =0; + + /// + // Returns the value at the specified index as type list. + /// + /*--cef(index_param=index)--*/ + virtual CefRefPtr GetList(int index) =0; + + /// + // Sets the value at the specified index as type null. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetNull(int index) =0; + + /// + // Sets the value at the specified index as type bool. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetBool(int index, bool value) =0; + + /// + // Sets the value at the specified index as type int. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetInt(int index, int value) =0; + + /// + // Sets the value at the specified index as type double. Returns true if the + // value was set successfully. + /// + /*--cef(index_param=index)--*/ + virtual bool SetDouble(int index, double value) =0; + + /// + // Sets the value at the specified index as type string. Returns true if the + // value was set successfully. + /// + /*--cef(optional_param=value,index_param=index)--*/ + virtual bool SetString(int index, const CefString& value) =0; + + /// + // Sets the value at the specified index as type binary. Returns true if the + // value was set successfully. After calling this method the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef(index_param=index)--*/ + virtual bool SetBinary(int index, CefRefPtr value) =0; + + /// + // Sets the value at the specified index as type dict. Returns true if the + // value was set successfully. After calling this method the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef(index_param=index)--*/ + virtual bool SetDictionary(int index, CefRefPtr value) =0; + + /// + // Sets the value at the specified index as type list. Returns true if the + // value was set successfully. After calling this method the |value| object + // will no longer be valid. If |value| is currently owned by another object + // then the value will be copied and the |value| reference will not change. + // Otherwise, ownership will be transferred to this object and the |value| + // reference will be invalidated. + /// + /*--cef(index_param=index)--*/ + virtual bool SetList(int index, CefRefPtr value) =0; +}; + +#endif // CEF_INCLUDE_CEF_VALUES_H_ diff --git a/vendor/cef3/include/cef_version.h b/vendor/cef3/include/cef_version.h new file mode 100644 index 00000000000..38f9cacc275 --- /dev/null +++ b/vendor/cef3/include/cef_version.h @@ -0,0 +1,105 @@ +// Copyright (c) 2015 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// This file is generated by the make_version_header.py tool. +// + +#ifndef CEF_INCLUDE_CEF_VERSION_H_ +#define CEF_INCLUDE_CEF_VERSION_H_ + +#define CEF_VERSION_MAJOR 3 +#define CEF_REVISION 1972 +#define COPYRIGHT_YEAR 2015 + +#define CHROME_VERSION_MAJOR 39 +#define CHROME_VERSION_MINOR 0 +#define CHROME_VERSION_BUILD 2171 +#define CHROME_VERSION_PATCH 95 + +#define DO_MAKE_STRING(p) #p +#define MAKE_STRING(p) DO_MAKE_STRING(p) + +#ifndef APSTUDIO_HIDDEN_SYMBOLS + +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// The API hash is created by analyzing CEF header files for C API type +// definitions. The hash value will change when header files are modified +// in a way that may cause binary incompatibility with other builds. The +// universal hash value will change if any platform is affected whereas the +// platform hash values will change only if that particular platform is +// affected. +#define CEF_API_HASH_UNIVERSAL "45820f043326b9ef42f6cb68dc257c0f91442428" +#if defined(OS_WIN) +#define CEF_API_HASH_PLATFORM "1051c471f09e2ad841a331540a5ccd583e4b4704" +#elif defined(OS_MACOSX) +#define CEF_API_HASH_PLATFORM "c2d2321d0bd2f7cf0023a407e13df0c42c478d34" +#elif defined(OS_LINUX) +#define CEF_API_HASH_PLATFORM "e3e43a5d2801816451413dbe70dc361a615867c7" +#endif + +/// +// Returns the CEF build revision for the libcef library. +/// +CEF_EXPORT int cef_build_revision(); + +/// +// Returns CEF version information for the libcef library. The |entry| +// parameter describes which version component will be returned: +// 0 - CEF_VERSION_MAJOR +// 1 - CEF_REVISION +// 2 - CHROME_VERSION_MAJOR +// 3 - CHROME_VERSION_MINOR +// 4 - CHROME_VERSION_BUILD +// 5 - CHROME_VERSION_PATCH +/// +CEF_EXPORT int cef_version_info(int entry); + +/// +// Returns CEF API hashes for the libcef library. The returned string is owned +// by the library and should not be freed. The |entry| parameter describes which +// hash value will be returned: +// 0 - CEF_API_HASH_PLATFORM +// 1 - CEF_API_HASH_UNIVERSAL +/// +CEF_EXPORT const char* cef_api_hash(int entry); + +#ifdef __cplusplus +} +#endif + +#endif // APSTUDIO_HIDDEN_SYMBOLS + +#endif // CEF_INCLUDE_CEF_VERSION_H_ diff --git a/vendor/cef3/include/cef_web_plugin.h b/vendor/cef3/include/cef_web_plugin.h new file mode 100644 index 00000000000..0ff2b8ea100 --- /dev/null +++ b/vendor/cef3/include/cef_web_plugin.h @@ -0,0 +1,178 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_WEB_PLUGIN_H_ +#define CEF_INCLUDE_CEF_WEB_PLUGIN_H_ + +#include "include/cef_base.h" +#include "include/cef_browser.h" + +/// +// Information about a specific web plugin. +/// +/*--cef(source=library)--*/ +class CefWebPluginInfo : public virtual CefBase { + public: + /// + // Returns the plugin name (i.e. Flash). + /// + /*--cef()--*/ + virtual CefString GetName() =0; + + /// + // Returns the plugin file path (DLL/bundle/library). + /// + /*--cef()--*/ + virtual CefString GetPath() =0; + + /// + // Returns the version of the plugin (may be OS-specific). + /// + /*--cef()--*/ + virtual CefString GetVersion() =0; + + /// + // Returns a description of the plugin from the version information. + /// + /*--cef()--*/ + virtual CefString GetDescription() =0; +}; + +/// +// Interface to implement for visiting web plugin information. The methods of +// this class will be called on the browser process UI thread. +/// +/*--cef(source=client)--*/ +class CefWebPluginInfoVisitor : public virtual CefBase { + public: + /// + // Method that will be called once for each plugin. |count| is the 0-based + // index for the current plugin. |total| is the total number of plugins. + // Return false to stop visiting plugins. This method may never be called if + // no plugins are found. + /// + /*--cef()--*/ + virtual bool Visit(CefRefPtr info, int count, int total) =0; +}; + +/// +// Visit web plugin information. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefVisitWebPluginInfo(CefRefPtr visitor); + +/// +// Cause the plugin list to refresh the next time it is accessed regardless +// of whether it has already been loaded. Can be called on any thread in the +// browser process. +/// +/*--cef()--*/ +void CefRefreshWebPlugins(); + +/// +// Add a plugin path (directory + file). This change may not take affect until +// after CefRefreshWebPlugins() is called. Can be called on any thread in the +// browser process. +/// +/*--cef()--*/ +void CefAddWebPluginPath(const CefString& path); + +/// +// Add a plugin directory. This change may not take affect until after +// CefRefreshWebPlugins() is called. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefAddWebPluginDirectory(const CefString& dir); + +/// +// Remove a plugin path (directory + file). This change may not take affect +// until after CefRefreshWebPlugins() is called. Can be called on any thread in +// the browser process. +/// +/*--cef()--*/ +void CefRemoveWebPluginPath(const CefString& path); + +/// +// Unregister an internal plugin. This may be undone the next time +// CefRefreshWebPlugins() is called. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefUnregisterInternalWebPlugin(const CefString& path); + +/// +// Force a plugin to shutdown. Can be called on any thread in the browser +// process but will be executed on the IO thread. +/// +/*--cef()--*/ +void CefForceWebPluginShutdown(const CefString& path); + +/// +// Register a plugin crash. Can be called on any thread in the browser process +// but will be executed on the IO thread. +/// +/*--cef()--*/ +void CefRegisterWebPluginCrash(const CefString& path); + +/// +// Interface to implement for receiving unstable plugin information. The methods +// of this class will be called on the browser process IO thread. +/// +/*--cef(source=client)--*/ +class CefWebPluginUnstableCallback : public virtual CefBase { + public: + /// + // Method that will be called for the requested plugin. |unstable| will be + // true if the plugin has reached the crash count threshold of 3 times in 120 + // seconds. + /// + /*--cef()--*/ + virtual void IsUnstable(const CefString& path, + bool unstable) =0; +}; + +/// +// Query if a plugin is unstable. Can be called on any thread in the browser +// process. +/// +/*--cef()--*/ +void CefIsWebPluginUnstable(const CefString& path, + CefRefPtr callback); + + +#endif // CEF_INCLUDE_CEF_WEB_PLUGIN_H_ diff --git a/vendor/cef3/include/cef_xml_reader.h b/vendor/cef3/include/cef_xml_reader.h new file mode 100644 index 00000000000..86be8bac751 --- /dev/null +++ b/vendor/cef3/include/cef_xml_reader.h @@ -0,0 +1,268 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_XML_READER_H_ +#define CEF_INCLUDE_CEF_XML_READER_H_ +#pragma once + +#include "include/cef_base.h" +#include "include/cef_stream.h" + +/// +// Class that supports the reading of XML data via the libxml streaming API. +// The methods of this class should only be called on the thread that creates +// the object. +/// +/*--cef(source=library)--*/ +class CefXmlReader : public virtual CefBase { + public: + typedef cef_xml_encoding_type_t EncodingType; + typedef cef_xml_node_type_t NodeType; + + /// + // Create a new CefXmlReader object. The returned object's methods can only + // be called from the thread that created the object. + /// + /*--cef()--*/ + static CefRefPtr Create(CefRefPtr stream, + EncodingType encodingType, + const CefString& URI); + + /// + // Moves the cursor to the next node in the document. This method must be + // called at least once to set the current cursor position. Returns true if + // the cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToNextNode() =0; + + /// + // Close the document. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + /*--cef()--*/ + virtual bool Close() =0; + + /// + // Returns true if an error has been reported by the XML parser. + /// + /*--cef()--*/ + virtual bool HasError() =0; + + /// + // Returns the error string. + /// + /*--cef()--*/ + virtual CefString GetError() =0; + + + // The below methods retrieve data for the node at the current cursor + // position. + + /// + // Returns the node type. + /// + /*--cef(default_retval=XML_NODE_UNSUPPORTED)--*/ + virtual NodeType GetType() =0; + + /// + // Returns the node depth. Depth starts at 0 for the root node. + /// + /*--cef()--*/ + virtual int GetDepth() =0; + + /// + // Returns the local name. See + // http://www.w3.org/TR/REC-xml-names/#NT-LocalPart for additional details. + /// + /*--cef()--*/ + virtual CefString GetLocalName() =0; + + /// + // Returns the namespace prefix. See http://www.w3.org/TR/REC-xml-names/ for + // additional details. + /// + /*--cef()--*/ + virtual CefString GetPrefix() =0; + + /// + // Returns the qualified name, equal to (Prefix:)LocalName. See + // http://www.w3.org/TR/REC-xml-names/#ns-qualnames for additional details. + /// + /*--cef()--*/ + virtual CefString GetQualifiedName() =0; + + /// + // Returns the URI defining the namespace associated with the node. See + // http://www.w3.org/TR/REC-xml-names/ for additional details. + /// + /*--cef()--*/ + virtual CefString GetNamespaceURI() =0; + + /// + // Returns the base URI of the node. See http://www.w3.org/TR/xmlbase/ for + // additional details. + /// + /*--cef()--*/ + virtual CefString GetBaseURI() =0; + + /// + // Returns the xml:lang scope within which the node resides. See + // http://www.w3.org/TR/REC-xml/#sec-lang-tag for additional details. + /// + /*--cef()--*/ + virtual CefString GetXmlLang() =0; + + /// + // Returns true if the node represents an empty element. is considered + // empty but is not. + /// + /*--cef()--*/ + virtual bool IsEmptyElement() =0; + + /// + // Returns true if the node has a text value. + /// + /*--cef()--*/ + virtual bool HasValue() =0; + + /// + // Returns the text value. + /// + /*--cef()--*/ + virtual CefString GetValue() =0; + + /// + // Returns true if the node has attributes. + /// + /*--cef()--*/ + virtual bool HasAttributes() =0; + + /// + // Returns the number of attributes. + /// + /*--cef()--*/ + virtual size_t GetAttributeCount() =0; + + /// + // Returns the value of the attribute at the specified 0-based index. + /// + /*--cef(capi_name=get_attribute_byindex,index_param=index)--*/ + virtual CefString GetAttribute(int index) =0; + + /// + // Returns the value of the attribute with the specified qualified name. + /// + /*--cef(capi_name=get_attribute_byqname)--*/ + virtual CefString GetAttribute(const CefString& qualifiedName) =0; + + /// + // Returns the value of the attribute with the specified local name and + // namespace URI. + /// + /*--cef(capi_name=get_attribute_bylname)--*/ + virtual CefString GetAttribute(const CefString& localName, + const CefString& namespaceURI) =0; + + /// + // Returns an XML representation of the current node's children. + /// + /*--cef()--*/ + virtual CefString GetInnerXml() =0; + + /// + // Returns an XML representation of the current node including its children. + /// + /*--cef()--*/ + virtual CefString GetOuterXml() =0; + + /// + // Returns the line number for the current node. + /// + /*--cef()--*/ + virtual int GetLineNumber() =0; + + + // Attribute nodes are not traversed by default. The below methods can be + // used to move the cursor to an attribute node. MoveToCarryingElement() can + // be called afterwards to return the cursor to the carrying element. The + // depth of an attribute node will be 1 + the depth of the carrying element. + + /// + // Moves the cursor to the attribute at the specified 0-based index. Returns + // true if the cursor position was set successfully. + /// + /*--cef(capi_name=move_to_attribute_byindex,index_param=index)--*/ + virtual bool MoveToAttribute(int index) =0; + + /// + // Moves the cursor to the attribute with the specified qualified name. + // Returns true if the cursor position was set successfully. + /// + /*--cef(capi_name=move_to_attribute_byqname)--*/ + virtual bool MoveToAttribute(const CefString& qualifiedName) =0; + + /// + // Moves the cursor to the attribute with the specified local name and + // namespace URI. Returns true if the cursor position was set successfully. + /// + /*--cef(capi_name=move_to_attribute_bylname)--*/ + virtual bool MoveToAttribute(const CefString& localName, + const CefString& namespaceURI) =0; + + /// + // Moves the cursor to the first attribute in the current element. Returns + // true if the cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToFirstAttribute() =0; + + /// + // Moves the cursor to the next attribute in the current element. Returns + // true if the cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToNextAttribute() =0; + + /// + // Moves the cursor back to the carrying element. Returns true if the cursor + // position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToCarryingElement() =0; +}; + +#endif // CEF_INCLUDE_CEF_XML_READER_H_ diff --git a/vendor/cef3/include/cef_zip_reader.h b/vendor/cef3/include/cef_zip_reader.h new file mode 100644 index 00000000000..1fe02b91623 --- /dev/null +++ b/vendor/cef3/include/cef_zip_reader.h @@ -0,0 +1,141 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file must follow a specific format in order to +// support the CEF translator tool. See the translator.README.txt file in the +// tools directory for more information. +// + +#ifndef CEF_INCLUDE_CEF_ZIP_READER_H_ +#define CEF_INCLUDE_CEF_ZIP_READER_H_ + +#include "include/cef_base.h" +#include "include/cef_stream.h" + +/// +// Class that supports the reading of zip archives via the zlib unzip API. +// The methods of this class should only be called on the thread that creates +// the object. +/// +/*--cef(source=library)--*/ +class CefZipReader : public virtual CefBase { + public: + /// + // Create a new CefZipReader object. The returned object's methods can only + // be called from the thread that created the object. + /// + /*--cef()--*/ + static CefRefPtr Create(CefRefPtr stream); + + /// + // Moves the cursor to the first file in the archive. Returns true if the + // cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToFirstFile() =0; + + /// + // Moves the cursor to the next file in the archive. Returns true if the + // cursor position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToNextFile() =0; + + /// + // Moves the cursor to the specified file in the archive. If |caseSensitive| + // is true then the search will be case sensitive. Returns true if the cursor + // position was set successfully. + /// + /*--cef()--*/ + virtual bool MoveToFile(const CefString& fileName, bool caseSensitive) =0; + + /// + // Closes the archive. This should be called directly to ensure that cleanup + // occurs on the correct thread. + /// + /*--cef()--*/ + virtual bool Close() =0; + + + // The below methods act on the file at the current cursor position. + + /// + // Returns the name of the file. + /// + /*--cef()--*/ + virtual CefString GetFileName() =0; + + /// + // Returns the uncompressed size of the file. + /// + /*--cef()--*/ + virtual int64 GetFileSize() =0; + + /// + // Returns the last modified timestamp for the file. + /// + /*--cef()--*/ + virtual time_t GetFileLastModified() =0; + + /// + // Opens the file for reading of uncompressed data. A read password may + // optionally be specified. + /// + /*--cef(optional_param=password)--*/ + virtual bool OpenFile(const CefString& password) =0; + + /// + // Closes the file. + /// + /*--cef()--*/ + virtual bool CloseFile() =0; + + /// + // Read uncompressed file contents into the specified buffer. Returns < 0 if + // an error occurred, 0 if at the end of file, or the number of bytes read. + /// + /*--cef()--*/ + virtual int ReadFile(void* buffer, size_t bufferSize) =0; + + /// + // Returns the current offset in the uncompressed file contents. + /// + /*--cef()--*/ + virtual int64 Tell() =0; + + /// + // Returns true if at end of the file contents. + /// + /*--cef()--*/ + virtual bool Eof() =0; +}; + +#endif // CEF_INCLUDE_CEF_ZIP_READER_H_ diff --git a/vendor/cef3/include/internal/cef_export.h b/vendor/cef3/include/internal/cef_export.h new file mode 100644 index 00000000000..2813253b6d4 --- /dev/null +++ b/vendor/cef3/include/internal/cef_export.h @@ -0,0 +1,55 @@ +// Copyright (c) 2009 The Chromium Embedded Framework Authors. All rights +// reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ +#define CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ +#pragma once + +#include "include/base/cef_build.h" + +#if defined(COMPILER_MSVC) + +#ifdef BUILDING_CEF_SHARED +#define CEF_EXPORT __declspec(dllexport) +#elif USING_CEF_SHARED +#define CEF_EXPORT __declspec(dllimport) +#else +#define CEF_EXPORT +#endif +#define CEF_CALLBACK __stdcall + +#elif defined(COMPILER_GCC) + +#define CEF_EXPORT __attribute__ ((visibility("default"))) +#define CEF_CALLBACK + +#endif // COMPILER_GCC + +#endif // CEF_INCLUDE_INTERNAL_CEF_EXPORT_H_ diff --git a/vendor/cef3/include/internal/cef_logging_internal.h b/vendor/cef3/include/internal/cef_logging_internal.h new file mode 100644 index 00000000000..c376d052698 --- /dev/null +++ b/vendor/cef3/include/internal/cef_logging_internal.h @@ -0,0 +1,66 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_LOGGING_INTERNAL_H_ +#define CEF_INCLUDE_INTERNAL_CEF_LOGGING_INTERNAL_H_ +#pragma once + +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// See include/base/cef_logging.h for macros and intended usage. + +/// +// Gets the current log level. +/// +CEF_EXPORT int cef_get_min_log_level(); + +/// +// Gets the current vlog level for the given file (usually taken from +// __FILE__). Note that |N| is the size *with* the null terminator. +/// +CEF_EXPORT int cef_get_vlog_level(const char* file_start, size_t N); + +/// +// Add a log message. See the LogSeverity defines for supported |severity| +// values. +/// +CEF_EXPORT void cef_log(const char* file, + int line, + int severity, + const char* message); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // CEF_INCLUDE_INTERNAL_CEF_LOGGING_INTERNAL_H_ diff --git a/vendor/cef3/include/internal/cef_ptr.h b/vendor/cef3/include/internal/cef_ptr.h new file mode 100644 index 00000000000..e385439114b --- /dev/null +++ b/vendor/cef3/include/internal/cef_ptr.h @@ -0,0 +1,161 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_PTR_H_ +#define CEF_INCLUDE_INTERNAL_CEF_PTR_H_ +#pragma once + +#include "include/base/cef_ref_counted.h" + +/// +// Smart pointer implementation that is an alias of scoped_refptr from +// include/base/cef_ref_counted.h. +//

+// A smart pointer class for reference counted objects. Use this class instead +// of calling AddRef and Release manually on a reference counted object to +// avoid common memory leaks caused by forgetting to Release an object +// reference. Sample usage: +//

+//   class MyFoo : public CefBase {
+//    ...
+//   };
+//
+//   void some_function() {
+//     // The MyFoo object that |foo| represents starts with a single
+//     // reference.
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//     foo->Method(param);
+//     // |foo| is released when this function returns
+//   }
+//
+//   void some_other_function() {
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//     ...
+//     foo = NULL;  // explicitly releases |foo|
+//     ...
+//     if (foo)
+//       foo->Method(param);
+//   }
+// 
+// The above examples show how CefRefPtr<T> acts like a pointer to T. +// Given two CefRefPtr<T> classes, it is also possible to exchange +// references between the two objects, like so: +//
+//   {
+//     CefRefPtr<MyFoo> a = new MyFoo();
+//     CefRefPtr<MyFoo> b;
+//
+//     b.swap(a);
+//     // now, |b| references the MyFoo object, and |a| references NULL.
+//   }
+// 
+// To make both |a| and |b| in the above example reference the same MyFoo +// object, simply use the assignment operator: +//
+//   {
+//     CefRefPtr<MyFoo> a = new MyFoo();
+//     CefRefPtr<MyFoo> b;
+//
+//     b = a;
+//     // now, |a| and |b| each own a reference to the same MyFoo object.
+//     // the reference count of the underlying MyFoo object will be 2.
+//   }
+// 
+// Reference counted objects can also be passed as function parameters and +// used as function return values: +//
+//   void some_func_with_param(CefRefPtr<MyFoo> param) {
+//     // A reference is added to the MyFoo object that |param| represents
+//     // during the scope of some_func_with_param() and released when
+//     // some_func_with_param() goes out of scope.
+//   }
+//
+//   CefRefPtr<MyFoo> some_func_with_retval() {
+//     // The MyFoo object that |foox| represents starts with a single
+//     // reference.
+//     CefRefPtr<MyFoo> foox = new MyFoo();
+//
+//     // Creating the return value adds an additional reference.
+//     return foox;
+//
+//     // When some_func_with_retval() goes out of scope the original |foox|
+//     // reference is released.
+//   }
+//
+//   void and_another_function() {
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//
+//     // pass |foo| as a parameter.
+//     some_function(foo);
+//
+//     CefRefPtr<MyFoo> foo2 = some_func_with_retval();
+//     // Now, since we kept a reference to the some_func_with_retval() return
+//     // value, |foo2| is the only class pointing to the MyFoo object created
+//     in some_func_with_retval(), and it has a reference count of 1.
+//
+//     some_func_with_retval();
+//     // Now, since we didn't keep a reference to the some_func_with_retval()
+//     // return value, the MyFoo object created in some_func_with_retval()
+//     // will automatically be released.
+//   }
+// 
+// And in standard containers: +//
+//   {
+//      // Create a vector that holds MyFoo objects.
+//      std::vector<CefRefPtr<MyFoo> > MyFooVec;
+//
+//     // The MyFoo object that |foo| represents starts with a single
+//     // reference.
+//     CefRefPtr<MyFoo> foo = new MyFoo();
+//
+//     // When the MyFoo object is added to |MyFooVec| the reference count
+//     // is increased to 2.
+//     MyFooVec.push_back(foo);
+//   }
+// 
+//

+/// +template +class CefRefPtr : public scoped_refptr { + public: + typedef scoped_refptr parent; + + CefRefPtr() : parent() {} + + CefRefPtr(T* p) : parent(p) {} + + CefRefPtr(const scoped_refptr& r) : parent(r) {} + + template + CefRefPtr(const scoped_refptr& r) : parent(r) {} +}; + +#endif // CEF_INCLUDE_INTERNAL_CEF_PTR_H_ diff --git a/vendor/cef3/include/internal/cef_string.h b/vendor/cef3/include/internal/cef_string.h new file mode 100644 index 00000000000..a7876fe56df --- /dev/null +++ b/vendor/cef3/include/internal/cef_string.h @@ -0,0 +1,113 @@ +// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_H_ +#pragma once + +// The CEF interface is built with one string type as the default. Comment out +// all but one of the CEF_STRING_TYPE_* defines below to specify the default. +// If you change the default you MUST recompile all of CEF. + +// Build with the UTF8 string type as default. +// #define CEF_STRING_TYPE_UTF8 1 + +// Build with the UTF16 string type as default. +#define CEF_STRING_TYPE_UTF16 1 + +// Build with the wide string type as default. +// #define CEF_STRING_TYPE_WIDE 1 + + +#include "include/internal/cef_string_types.h" + +#ifdef __cplusplus +#include "include/internal/cef_string_wrappers.h" +#if defined(CEF_STRING_TYPE_UTF16) +typedef CefStringUTF16 CefString; +#elif defined(CEF_STRING_TYPE_UTF8) +typedef CefStringUTF8 CefString; +#elif defined(CEF_STRING_TYPE_WIDE) +typedef CefStringWide CefString; +#endif +#endif // __cplusplus + +#if defined(CEF_STRING_TYPE_UTF8) +typedef char cef_char_t; +typedef cef_string_utf8_t cef_string_t; +typedef cef_string_userfree_utf8_t cef_string_userfree_t; +#define cef_string_set cef_string_utf8_set +#define cef_string_copy cef_string_utf8_copy +#define cef_string_clear cef_string_utf8_clear +#define cef_string_userfree_alloc cef_string_userfree_utf8_alloc +#define cef_string_userfree_free cef_string_userfree_utf8_free +#define cef_string_from_ascii cef_string_utf8_copy +#define cef_string_to_utf8 cef_string_utf8_copy +#define cef_string_from_utf8 cef_string_utf8_copy +#define cef_string_to_utf16 cef_string_utf8_to_utf16 +#define cef_string_from_utf16 cef_string_utf16_to_utf8 +#define cef_string_to_wide cef_string_utf8_to_wide +#define cef_string_from_wide cef_string_wide_to_utf8 +#elif defined(CEF_STRING_TYPE_UTF16) +typedef char16 cef_char_t; +typedef cef_string_userfree_utf16_t cef_string_userfree_t; +typedef cef_string_utf16_t cef_string_t; +#define cef_string_set cef_string_utf16_set +#define cef_string_copy cef_string_utf16_copy +#define cef_string_clear cef_string_utf16_clear +#define cef_string_userfree_alloc cef_string_userfree_utf16_alloc +#define cef_string_userfree_free cef_string_userfree_utf16_free +#define cef_string_from_ascii cef_string_ascii_to_utf16 +#define cef_string_to_utf8 cef_string_utf16_to_utf8 +#define cef_string_from_utf8 cef_string_utf8_to_utf16 +#define cef_string_to_utf16 cef_string_utf16_copy +#define cef_string_from_utf16 cef_string_utf16_copy +#define cef_string_to_wide cef_string_utf16_to_wide +#define cef_string_from_wide cef_string_wide_to_utf16 +#elif defined(CEF_STRING_TYPE_WIDE) +typedef wchar_t cef_char_t; +typedef cef_string_wide_t cef_string_t; +typedef cef_string_userfree_wide_t cef_string_userfree_t; +#define cef_string_set cef_string_wide_set +#define cef_string_copy cef_string_wide_copy +#define cef_string_clear cef_string_wide_clear +#define cef_string_userfree_alloc cef_string_userfree_wide_alloc +#define cef_string_userfree_free cef_string_userfree_wide_free +#define cef_string_from_ascii cef_string_ascii_to_wide +#define cef_string_to_utf8 cef_string_wide_to_utf8 +#define cef_string_from_utf8 cef_string_utf8_to_wide +#define cef_string_to_utf16 cef_string_wide_to_utf16 +#define cef_string_from_utf16 cef_string_utf16_to_wide +#define cef_string_to_wide cef_string_wide_copy +#define cef_string_from_wide cef_string_wide_copy +#else +#error Please choose a string type. +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_H_ diff --git a/vendor/cef3/include/internal/cef_string_list.h b/vendor/cef3/include/internal/cef_string_list.h new file mode 100644 index 00000000000..52a0abf2fbd --- /dev/null +++ b/vendor/cef3/include/internal/cef_string_list.h @@ -0,0 +1,88 @@ +// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// CEF string maps are a set of key/value string pairs. +/// +typedef void* cef_string_list_t; + +/// +// Allocate a new string map. +/// +CEF_EXPORT cef_string_list_t cef_string_list_alloc(); + +/// +// Return the number of elements in the string list. +/// +CEF_EXPORT int cef_string_list_size(cef_string_list_t list); + +/// +// Retrieve the value at the specified zero-based string list index. Returns +// true (1) if the value was successfully retrieved. +/// +CEF_EXPORT int cef_string_list_value(cef_string_list_t list, + int index, cef_string_t* value); + +/// +// Append a new value at the end of the string list. +/// +CEF_EXPORT void cef_string_list_append(cef_string_list_t list, + const cef_string_t* value); + +/// +// Clear the string list. +/// +CEF_EXPORT void cef_string_list_clear(cef_string_list_t list); + +/// +// Free the string list. +/// +CEF_EXPORT void cef_string_list_free(cef_string_list_t list); + +/// +// Creates a copy of an existing string list. +/// +CEF_EXPORT cef_string_list_t cef_string_list_copy(cef_string_list_t list); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_LIST_H_ diff --git a/vendor/cef3/include/internal/cef_string_map.h b/vendor/cef3/include/internal/cef_string_map.h new file mode 100644 index 00000000000..93eea2a5509 --- /dev/null +++ b/vendor/cef3/include/internal/cef_string_map.h @@ -0,0 +1,97 @@ +// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// CEF string maps are a set of key/value string pairs. +/// +typedef void* cef_string_map_t; + +/// +// Allocate a new string map. +/// +CEF_EXPORT cef_string_map_t cef_string_map_alloc(); + +/// +// Return the number of elements in the string map. +/// +CEF_EXPORT int cef_string_map_size(cef_string_map_t map); + +/// +// Return the value assigned to the specified key. +/// +CEF_EXPORT int cef_string_map_find(cef_string_map_t map, + const cef_string_t* key, + cef_string_t* value); + +/// +// Return the key at the specified zero-based string map index. +/// +CEF_EXPORT int cef_string_map_key(cef_string_map_t map, int index, + cef_string_t* key); + +/// +// Return the value at the specified zero-based string map index. +/// +CEF_EXPORT int cef_string_map_value(cef_string_map_t map, int index, + cef_string_t* value); + +/// +// Append a new key/value pair at the end of the string map. +/// +CEF_EXPORT int cef_string_map_append(cef_string_map_t map, + const cef_string_t* key, + const cef_string_t* value); + +/// +// Clear the string map. +/// +CEF_EXPORT void cef_string_map_clear(cef_string_map_t map); + +/// +// Free the string map. +/// +CEF_EXPORT void cef_string_map_free(cef_string_map_t map); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MAP_H_ diff --git a/vendor/cef3/include/internal/cef_string_multimap.h b/vendor/cef3/include/internal/cef_string_multimap.h new file mode 100644 index 00000000000..cd390424454 --- /dev/null +++ b/vendor/cef3/include/internal/cef_string_multimap.h @@ -0,0 +1,105 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_string.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// CEF string multimaps are a set of key/value string pairs. +// More than one value can be assigned to a single key. +/// +typedef void* cef_string_multimap_t; + +/// +// Allocate a new string multimap. +/// +CEF_EXPORT cef_string_multimap_t cef_string_multimap_alloc(); + +/// +// Return the number of elements in the string multimap. +/// +CEF_EXPORT int cef_string_multimap_size(cef_string_multimap_t map); + +/// +// Return the number of values with the specified key. +/// +CEF_EXPORT int cef_string_multimap_find_count(cef_string_multimap_t map, + const cef_string_t* key); + +/// +// Return the value_index-th value with the specified key. +/// +CEF_EXPORT int cef_string_multimap_enumerate(cef_string_multimap_t map, + const cef_string_t* key, + int value_index, + cef_string_t* value); + +/// +// Return the key at the specified zero-based string multimap index. +/// +CEF_EXPORT int cef_string_multimap_key(cef_string_multimap_t map, int index, + cef_string_t* key); + +/// +// Return the value at the specified zero-based string multimap index. +/// +CEF_EXPORT int cef_string_multimap_value(cef_string_multimap_t map, int index, + cef_string_t* value); + +/// +// Append a new key/value pair at the end of the string multimap. +/// +CEF_EXPORT int cef_string_multimap_append(cef_string_multimap_t map, + const cef_string_t* key, + const cef_string_t* value); + +/// +// Clear the string multimap. +/// +CEF_EXPORT void cef_string_multimap_clear(cef_string_multimap_t map); + +/// +// Free the string multimap. +/// +CEF_EXPORT void cef_string_multimap_free(cef_string_multimap_t map); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_MULTIMAP_H_ diff --git a/vendor/cef3/include/internal/cef_string_types.h b/vendor/cef3/include/internal/cef_string_types.h new file mode 100644 index 00000000000..493dc7e65eb --- /dev/null +++ b/vendor/cef3/include/internal/cef_string_types.h @@ -0,0 +1,205 @@ +// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_ +#pragma once + +// CEF provides functions for converting between UTF-8, -16 and -32 strings. +// CEF string types are safe for reading from multiple threads but not for +// modification. It is the user's responsibility to provide synchronization if +// modifying CEF strings from multiple threads. + +#include + +#include "include/base/cef_build.h" +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// CEF character type definitions. wchar_t is 2 bytes on Windows and 4 bytes on +// most other platforms. + +#if defined(OS_WIN) +typedef wchar_t char16; +#else // !OS_WIN +typedef unsigned short char16; // NOLINT (runtime/int) +#ifndef WCHAR_T_IS_UTF32 +#define WCHAR_T_IS_UTF32 +#endif // WCHAR_T_IS_UTF32 +#endif // !OS_WIN + + +// CEF string type definitions. Whomever allocates |str| is responsible for +// providing an appropriate |dtor| implementation that will free the string in +// the same memory space. When reusing an existing string structure make sure +// to call |dtor| for the old value before assigning new |str| and |dtor| +// values. Static strings will have a NULL |dtor| value. Using the below +// functions if you want this managed for you. + +typedef struct _cef_string_wide_t { + wchar_t* str; + size_t length; + void (*dtor)(wchar_t* str); +} cef_string_wide_t; + +typedef struct _cef_string_utf8_t { + char* str; + size_t length; + void (*dtor)(char* str); +} cef_string_utf8_t; + +typedef struct _cef_string_utf16_t { + char16* str; + size_t length; + void (*dtor)(char16* str); +} cef_string_utf16_t; + + +/// +// These functions set string values. If |copy| is true (1) the value will be +// copied instead of referenced. It is up to the user to properly manage +// the lifespan of references. +/// + +CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, + cef_string_wide_t* output, int copy); +CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, + cef_string_utf8_t* output, int copy); +CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, + cef_string_utf16_t* output, int copy); + + +/// +// Convenience macros for copying values. +/// + +#define cef_string_wide_copy(src, src_len, output) \ + cef_string_wide_set(src, src_len, output, true) +#define cef_string_utf8_copy(src, src_len, output) \ + cef_string_utf8_set(src, src_len, output, true) +#define cef_string_utf16_copy(src, src_len, output) \ + cef_string_utf16_set(src, src_len, output, true) + + +/// +// These functions clear string values. The structure itself is not freed. +/// + +CEF_EXPORT void cef_string_wide_clear(cef_string_wide_t* str); +CEF_EXPORT void cef_string_utf8_clear(cef_string_utf8_t* str); +CEF_EXPORT void cef_string_utf16_clear(cef_string_utf16_t* str); + + +/// +// These functions compare two string values with the same results as strcmp(). +/// + +CEF_EXPORT int cef_string_wide_cmp(const cef_string_wide_t* str1, + const cef_string_wide_t* str2); +CEF_EXPORT int cef_string_utf8_cmp(const cef_string_utf8_t* str1, + const cef_string_utf8_t* str2); +CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1, + const cef_string_utf16_t* str2); + + +/// +// These functions convert between UTF-8, -16, and -32 strings. They are +// potentially slow so unnecessary conversions should be avoided. The best +// possible result will always be written to |output| with the boolean return +// value indicating whether the conversion is 100% valid. +/// + +CEF_EXPORT int cef_string_wide_to_utf8(const wchar_t* src, size_t src_len, + cef_string_utf8_t* output); +CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, + cef_string_wide_t* output); + +CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, + cef_string_utf16_t* output); +CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, + cef_string_wide_t* output); + +CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, + cef_string_utf16_t* output); +CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, + cef_string_utf8_t* output); + + +/// +// These functions convert an ASCII string, typically a hardcoded constant, to a +// Wide/UTF16 string. Use instead of the UTF8 conversion routines if you know +// the string is ASCII. +/// + +CEF_EXPORT int cef_string_ascii_to_wide(const char* src, size_t src_len, + cef_string_wide_t* output); +CEF_EXPORT int cef_string_ascii_to_utf16(const char* src, size_t src_len, + cef_string_utf16_t* output); + + + +/// +// It is sometimes necessary for the system to allocate string structures with +// the expectation that the user will free them. The userfree types act as a +// hint that the user is responsible for freeing the structure. +/// + +typedef cef_string_wide_t* cef_string_userfree_wide_t; +typedef cef_string_utf8_t* cef_string_userfree_utf8_t; +typedef cef_string_utf16_t* cef_string_userfree_utf16_t; + + +/// +// These functions allocate a new string structure. They must be freed by +// calling the associated free function. +/// + +CEF_EXPORT cef_string_userfree_wide_t cef_string_userfree_wide_alloc(); +CEF_EXPORT cef_string_userfree_utf8_t cef_string_userfree_utf8_alloc(); +CEF_EXPORT cef_string_userfree_utf16_t cef_string_userfree_utf16_alloc(); + + +/// +// These functions free the string structure allocated by the associated +// alloc function. Any string contents will first be cleared. +/// + +CEF_EXPORT void cef_string_userfree_wide_free(cef_string_userfree_wide_t str); +CEF_EXPORT void cef_string_userfree_utf8_free(cef_string_userfree_utf8_t str); +CEF_EXPORT void cef_string_userfree_utf16_free(cef_string_userfree_utf16_t str); + + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_TYPES_H_ diff --git a/vendor/cef3/include/internal/cef_string_wrappers.h b/vendor/cef3/include/internal/cef_string_wrappers.h new file mode 100644 index 00000000000..060c3c89fb8 --- /dev/null +++ b/vendor/cef3/include/internal/cef_string_wrappers.h @@ -0,0 +1,715 @@ +// Copyright (c) 2010 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_ +#define CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_ +#pragma once + +#include +#include + +#include "include/base/cef_string16.h" +#include "include/internal/cef_string_types.h" + +/// +// Traits implementation for wide character strings. +/// +struct CefStringTraitsWide { + typedef wchar_t char_type; + typedef cef_string_wide_t struct_type; + typedef cef_string_userfree_wide_t userfree_struct_type; + + static inline void clear(struct_type *s) { cef_string_wide_clear(s); } + static inline int set(const char_type* src, size_t src_size, + struct_type* output, int copy) { + return cef_string_wide_set(src, src_size, output, copy); + } + static inline int compare(const struct_type* s1, const struct_type* s2) { + return cef_string_wide_cmp(s1, s2); + } + static inline userfree_struct_type userfree_alloc() { + return cef_string_userfree_wide_alloc(); + } + static inline void userfree_free(userfree_struct_type ufs) { + return cef_string_userfree_wide_free(ufs); + } + + // Conversion methods. + static inline bool from_ascii(const char* str, size_t len, struct_type *s) { + return cef_string_ascii_to_wide(str, len, s) ? true : false; + } + static inline std::string to_string(const struct_type *s) { + cef_string_utf8_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_wide_to_utf8(s->str, s->length, &cstr); + std::string str; + if (cstr.length > 0) + str = std::string(cstr.str, cstr.length); + cef_string_utf8_clear(&cstr); + return str; + } + static inline bool from_string(const std::string& str, struct_type *s) { + return cef_string_utf8_to_wide(str.c_str(), str.length(), s) ? true : false; + } + static inline std::wstring to_wstring(const struct_type *s) { + return std::wstring(s->str, s->length); + } + static inline bool from_wstring(const std::wstring& str, struct_type *s) { + return cef_string_wide_set(str.c_str(), str.length(), s, true) ? + true : false; + } +#if defined(WCHAR_T_IS_UTF32) + static inline base::string16 to_string16(const struct_type *s) { + cef_string_utf16_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_wide_to_utf16(s->str, s->length, &cstr); + base::string16 str; + if (cstr.length > 0) + str = base::string16(cstr.str, cstr.length); + cef_string_utf16_clear(&cstr); + return str; + } + static inline bool from_string16(const base::string16& str, + struct_type *s) { + return cef_string_utf16_to_wide(str.c_str(), str.length(), s) ? + true : false; + } +#else // WCHAR_T_IS_UTF32 + static inline base::string16 to_string16(const struct_type *s) { + return base::string16(s->str, s->length); + } + static inline bool from_string16(const base::string16& str, struct_type *s) { + return cef_string_wide_set(str.c_str(), str.length(), s, true) ? + true : false; + } +#endif // WCHAR_T_IS_UTF32 +}; + +/// +// Traits implementation for utf8 character strings. +/// +struct CefStringTraitsUTF8 { + typedef char char_type; + typedef cef_string_utf8_t struct_type; + typedef cef_string_userfree_utf8_t userfree_struct_type; + + static inline void clear(struct_type *s) { cef_string_utf8_clear(s); } + static inline int set(const char_type* src, size_t src_size, + struct_type* output, int copy) { + return cef_string_utf8_set(src, src_size, output, copy); + } + static inline int compare(const struct_type* s1, const struct_type* s2) { + return cef_string_utf8_cmp(s1, s2); + } + static inline userfree_struct_type userfree_alloc() { + return cef_string_userfree_utf8_alloc(); + } + static inline void userfree_free(userfree_struct_type ufs) { + return cef_string_userfree_utf8_free(ufs); + } + + // Conversion methods. + static inline bool from_ascii(const char* str, size_t len, struct_type* s) { + return cef_string_utf8_copy(str, len, s) ? true : false; + } + static inline std::string to_string(const struct_type* s) { + return std::string(s->str, s->length); + } + static inline bool from_string(const std::string& str, struct_type* s) { + return cef_string_utf8_copy(str.c_str(), str.length(), s) ? true : false; + } + static inline std::wstring to_wstring(const struct_type* s) { + cef_string_wide_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf8_to_wide(s->str, s->length, &cstr); + std::wstring str; + if (cstr.length > 0) + str = std::wstring(cstr.str, cstr.length); + cef_string_wide_clear(&cstr); + return str; + } + static inline bool from_wstring(const std::wstring& str, struct_type* s) { + return cef_string_wide_to_utf8(str.c_str(), str.length(), s) ? true : false; + } + static inline base::string16 to_string16(const struct_type* s) { + cef_string_utf16_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf8_to_utf16(s->str, s->length, &cstr); + base::string16 str; + if (cstr.length > 0) + str = base::string16(cstr.str, cstr.length); + cef_string_utf16_clear(&cstr); + return str; + } + static inline bool from_string16(const base::string16& str, struct_type* s) { + return cef_string_utf16_to_utf8(str.c_str(), str.length(), s) ? + true : false; + } +}; + +/// +// Traits implementation for utf16 character strings. +/// +struct CefStringTraitsUTF16 { + typedef char16 char_type; + typedef cef_string_utf16_t struct_type; + typedef cef_string_userfree_utf16_t userfree_struct_type; + + static inline void clear(struct_type *s) { cef_string_utf16_clear(s); } + static inline int set(const char_type* src, size_t src_size, + struct_type* output, int copy) { + return cef_string_utf16_set(src, src_size, output, copy); + } + static inline int compare(const struct_type* s1, const struct_type* s2) { + return cef_string_utf16_cmp(s1, s2); + } + static inline userfree_struct_type userfree_alloc() { + return cef_string_userfree_utf16_alloc(); + } + static inline void userfree_free(userfree_struct_type ufs) { + return cef_string_userfree_utf16_free(ufs); + } + + // Conversion methods. + static inline bool from_ascii(const char* str, size_t len, struct_type* s) { + return cef_string_ascii_to_utf16(str, len, s) ? true : false; + } + static inline std::string to_string(const struct_type* s) { + cef_string_utf8_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf16_to_utf8(s->str, s->length, &cstr); + std::string str; + if (cstr.length > 0) + str = std::string(cstr.str, cstr.length); + cef_string_utf8_clear(&cstr); + return str; + } + static inline bool from_string(const std::string& str, struct_type* s) { + return cef_string_utf8_to_utf16(str.c_str(), str.length(), s) ? + true : false; + } +#if defined(WCHAR_T_IS_UTF32) + static inline std::wstring to_wstring(const struct_type* s) { + cef_string_wide_t cstr; + memset(&cstr, 0, sizeof(cstr)); + cef_string_utf16_to_wide(s->str, s->length, &cstr); + std::wstring str; + if (cstr.length > 0) + str = std::wstring(cstr.str, cstr.length); + cef_string_wide_clear(&cstr); + return str; + } + static inline bool from_wstring(const std::wstring& str, struct_type* s) { + return cef_string_wide_to_utf16(str.c_str(), str.length(), s) ? + true : false; + } +#else // WCHAR_T_IS_UTF32 + static inline std::wstring to_wstring(const struct_type* s) { + return std::wstring(s->str, s->length); + } + static inline bool from_wstring(const std::wstring& str, struct_type* s) { + return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? + true : false; + } +#endif // WCHAR_T_IS_UTF32 + static inline base::string16 to_string16(const struct_type* s) { + return base::string16(s->str, s->length); + } + static inline bool from_string16(const base::string16& str, struct_type* s) { + return cef_string_utf16_set(str.c_str(), str.length(), s, true) ? + true : false; + } +}; + +/// +// CEF string classes can convert between all supported string types. For +// example, the CefStringWide class uses wchar_t as the underlying character +// type and provides two approaches for converting data to/from a UTF8 string +// (std::string). +//

+// 1. Implicit conversion using the assignment operator overload. +//

+//   CefStringWide aCefString;
+//   std::string aUTF8String;
+//   aCefString = aUTF8String; // Assign std::string to CefStringWide
+//   aUTF8String = aCefString; // Assign CefStringWide to std::string
+// 
+// 2. Explicit conversion using the FromString/ToString methods. +//
+//   CefStringWide aCefString;
+//   std::string aUTF8String;
+//   aCefString.FromString(aUTF8String); // Assign std::string to CefStringWide
+//   aUTF8String = aCefString.ToString(); // Assign CefStringWide to std::string
+// 
+// Conversion will only occur if the assigned value is a different string type. +// Assigning a std::string to a CefStringUTF8, for example, will copy the data +// without performing a conversion. +//

+// CEF string classes are safe for reading from multiple threads but not for +// modification. It is the user's responsibility to provide synchronization if +// modifying CEF strings from multiple threads. +/// +template +class CefStringBase { + public: + typedef typename traits::char_type char_type; + typedef typename traits::struct_type struct_type; + typedef typename traits::userfree_struct_type userfree_struct_type; + + /// + // Default constructor. + /// + CefStringBase() : string_(NULL), owner_(false) {} + + /// + // Create a new string from an existing string. Data will always be copied. + /// + CefStringBase(const CefStringBase& str) + : string_(NULL), owner_(false) { + FromString(str.c_str(), str.length(), true); + } + + /// + // Create a new string from an existing std::string. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + CefStringBase(const std::string& src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + FromString(src); + } + CefStringBase(const char* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (src) + FromString(std::string(src)); + } + + /// + // Create a new string from an existing std::wstring. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + CefStringBase(const std::wstring& src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + FromWString(src); + } + CefStringBase(const wchar_t* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (src) + FromWString(std::wstring(src)); + } + +#if defined(WCHAR_T_IS_UTF32) + /// + // Create a new string from an existing string16. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + CefStringBase(const base::string16& src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + FromString16(src); + } + CefStringBase(const char16* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (src) + FromString16(base::string16(src)); + } +#endif // WCHAR_T_IS_UTF32 + + /// + // Create a new string from an existing character array. If |copy| is true + // this class will copy the data. Otherwise, this class will reference the + // existing data. Referenced data must exist for the lifetime of this class + // and will not be freed by this class. + /// + CefStringBase(const char_type* src, size_t src_len, bool copy) + : string_(NULL), owner_(false) { + if (src && src_len > 0) + FromString(src, src_len, copy); + } + + /// + // Create a new string referencing an existing string structure without taking + // ownership. Referenced structures must exist for the lifetime of this class + // and will not be freed by this class. + /// + CefStringBase(const struct_type* src) // NOLINT(runtime/explicit) + : string_(NULL), owner_(false) { + if (!src) + return; + // Reference the existing structure without taking ownership. + Attach(const_cast(src), false); + } + + virtual ~CefStringBase() { ClearAndFree(); } + + + // The following methods are named for compatibility with the standard library + // string template types. + + /// + // Return a read-only pointer to the string data. + /// + const char_type* c_str() const { return (string_ ? string_->str : NULL); } + + /// + // Return the length of the string data. + /// + size_t length() const { return (string_ ? string_->length : 0); } + + /// + // Return the length of the string data. + /// + inline size_t size() const { return length(); } + + /// + // Returns true if the string is empty. + /// + bool empty() const { return (string_ == NULL || string_->length == 0); } + + /// + // Compare this string to the specified string. + /// + int compare(const CefStringBase& str) const { + if (empty() && str.empty()) + return 0; + if (empty()) + return -1; + if (str.empty()) + return 1; + return traits::compare(string_, str.GetStruct()); + } + + /// + // Clear the string data. + /// + void clear() { + if (string_) + traits::clear(string_); + } + + /// + // Swap this string's contents with the specified string. + /// + void swap(CefStringBase& str) { + struct_type* tmp_string = string_; + bool tmp_owner = owner_; + string_ = str.string_; + owner_ = str.owner_; + str.string_ = tmp_string; + str.owner_ = tmp_owner; + } + + + // The following methods are unique to CEF string template types. + + /// + // Returns true if this class owns the underlying string structure. + /// + bool IsOwner() const { return owner_; } + + /// + // Returns a read-only pointer to the underlying string structure. May return + // NULL if no structure is currently allocated. + /// + const struct_type* GetStruct() const { return string_; } + + /// + // Returns a writable pointer to the underlying string structure. Will never + // return NULL. + /// + struct_type* GetWritableStruct() { + AllocIfNeeded(); + return string_; + } + + /// + // Clear the state of this class. The underlying string structure and data + // will be freed if this class owns the structure. + /// + void ClearAndFree() { + if (!string_) + return; + if (owner_) { + clear(); + delete string_; + } + string_ = NULL; + owner_ = false; + } + + /// + // Attach to the specified string structure. If |owner| is true this class + // will take ownership of the structure. + /// + void Attach(struct_type* str, bool owner) { + // Free the previous structure and data, if any. + ClearAndFree(); + + string_ = str; + owner_ = owner; + } + + /// + // Take ownership of the specified userfree structure's string data. The + // userfree structure itself will be freed. Only use this method with userfree + // structures. + /// + void AttachToUserFree(userfree_struct_type str) { + // Free the previous structure and data, if any. + ClearAndFree(); + + if (!str) + return; + + AllocIfNeeded(); + owner_ = true; + memcpy(string_, str, sizeof(struct_type)); + + // Free the |str| structure but not the data. + memset(str, 0, sizeof(struct_type)); + traits::userfree_free(str); + } + + /// + // Detach from the underlying string structure. To avoid memory leaks only use + // this method if you already hold a pointer to the underlying string + // structure. + /// + void Detach() { + string_ = NULL; + owner_ = false; + } + + /// + // Create a userfree structure and give it ownership of this class' string + // data. This class will be disassociated from the data. May return NULL if + // this string class currently contains no data. + /// + userfree_struct_type DetachToUserFree() { + if (empty()) + return NULL; + + userfree_struct_type str = traits::userfree_alloc(); + memcpy(str, string_, sizeof(struct_type)); + + // Free this class' structure but not the data. + memset(string_, 0, sizeof(struct_type)); + ClearAndFree(); + + return str; + } + + /// + // Set this string's data to the specified character array. If |copy| is true + // this class will copy the data. Otherwise, this class will reference the + // existing data. Referenced data must exist for the lifetime of this class + // and will not be freed by this class. + /// + bool FromString(const char_type* src, size_t src_len, bool copy) { + if (src == NULL || src_len == 0) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::set(src, src_len, string_, copy) ? true : false; + } + + /// + // Set this string's data from an existing ASCII string. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromASCII(const char* str) { + size_t len = str ? strlen(str) : 0; + if (len == 0) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_ascii(str, len, string_); + } + + /// + // Return this string's data as a std::string. Translation will occur if + // necessary based on the underlying string type. + /// + std::string ToString() const { + if (empty()) + return std::string(); + return traits::to_string(string_); + } + + /// + // Set this string's data from an existing std::string. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromString(const std::string& str) { + if (str.empty()) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_string(str, string_); + } + + /// + // Return this string's data as a std::wstring. Translation will occur if + // necessary based on the underlying string type. + /// + std::wstring ToWString() const { + if (empty()) + return std::wstring(); + return traits::to_wstring(string_); + } + + /// + // Set this string's data from an existing std::wstring. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromWString(const std::wstring& str) { + if (str.empty()) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_wstring(str, string_); + } + + /// + // Return this string's data as a string16. Translation will occur if + // necessary based on the underlying string type. + /// + base::string16 ToString16() const { + if (empty()) + return base::string16(); + return traits::to_string16(string_); + } + + /// + // Set this string's data from an existing string16. Data will be always + // copied. Translation will occur if necessary based on the underlying string + // type. + /// + bool FromString16(const base::string16& str) { + if (str.empty()) { + clear(); + return true; + } + AllocIfNeeded(); + return traits::from_string16(str, string_); + } + + /// + // Comparison operator overloads. + /// + bool operator<(const CefStringBase& str) const { + return (compare(str) < 0); + } + bool operator<=(const CefStringBase& str) const { + return (compare(str) <= 0); + } + bool operator>(const CefStringBase& str) const { + return (compare(str) > 0); + } + bool operator>=(const CefStringBase& str) const { + return (compare(str) >= 0); + } + bool operator==(const CefStringBase& str) const { + return (compare(str) == 0); + } + bool operator!=(const CefStringBase& str) const { + return (compare(str) != 0); + } + + /// + // Assignment operator overloads. + /// + CefStringBase& operator=(const CefStringBase& str) { + FromString(str.c_str(), str.length(), true); + return *this; + } + operator std::string() const { + return ToString(); + } + CefStringBase& operator=(const std::string& str) { + FromString(str); + return *this; + } + CefStringBase& operator=(const char* str) { + FromString(std::string(str)); + return *this; + } + operator std::wstring() const { + return ToWString(); + } + CefStringBase& operator=(const std::wstring& str) { + FromWString(str); + return *this; + } + CefStringBase& operator=(const wchar_t* str) { + FromWString(std::wstring(str)); + return *this; + } +#if defined(WCHAR_T_IS_UTF32) + operator base::string16() const { + return ToString16(); + } + CefStringBase& operator=(const base::string16& str) { + FromString16(str); + return *this; + } + CefStringBase& operator=(const char16* str) { + FromString16(base::string16(str)); + return *this; + } +#endif // WCHAR_T_IS_UTF32 + + private: + // Allocate the string structure if it doesn't already exist. + void AllocIfNeeded() { + if (string_ == NULL) { + string_ = new struct_type; + memset(string_, 0, sizeof(struct_type)); + owner_ = true; + } + } + + struct_type* string_; + bool owner_; +}; + + +typedef CefStringBase CefStringWide; +typedef CefStringBase CefStringUTF8; +typedef CefStringBase CefStringUTF16; + +#endif // CEF_INCLUDE_INTERNAL_CEF_STRING_WRAPPERS_H_ diff --git a/vendor/cef3/include/internal/cef_thread_internal.h b/vendor/cef3/include/internal/cef_thread_internal.h new file mode 100644 index 00000000000..eee2b2ae4f1 --- /dev/null +++ b/vendor/cef3/include/internal/cef_thread_internal.h @@ -0,0 +1,74 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_THREAD_INTERNAL_H_ +#define CEF_INCLUDE_INTERNAL_CEF_THREAD_INTERNAL_H_ +#pragma once + +#if defined(OS_WIN) +#include +#elif defined(OS_POSIX) +#include +#include +#endif + +#include "include/internal/cef_export.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(OS_WIN) +typedef DWORD cef_platform_thread_id_t; +#elif defined(OS_POSIX) +typedef pid_t cef_platform_thread_id_t; +#endif + +/// +// Returns the current platform thread ID. +/// +CEF_EXPORT cef_platform_thread_id_t cef_get_current_platform_thread_id(); + +#if defined(OS_WIN) +typedef DWORD cef_platform_thread_handle_t; +#elif defined(OS_POSIX) +typedef pthread_t cef_platform_thread_handle_t; +#endif + +/// +// Returns the current platform thread handle. +/// +CEF_EXPORT cef_platform_thread_handle_t + cef_get_current_platform_thread_handle(); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // CEF_INCLUDE_INTERNAL_CEF_THREAD_INTERNAL_H_ diff --git a/vendor/cef3/include/internal/cef_time.h b/vendor/cef3/include/internal/cef_time.h new file mode 100644 index 00000000000..64e601fe032 --- /dev/null +++ b/vendor/cef3/include/internal/cef_time.h @@ -0,0 +1,88 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TIME_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TIME_H_ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "include/internal/cef_export.h" +#include + +/// +// Time information. Values should always be in UTC. +/// +typedef struct _cef_time_t { + int year; // Four digit year "2007" + int month; // 1-based month (values 1 = January, etc.) + int day_of_week; // 0-based day of week (0 = Sunday, etc.) + int day_of_month; // 1-based day of month (1-31) + int hour; // Hour within the current day (0-23) + int minute; // Minute within the current hour (0-59) + int second; // Second within the current minute (0-59 plus leap + // seconds which may take it up to 60). + int millisecond; // Milliseconds within the current second (0-999) +} cef_time_t; + +/// +// Converts cef_time_t to/from time_t. Returns true (1) on success and false (0) +// on failure. +/// +CEF_EXPORT int cef_time_to_timet(const cef_time_t* cef_time, time_t* time); +CEF_EXPORT int cef_time_from_timet(time_t time, cef_time_t* cef_time); + +/// +// Converts cef_time_t to/from a double which is the number of seconds since +// epoch (Jan 1, 1970). Webkit uses this format to represent time. A value of 0 +// means "not initialized". Returns true (1) on success and false (0) on +// failure. +/// +CEF_EXPORT int cef_time_to_doublet(const cef_time_t* cef_time, double* time); +CEF_EXPORT int cef_time_from_doublet(double time, cef_time_t* cef_time); + +/// +// Retrieve the current system time. +// +CEF_EXPORT int cef_time_now(cef_time_t* cef_time); + +/// +// Retrieve the delta in milliseconds between two time values. +// +CEF_EXPORT int cef_time_delta(const cef_time_t* cef_time1, + const cef_time_t* cef_time2, + long long* delta); + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_TIME_H_ diff --git a/vendor/cef3/include/internal/cef_trace_event_internal.h b/vendor/cef3/include/internal/cef_trace_event_internal.h new file mode 100644 index 00000000000..6df870717a2 --- /dev/null +++ b/vendor/cef3/include/internal/cef_trace_event_internal.h @@ -0,0 +1,124 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_ +#pragma once + +#include "include/internal/cef_export.h" +#include "include/internal/cef_types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +// See include/base/cef_trace_event.h for macros and intended usage. + +// Functions for tracing counters and functions; called from macros. +// - |category| string must have application lifetime (static or literal). They +// may not include "(quotes) chars. +// - |argX_name|, |argX_val|, |valueX_name|, |valeX_val| are optional parameters +// and represent pairs of name and values of arguments +// - |copy| is used to avoid memory scoping issues with the |name| and +// |arg_name| parameters by copying them +// - |id| is used to disambiguate counters with the same name, or match async +// trace events + +CEF_EXPORT void cef_trace_event_instant(const char* category, + const char* name, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_event_begin(const char* category, + const char* name, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_event_end(const char* category, + const char* name, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_counter(const char* category, + const char* name, + const char* value1_name, + uint64 value1_val, + const char* value2_name, + uint64 value2_val, + int copy); +CEF_EXPORT void cef_trace_counter_id(const char* category, + const char* name, + uint64 id, + const char* value1_name, + uint64 value1_val, + const char* value2_name, + uint64 value2_val, + int copy); +CEF_EXPORT void cef_trace_event_async_begin(const char* category, + const char* name, + uint64 id, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); +CEF_EXPORT void cef_trace_event_async_step_into(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy); +CEF_EXPORT void cef_trace_event_async_step_past(const char* category, + const char* name, + uint64 id, + uint64 step, + const char* arg1_name, + uint64 arg1_val, + int copy); +CEF_EXPORT void cef_trace_event_async_end(const char* category, + const char* name, + uint64 id, + const char* arg1_name, + uint64 arg1_val, + const char* arg2_name, + uint64 arg2_val, + int copy); + +#ifdef __cplusplus +} +#endif // __cplusplus + +#endif // CEF_INCLUDE_INTERNAL_CEF_TRACE_EVENT_INTERNAL_H_ diff --git a/vendor/cef3/include/internal/cef_types.h b/vendor/cef3/include/internal/cef_types.h new file mode 100644 index 00000000000..713eed7edd0 --- /dev/null +++ b/vendor/cef3/include/internal/cef_types.h @@ -0,0 +1,1909 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ +#pragma once + +#include "include/base/cef_build.h" +#include "include/internal/cef_string.h" +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_time.h" + +// Bring in platform-specific definitions. +#if defined(OS_WIN) +#include "include/internal/cef_types_win.h" +#elif defined(OS_MACOSX) +#include "include/internal/cef_types_mac.h" +#elif defined(OS_LINUX) +#include "include/internal/cef_types_linux.h" +#endif + +#include // For UINT_MAX +#include // For size_t + +// The NSPR system headers define 64-bit as |long| when possible, except on +// Mac OS X. In order to not have typedef mismatches, we do the same on LP64. +// +// On Mac OS X, |long long| is used for 64-bit types for compatibility with +// format macros even in the LP64 model. +#if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) +typedef long int64; // NOLINT(runtime/int) +typedef unsigned long uint64; // NOLINT(runtime/int) +#else +typedef long long int64; // NOLINT(runtime/int) +typedef unsigned long long uint64; // NOLINT(runtime/int) +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _INT32 +#define _INT32 +typedef int int32; +#endif + +// TODO: Remove these type guards. These are to avoid conflicts with +// obsolete/protypes.h in the Gecko SDK. +#ifndef _UINT32 +#define _UINT32 +typedef unsigned int uint32; +#endif + +// UTF-16 character type +#ifndef char16 +#if defined(WIN32) +typedef wchar_t char16; +#else +typedef unsigned short char16; +#endif +#endif + +// 32-bit ARGB color value, not premultiplied. The color components are always +// in a known order. Equivalent to the SkColor type. +typedef uint32 cef_color_t; + +// Return the alpha byte from a cef_color_t value. +#define CefColorGetA(color) (((color) >> 24) & 0xFF) +// Return the red byte from a cef_color_t value. +#define CefColorGetR(color) (((color) >> 16) & 0xFF) +// Return the green byte from a cef_color_t value. +#define CefColorGetG(color) (((color) >> 8) & 0xFF) +// Return the blue byte from a cef_color_t value. +#define CefColorGetB(color) (((color) >> 0) & 0xFF) + +// Return an cef_color_t value with the specified byte component values. +#define CefColorSetARGB(a, r, g, b) \ + static_cast( \ + (static_cast(a) << 24) | \ + (static_cast(r) << 16) | \ + (static_cast(g) << 8) | \ + (static_cast(b) << 0)) + +// Return an int64 value with the specified low and high int32 component values. +#define CefInt64Set(int32_low, int32_high) \ + static_cast((static_cast(int32_low)) | \ + (static_cast(static_cast(int32_high))) << 32) + +// Return the low int32 value from an int64 value. +#define CefInt64GetLow(int64_val) static_cast(int64_val) +// Return the high int32 value from an int64 value. +#define CefInt64GetHigh(int64_val) \ + static_cast((static_cast(int64_val) >> 32) & 0xFFFFFFFFL) + + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// Log severity levels. +/// +typedef enum { + /// + // Default logging (currently INFO logging). + /// + LOGSEVERITY_DEFAULT, + + /// + // Verbose logging. + /// + LOGSEVERITY_VERBOSE, + + /// + // INFO logging. + /// + LOGSEVERITY_INFO, + + /// + // WARNING logging. + /// + LOGSEVERITY_WARNING, + + /// + // ERROR logging. + /// + LOGSEVERITY_ERROR, + + /// + // Completely disable logging. + /// + LOGSEVERITY_DISABLE = 99 +} cef_log_severity_t; + +/// +// Represents the state of a setting. +/// +typedef enum { + /// + // Use the default state for the setting. + /// + STATE_DEFAULT = 0, + + /// + // Enable or allow the setting. + /// + STATE_ENABLED, + + /// + // Disable or disallow the setting. + /// + STATE_DISABLED, +} cef_state_t; + +/// +// Initialization settings. Specify NULL or 0 to get the recommended default +// values. Many of these and other settings can also configured using command- +// line switches. +/// +typedef struct _cef_settings_t { + /// + // Size of this structure. + /// + size_t size; + + /// + // Set to true (1) to use a single process for the browser and renderer. This + // run mode is not officially supported by Chromium and is less stable than + // the multi-process default. Also configurable using the "single-process" + // command-line switch. + /// + int single_process; + + /// + // Set to true (1) to disable the sandbox for sub-processes. See + // cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also + // configurable using the "no-sandbox" command-line switch. + /// + int no_sandbox; + + /// + // The path to a separate executable that will be launched for sub-processes. + // By default the browser process executable is used. See the comments on + // CefExecuteProcess() for details. Also configurable using the + // "browser-subprocess-path" command-line switch. + /// + cef_string_t browser_subprocess_path; + + /// + // Set to true (1) to have the browser process message loop run in a separate + // thread. If false (0) than the CefDoMessageLoopWork() function must be + // called from your application message loop. + /// + int multi_threaded_message_loop; + + /// + // Set to true (1) to enable windowless (off-screen) rendering support. Do not + // enable this value if the application does not use windowless rendering as + // it may reduce rendering performance on some systems. + /// + int windowless_rendering_enabled; + + /// + // Set to true (1) to disable configuration of browser process features using + // standard CEF and Chromium command-line arguments. Configuration can still + // be specified using CEF data structures or via the + // CefApp::OnBeforeCommandLineProcessing() method. + /// + int command_line_args_disabled; + + /// + // The location where cache data will be stored on disk. If empty an in-memory + // cache will be used for some features and a temporary disk cache for others. + // HTML5 databases such as localStorage will only persist across sessions if a + // cache path is specified. + /// + cef_string_t cache_path; + + /// + // To persist session cookies (cookies without an expiry date or validity + // interval) by default when using the global cookie manager set this value to + // true. Session cookies are generally intended to be transient and most Web + // browsers do not persist them. A |cache_path| value must also be specified to + // enable this feature. Also configurable using the "persist-session-cookies" + // command-line switch. + /// + int persist_session_cookies; + + /// + // Value that will be returned as the User-Agent HTTP header. If empty the + // default User-Agent string will be used. Also configurable using the + // "user-agent" command-line switch. + /// + cef_string_t user_agent; + + /// + // Value that will be inserted as the product portion of the default + // User-Agent string. If empty the Chromium product version will be used. If + // |userAgent| is specified this value will be ignored. Also configurable + // using the "product-version" command-line switch. + /// + cef_string_t product_version; + + /// + // The locale string that will be passed to WebKit. If empty the default + // locale of "en-US" will be used. This value is ignored on Linux where locale + // is determined using environment variable parsing with the precedence order: + // LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang" + // command-line switch. + /// + cef_string_t locale; + + /// + // The directory and file name to use for the debug log. If empty, the + // default name of "debug.log" will be used and the file will be written + // to the application directory. Also configurable using the "log-file" + // command-line switch. + /// + cef_string_t log_file; + + /// + // The log severity. Only messages of this severity level or higher will be + // logged. Also configurable using the "log-severity" command-line switch with + // a value of "verbose", "info", "warning", "error", "error-report" or + // "disable". + /// + cef_log_severity_t log_severity; + + /// + // Custom flags that will be used when initializing the V8 JavaScript engine. + // The consequences of using custom flags may not be well tested. Also + // configurable using the "js-flags" command-line switch. + /// + cef_string_t javascript_flags; + + /// + // The fully qualified path for the resources directory. If this value is + // empty the cef.pak and/or devtools_resources.pak files must be located in + // the module directory on Windows/Linux or the app bundle Resources directory + // on Mac OS X. Also configurable using the "resources-dir-path" command-line + // switch. + /// + cef_string_t resources_dir_path; + + /// + // The fully qualified path for the locales directory. If this value is empty + // the locales directory must be located in the module directory. This value + // is ignored on Mac OS X where pack files are always loaded from the app + // bundle Resources directory. Also configurable using the "locales-dir-path" + // command-line switch. + /// + cef_string_t locales_dir_path; + + /// + // Set to true (1) to disable loading of pack files for resources and locales. + // A resource bundle handler must be provided for the browser and render + // processes via CefApp::GetResourceBundleHandler() if loading of pack files + // is disabled. Also configurable using the "disable-pack-loading" command- + // line switch. + /// + int pack_loading_disabled; + + /// + // Set to a value between 1024 and 65535 to enable remote debugging on the + // specified port. For example, if 8080 is specified the remote debugging URL + // will be http://localhost:8080. CEF can be remotely debugged from any CEF or + // Chrome browser window. Also configurable using the "remote-debugging-port" + // command-line switch. + /// + int remote_debugging_port; + + /// + // The number of stack trace frames to capture for uncaught exceptions. + // Specify a positive value to enable the CefV8ContextHandler:: + // OnUncaughtException() callback. Specify 0 (default value) and + // OnUncaughtException() will not be called. Also configurable using the + // "uncaught-exception-stack-size" command-line switch. + /// + int uncaught_exception_stack_size; + + /// + // By default CEF V8 references will be invalidated (the IsValid() method will + // return false) after the owning context has been released. This reduces the + // need for external record keeping and avoids crashes due to the use of V8 + // references after the associated context has been released. + // + // CEF currently offers two context safety implementations with different + // performance characteristics. The default implementation (value of 0) uses a + // map of hash values and should provide better performance in situations with + // a small number contexts. The alternate implementation (value of 1) uses a + // hidden value attached to each context and should provide better performance + // in situations with a large number of contexts. + // + // If you need better performance in the creation of V8 references and you + // plan to manually track context lifespan you can disable context safety by + // specifying a value of -1. + // + // Also configurable using the "context-safety-implementation" command-line + // switch. + /// + int context_safety_implementation; + + /// + // Set to true (1) to ignore errors related to invalid SSL certificates. + // Enabling this setting can lead to potential security vulnerabilities like + // "man in the middle" attacks. Applications that load content from the + // internet should not enable this setting. Also configurable using the + // "ignore-certificate-errors" command-line switch. + /// + int ignore_certificate_errors; + + /// + // Opaque background color used for accelerated content. By default the + // background color will be white. Only the RGB compontents of the specified + // value will be used. The alpha component must greater than 0 to enable use + // of the background color but will be otherwise ignored. + /// + cef_color_t background_color; +} cef_settings_t; + +/// +// Browser initialization settings. Specify NULL or 0 to get the recommended +// default values. The consequences of using custom values may not be well +// tested. Many of these and other settings can also configured using command- +// line switches. +/// +typedef struct _cef_browser_settings_t { + /// + // Size of this structure. + /// + size_t size; + + /// + // The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint + // will be called for a windowless browser. The actual fps may be lower if + // the browser cannot generate frames at the requested rate. The minimum + // value is 1 and the maximum value is 60 (default 30). + /// + int windowless_frame_rate; + + // The below values map to WebPreferences settings. + + /// + // Font settings. + /// + cef_string_t standard_font_family; + cef_string_t fixed_font_family; + cef_string_t serif_font_family; + cef_string_t sans_serif_font_family; + cef_string_t cursive_font_family; + cef_string_t fantasy_font_family; + int default_font_size; + int default_fixed_font_size; + int minimum_font_size; + int minimum_logical_font_size; + + /// + // Default encoding for Web content. If empty "ISO-8859-1" will be used. Also + // configurable using the "default-encoding" command-line switch. + /// + cef_string_t default_encoding; + + /// + // Controls the loading of fonts from remote sources. Also configurable using + // the "disable-remote-fonts" command-line switch. + /// + cef_state_t remote_fonts; + + /// + // Controls whether JavaScript can be executed. Also configurable using the + // "disable-javascript" command-line switch. + /// + cef_state_t javascript; + + /// + // Controls whether JavaScript can be used for opening windows. Also + // configurable using the "disable-javascript-open-windows" command-line + // switch. + /// + cef_state_t javascript_open_windows; + + /// + // Controls whether JavaScript can be used to close windows that were not + // opened via JavaScript. JavaScript can still be used to close windows that + // were opened via JavaScript. Also configurable using the + // "disable-javascript-close-windows" command-line switch. + /// + cef_state_t javascript_close_windows; + + /// + // Controls whether JavaScript can access the clipboard. Also configurable + // using the "disable-javascript-access-clipboard" command-line switch. + /// + cef_state_t javascript_access_clipboard; + + /// + // Controls whether DOM pasting is supported in the editor via + // execCommand("paste"). The |javascript_access_clipboard| setting must also + // be enabled. Also configurable using the "disable-javascript-dom-paste" + // command-line switch. + /// + cef_state_t javascript_dom_paste; + + /// + // Controls whether the caret position will be drawn. Also configurable using + // the "enable-caret-browsing" command-line switch. + /// + cef_state_t caret_browsing; + + /// + // Controls whether the Java plugin will be loaded. Also configurable using + // the "disable-java" command-line switch. + /// + cef_state_t java; + + /// + // Controls whether any plugins will be loaded. Also configurable using the + // "disable-plugins" command-line switch. + /// + cef_state_t plugins; + + /// + // Controls whether file URLs will have access to all URLs. Also configurable + // using the "allow-universal-access-from-files" command-line switch. + /// + cef_state_t universal_access_from_file_urls; + + /// + // Controls whether file URLs will have access to other file URLs. Also + // configurable using the "allow-access-from-files" command-line switch. + /// + cef_state_t file_access_from_file_urls; + + /// + // Controls whether web security restrictions (same-origin policy) will be + // enforced. Disabling this setting is not recommend as it will allow risky + // security behavior such as cross-site scripting (XSS). Also configurable + // using the "disable-web-security" command-line switch. + /// + cef_state_t web_security; + + /// + // Controls whether image URLs will be loaded from the network. A cached image + // will still be rendered if requested. Also configurable using the + // "disable-image-loading" command-line switch. + /// + cef_state_t image_loading; + + /// + // Controls whether standalone images will be shrunk to fit the page. Also + // configurable using the "image-shrink-standalone-to-fit" command-line + // switch. + /// + cef_state_t image_shrink_standalone_to_fit; + + /// + // Controls whether text areas can be resized. Also configurable using the + // "disable-text-area-resize" command-line switch. + /// + cef_state_t text_area_resize; + + /// + // Controls whether the tab key can advance focus to links. Also configurable + // using the "disable-tab-to-links" command-line switch. + /// + cef_state_t tab_to_links; + + /// + // Controls whether local storage can be used. Also configurable using the + // "disable-local-storage" command-line switch. + /// + cef_state_t local_storage; + + /// + // Controls whether databases can be used. Also configurable using the + // "disable-databases" command-line switch. + /// + cef_state_t databases; + + /// + // Controls whether the application cache can be used. Also configurable using + // the "disable-application-cache" command-line switch. + /// + cef_state_t application_cache; + + /// + // Controls whether WebGL can be used. Note that WebGL requires hardware + // support and may not work on all systems even when enabled. Also + // configurable using the "disable-webgl" command-line switch. + /// + cef_state_t webgl; + + /// + // Opaque background color used for the browser before a document is loaded + // and when no document color is specified. By default the background color + // will be the same as CefSettings.background_color. Only the RGB compontents + // of the specified value will be used. The alpha component must greater than + // 0 to enable use of the background color but will be otherwise ignored. + /// + cef_color_t background_color; +} cef_browser_settings_t; + +/// +// URL component parts. +/// +typedef struct _cef_urlparts_t { + /// + // The complete URL specification. + /// + cef_string_t spec; + + /// + // Scheme component not including the colon (e.g., "http"). + /// + cef_string_t scheme; + + /// + // User name component. + /// + cef_string_t username; + + /// + // Password component. + /// + cef_string_t password; + + /// + // Host component. This may be a hostname, an IPv4 address or an IPv6 literal + // surrounded by square brackets (e.g., "[2001:db8::1]"). + /// + cef_string_t host; + + /// + // Port number component. + /// + cef_string_t port; + + /// + // Origin contains just the scheme, host, and port from a URL. Equivalent to + // clearing any username and password, replacing the path with a slash, and + // clearing everything after that. This value will be empty for non-standard + // URLs. + /// + cef_string_t origin; + + /// + // Path component including the first slash following the host. + /// + cef_string_t path; + + /// + // Query string component (i.e., everything following the '?'). + /// + cef_string_t query; +} cef_urlparts_t; + +/// +// Cookie information. +/// +typedef struct _cef_cookie_t { + /// + // The cookie name. + /// + cef_string_t name; + + /// + // The cookie value. + /// + cef_string_t value; + + /// + // If |domain| is empty a host cookie will be created instead of a domain + // cookie. Domain cookies are stored with a leading "." and are visible to + // sub-domains whereas host cookies are not. + /// + cef_string_t domain; + + /// + // If |path| is non-empty only URLs at or below the path will get the cookie + // value. + /// + cef_string_t path; + + /// + // If |secure| is true the cookie will only be sent for HTTPS requests. + /// + int secure; + + /// + // If |httponly| is true the cookie will only be sent for HTTP requests. + /// + int httponly; + + /// + // The cookie creation date. This is automatically populated by the system on + // cookie creation. + /// + cef_time_t creation; + + /// + // The cookie last access date. This is automatically populated by the system + // on access. + /// + cef_time_t last_access; + + /// + // The cookie expiration date is only valid if |has_expires| is true. + /// + int has_expires; + cef_time_t expires; +} cef_cookie_t; + +/// +// Process termination status values. +/// +typedef enum { + /// + // Non-zero exit status. + /// + TS_ABNORMAL_TERMINATION, + + /// + // SIGKILL or task manager kill. + /// + TS_PROCESS_WAS_KILLED, + + /// + // Segmentation fault. + /// + TS_PROCESS_CRASHED, +} cef_termination_status_t; + +/// +// Path key values. +/// +typedef enum { + /// + // Current directory. + /// + PK_DIR_CURRENT, + + /// + // Directory containing PK_FILE_EXE. + /// + PK_DIR_EXE, + + /// + // Directory containing PK_FILE_MODULE. + /// + PK_DIR_MODULE, + + /// + // Temporary directory. + /// + PK_DIR_TEMP, + + /// + // Path and filename of the current executable. + /// + PK_FILE_EXE, + + /// + // Path and filename of the module containing the CEF code (usually the libcef + // module). + /// + PK_FILE_MODULE, +} cef_path_key_t; + +/// +// Storage types. +/// +typedef enum { + ST_LOCALSTORAGE = 0, + ST_SESSIONSTORAGE, +} cef_storage_type_t; + +/// +// Supported error code values. See net\base\net_error_list.h for complete +// descriptions of the error codes. +/// +typedef enum { + ERR_NONE = 0, + ERR_FAILED = -2, + ERR_ABORTED = -3, + ERR_INVALID_ARGUMENT = -4, + ERR_INVALID_HANDLE = -5, + ERR_FILE_NOT_FOUND = -6, + ERR_TIMED_OUT = -7, + ERR_FILE_TOO_BIG = -8, + ERR_UNEXPECTED = -9, + ERR_ACCESS_DENIED = -10, + ERR_NOT_IMPLEMENTED = -11, + ERR_CONNECTION_CLOSED = -100, + ERR_CONNECTION_RESET = -101, + ERR_CONNECTION_REFUSED = -102, + ERR_CONNECTION_ABORTED = -103, + ERR_CONNECTION_FAILED = -104, + ERR_NAME_NOT_RESOLVED = -105, + ERR_INTERNET_DISCONNECTED = -106, + ERR_SSL_PROTOCOL_ERROR = -107, + ERR_ADDRESS_INVALID = -108, + ERR_ADDRESS_UNREACHABLE = -109, + ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110, + ERR_TUNNEL_CONNECTION_FAILED = -111, + ERR_NO_SSL_VERSIONS_ENABLED = -112, + ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113, + ERR_SSL_RENEGOTIATION_REQUESTED = -114, + ERR_CERT_COMMON_NAME_INVALID = -200, + ERR_CERT_DATE_INVALID = -201, + ERR_CERT_AUTHORITY_INVALID = -202, + ERR_CERT_CONTAINS_ERRORS = -203, + ERR_CERT_NO_REVOCATION_MECHANISM = -204, + ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205, + ERR_CERT_REVOKED = -206, + ERR_CERT_INVALID = -207, + ERR_CERT_END = -208, + ERR_INVALID_URL = -300, + ERR_DISALLOWED_URL_SCHEME = -301, + ERR_UNKNOWN_URL_SCHEME = -302, + ERR_TOO_MANY_REDIRECTS = -310, + ERR_UNSAFE_REDIRECT = -311, + ERR_UNSAFE_PORT = -312, + ERR_INVALID_RESPONSE = -320, + ERR_INVALID_CHUNKED_ENCODING = -321, + ERR_METHOD_NOT_SUPPORTED = -322, + ERR_UNEXPECTED_PROXY_AUTH = -323, + ERR_EMPTY_RESPONSE = -324, + ERR_RESPONSE_HEADERS_TOO_BIG = -325, + ERR_CACHE_MISS = -400, + ERR_INSECURE_RESPONSE = -501, +} cef_errorcode_t; + +/// +// "Verb" of a drag-and-drop operation as negotiated between the source and +// destination. These constants match their equivalents in WebCore's +// DragActions.h and should not be renumbered. +/// +typedef enum { + DRAG_OPERATION_NONE = 0, + DRAG_OPERATION_COPY = 1, + DRAG_OPERATION_LINK = 2, + DRAG_OPERATION_GENERIC = 4, + DRAG_OPERATION_PRIVATE = 8, + DRAG_OPERATION_MOVE = 16, + DRAG_OPERATION_DELETE = 32, + DRAG_OPERATION_EVERY = UINT_MAX +} cef_drag_operations_mask_t; + +/// +// V8 access control values. +/// +typedef enum { + V8_ACCESS_CONTROL_DEFAULT = 0, + V8_ACCESS_CONTROL_ALL_CAN_READ = 1, + V8_ACCESS_CONTROL_ALL_CAN_WRITE = 1 << 1, + V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2 +} cef_v8_accesscontrol_t; + +/// +// V8 property attribute values. +/// +typedef enum { + V8_PROPERTY_ATTRIBUTE_NONE = 0, // Writeable, Enumerable, + // Configurable + V8_PROPERTY_ATTRIBUTE_READONLY = 1 << 0, // Not writeable + V8_PROPERTY_ATTRIBUTE_DONTENUM = 1 << 1, // Not enumerable + V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2 // Not configurable +} cef_v8_propertyattribute_t; + +/// +// Post data elements may represent either bytes or files. +/// +typedef enum { + PDE_TYPE_EMPTY = 0, + PDE_TYPE_BYTES, + PDE_TYPE_FILE, +} cef_postdataelement_type_t; + +/// +// Resource type for a request. +/// +typedef enum { + /// + // Top level page. + /// + RT_MAIN_FRAME = 0, + + /// + // Frame or iframe. + /// + RT_SUB_FRAME, + + /// + // CSS stylesheet. + /// + RT_STYLESHEET, + + /// + // External script. + /// + RT_SCRIPT, + + /// + // Image (jpg/gif/png/etc). + /// + RT_IMAGE, + + /// + // Font. + /// + RT_FONT_RESOURCE, + + /// + // Some other subresource. This is the default type if the actual type is + // unknown. + /// + RT_SUB_RESOURCE, + + /// + // Object (or embed) tag for a plugin, or a resource that a plugin requested. + /// + RT_OBJECT, + + /// + // Media resource. + /// + RT_MEDIA, + + /// + // Main resource of a dedicated worker. + /// + RT_WORKER, + + /// + // Main resource of a shared worker. + /// + RT_SHARED_WORKER, + + /// + // Explicitly requested prefetch. + /// + RT_PREFETCH, + + /// + // Favicon. + /// + RT_FAVICON, + + /// + // XMLHttpRequest. + /// + RT_XHR, + + /// + // A request for a + /// + RT_PING, + + /// + // Main resource of a service worker. + /// + RT_SERVICE_WORKER, +} cef_resource_type_t; + +/// +// Transition type for a request. Made up of one source value and 0 or more +// qualifiers. +/// +typedef enum { + /// + // Source is a link click or the JavaScript window.open function. This is + // also the default value for requests like sub-resource loads that are not + // navigations. + /// + TT_LINK = 0, + + /// + // Source is some other "explicit" navigation action such as creating a new + // browser or using the LoadURL function. This is also the default value + // for navigations where the actual type is unknown. + /// + TT_EXPLICIT = 1, + + /// + // Source is a subframe navigation. This is any content that is automatically + // loaded in a non-toplevel frame. For example, if a page consists of several + // frames containing ads, those ad URLs will have this transition type. + // The user may not even realize the content in these pages is a separate + // frame, so may not care about the URL. + /// + TT_AUTO_SUBFRAME = 3, + + /// + // Source is a subframe navigation explicitly requested by the user that will + // generate new navigation entries in the back/forward list. These are + // probably more important than frames that were automatically loaded in + // the background because the user probably cares about the fact that this + // link was loaded. + /// + TT_MANUAL_SUBFRAME = 4, + + /// + // Source is a form submission by the user. NOTE: In some situations + // submitting a form does not result in this transition type. This can happen + // if the form uses a script to submit the contents. + /// + TT_FORM_SUBMIT = 7, + + /// + // Source is a "reload" of the page via the Reload function or by re-visiting + // the same URL. NOTE: This is distinct from the concept of whether a + // particular load uses "reload semantics" (i.e. bypasses cached data). + /// + TT_RELOAD = 8, + + /// + // General mask defining the bits used for the source values. + /// + TT_SOURCE_MASK = 0xFF, + + // Qualifiers. + // Any of the core values above can be augmented by one or more qualifiers. + // These qualifiers further define the transition. + + /// + // Attempted to visit a URL but was blocked. + /// + TT_BLOCKED_FLAG = 0x00800000, + + /// + // Used the Forward or Back function to navigate among browsing history. + /// + TT_FORWARD_BACK_FLAG = 0x01000000, + + /// + // The beginning of a navigation chain. + /// + TT_CHAIN_START_FLAG = 0x10000000, + + /// + // The last transition in a redirect chain. + /// + TT_CHAIN_END_FLAG = 0x20000000, + + /// + // Redirects caused by JavaScript or a meta refresh tag on the page. + /// + TT_CLIENT_REDIRECT_FLAG = 0x40000000, + + /// + // Redirects sent from the server by HTTP headers. + /// + TT_SERVER_REDIRECT_FLAG = 0x80000000, + + /// + // Used to test whether a transition involves a redirect. + /// + TT_IS_REDIRECT_MASK = 0xC0000000, + + /// + // General mask defining the bits used for the qualifiers. + /// + TT_QUALIFIER_MASK = 0xFFFFFF00, +} cef_transition_type_t; + +/// +// Flags used to customize the behavior of CefURLRequest. +/// +typedef enum { + /// + // Default behavior. + /// + UR_FLAG_NONE = 0, + + /// + // If set the cache will be skipped when handling the request. + /// + UR_FLAG_SKIP_CACHE = 1 << 0, + + /// + // If set user name, password, and cookies may be sent with the request, and + // cookies may be saved from the response. + /// + UR_FLAG_ALLOW_CACHED_CREDENTIALS = 1 << 1, + + /// + // If set upload progress events will be generated when a request has a body. + /// + UR_FLAG_REPORT_UPLOAD_PROGRESS = 1 << 3, + + /// + // If set the headers sent and received for the request will be recorded. + /// + UR_FLAG_REPORT_RAW_HEADERS = 1 << 5, + + /// + // If set the CefURLRequestClient::OnDownloadData method will not be called. + /// + UR_FLAG_NO_DOWNLOAD_DATA = 1 << 6, + + /// + // If set 5XX redirect errors will be propagated to the observer instead of + // automatically re-tried. This currently only applies for requests + // originated in the browser process. + /// + UR_FLAG_NO_RETRY_ON_5XX = 1 << 7, +} cef_urlrequest_flags_t; + +/// +// Flags that represent CefURLRequest status. +/// +typedef enum { + /// + // Unknown status. + /// + UR_UNKNOWN = 0, + + /// + // Request succeeded. + /// + UR_SUCCESS, + + /// + // An IO request is pending, and the caller will be informed when it is + // completed. + /// + UR_IO_PENDING, + + /// + // Request was canceled programatically. + /// + UR_CANCELED, + + /// + // Request failed for some reason. + /// + UR_FAILED, +} cef_urlrequest_status_t; + +/// +// Structure representing a point. +/// +typedef struct _cef_point_t { + int x; + int y; +} cef_point_t; + +/// +// Structure representing a rectangle. +/// +typedef struct _cef_rect_t { + int x; + int y; + int width; + int height; +} cef_rect_t; + +/// +// Structure representing a size. +/// +typedef struct _cef_size_t { + int width; + int height; +} cef_size_t; + +/// +// Existing process IDs. +/// +typedef enum { + /// + // Browser process. + /// + PID_BROWSER, + /// + // Renderer process. + /// + PID_RENDERER, +} cef_process_id_t; + +/// +// Existing thread IDs. +/// +typedef enum { +// BROWSER PROCESS THREADS -- Only available in the browser process. + + /// + // The main thread in the browser. This will be the same as the main + // application thread if CefInitialize() is called with a + // CefSettings.multi_threaded_message_loop value of false. + /// + TID_UI, + + /// + // Used to interact with the database. + /// + TID_DB, + + /// + // Used to interact with the file system. + /// + TID_FILE, + + /// + // Used for file system operations that block user interactions. + // Responsiveness of this thread affects users. + /// + TID_FILE_USER_BLOCKING, + + /// + // Used to launch and terminate browser processes. + /// + TID_PROCESS_LAUNCHER, + + /// + // Used to handle slow HTTP cache operations. + /// + TID_CACHE, + + /// + // Used to process IPC and network messages. + /// + TID_IO, + +// RENDER PROCESS THREADS -- Only available in the render process. + + /// + // The main thread in the renderer. Used for all WebKit and V8 interaction. + /// + TID_RENDERER, +} cef_thread_id_t; + +/// +// Supported value types. +/// +typedef enum { + VTYPE_INVALID = 0, + VTYPE_NULL, + VTYPE_BOOL, + VTYPE_INT, + VTYPE_DOUBLE, + VTYPE_STRING, + VTYPE_BINARY, + VTYPE_DICTIONARY, + VTYPE_LIST, +} cef_value_type_t; + +/// +// Supported JavaScript dialog types. +/// +typedef enum { + JSDIALOGTYPE_ALERT = 0, + JSDIALOGTYPE_CONFIRM, + JSDIALOGTYPE_PROMPT, +} cef_jsdialog_type_t; + +/// +// Screen information used when window rendering is disabled. This structure is +// passed as a parameter to CefRenderHandler::GetScreenInfo and should be filled +// in by the client. +/// +typedef struct _cef_screen_info_t { + /// + // Device scale factor. Specifies the ratio between physical and logical + // pixels. + /// + float device_scale_factor; + + /// + // The screen depth in bits per pixel. + /// + int depth; + + /// + // The bits per color component. This assumes that the colors are balanced + // equally. + /// + int depth_per_component; + + /// + // This can be true for black and white printers. + /// + int is_monochrome; + + /// + // This is set from the rcMonitor member of MONITORINFOEX, to whit: + // "A RECT structure that specifies the display monitor rectangle, + // expressed in virtual-screen coordinates. Note that if the monitor + // is not the primary display monitor, some of the rectangle's + // coordinates may be negative values." + // + // The |rect| and |available_rect| properties are used to determine the + // available surface for rendering popup views. + /// + cef_rect_t rect; + + /// + // This is set from the rcWork member of MONITORINFOEX, to whit: + // "A RECT structure that specifies the work area rectangle of the + // display monitor that can be used by applications, expressed in + // virtual-screen coordinates. Windows uses this rectangle to + // maximize an application on the monitor. The rest of the area in + // rcMonitor contains system windows such as the task bar and side + // bars. Note that if the monitor is not the primary display monitor, + // some of the rectangle's coordinates may be negative values". + // + // The |rect| and |available_rect| properties are used to determine the + // available surface for rendering popup views. + /// + cef_rect_t available_rect; +} cef_screen_info_t; + +/// +// Supported menu IDs. Non-English translations can be provided for the +// IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString(). +/// +typedef enum { + // Navigation. + MENU_ID_BACK = 100, + MENU_ID_FORWARD = 101, + MENU_ID_RELOAD = 102, + MENU_ID_RELOAD_NOCACHE = 103, + MENU_ID_STOPLOAD = 104, + + // Editing. + MENU_ID_UNDO = 110, + MENU_ID_REDO = 111, + MENU_ID_CUT = 112, + MENU_ID_COPY = 113, + MENU_ID_PASTE = 114, + MENU_ID_DELETE = 115, + MENU_ID_SELECT_ALL = 116, + + // Miscellaneous. + MENU_ID_FIND = 130, + MENU_ID_PRINT = 131, + MENU_ID_VIEW_SOURCE = 132, + + // Spell checking word correction suggestions. + MENU_ID_SPELLCHECK_SUGGESTION_0 = 200, + MENU_ID_SPELLCHECK_SUGGESTION_1 = 201, + MENU_ID_SPELLCHECK_SUGGESTION_2 = 202, + MENU_ID_SPELLCHECK_SUGGESTION_3 = 203, + MENU_ID_SPELLCHECK_SUGGESTION_4 = 204, + MENU_ID_SPELLCHECK_SUGGESTION_LAST = 204, + MENU_ID_NO_SPELLING_SUGGESTIONS = 205, + MENU_ID_ADD_TO_DICTIONARY = 206, + + // All user-defined menu IDs should come between MENU_ID_USER_FIRST and + // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges + // defined in the tools/gritsettings/resource_ids file. + MENU_ID_USER_FIRST = 26500, + MENU_ID_USER_LAST = 28500, +} cef_menu_id_t; + +/// +// Mouse button types. +/// +typedef enum { + MBT_LEFT = 0, + MBT_MIDDLE, + MBT_RIGHT, +} cef_mouse_button_type_t; + +/// +// Structure representing mouse event information. +/// +typedef struct _cef_mouse_event_t { + /// + // X coordinate relative to the left side of the view. + /// + int x; + + /// + // Y coordinate relative to the top side of the view. + /// + int y; + + /// + // Bit flags describing any pressed modifier keys. See + // cef_event_flags_t for values. + /// + uint32 modifiers; +} cef_mouse_event_t; + +/// +// Paint element types. +/// +typedef enum { + PET_VIEW = 0, + PET_POPUP, +} cef_paint_element_type_t; + +/// +// Supported event bit flags. +/// +typedef enum { + EVENTFLAG_NONE = 0, + EVENTFLAG_CAPS_LOCK_ON = 1 << 0, + EVENTFLAG_SHIFT_DOWN = 1 << 1, + EVENTFLAG_CONTROL_DOWN = 1 << 2, + EVENTFLAG_ALT_DOWN = 1 << 3, + EVENTFLAG_LEFT_MOUSE_BUTTON = 1 << 4, + EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5, + EVENTFLAG_RIGHT_MOUSE_BUTTON = 1 << 6, + // Mac OS-X command key. + EVENTFLAG_COMMAND_DOWN = 1 << 7, + EVENTFLAG_NUM_LOCK_ON = 1 << 8, + EVENTFLAG_IS_KEY_PAD = 1 << 9, + EVENTFLAG_IS_LEFT = 1 << 10, + EVENTFLAG_IS_RIGHT = 1 << 11, +} cef_event_flags_t; + +/// +// Supported menu item types. +/// +typedef enum { + MENUITEMTYPE_NONE, + MENUITEMTYPE_COMMAND, + MENUITEMTYPE_CHECK, + MENUITEMTYPE_RADIO, + MENUITEMTYPE_SEPARATOR, + MENUITEMTYPE_SUBMENU, +} cef_menu_item_type_t; + +/// +// Supported context menu type flags. +/// +typedef enum { + /// + // No node is selected. + /// + CM_TYPEFLAG_NONE = 0, + /// + // The top page is selected. + /// + CM_TYPEFLAG_PAGE = 1 << 0, + /// + // A subframe page is selected. + /// + CM_TYPEFLAG_FRAME = 1 << 1, + /// + // A link is selected. + /// + CM_TYPEFLAG_LINK = 1 << 2, + /// + // A media node is selected. + /// + CM_TYPEFLAG_MEDIA = 1 << 3, + /// + // There is a textual or mixed selection that is selected. + /// + CM_TYPEFLAG_SELECTION = 1 << 4, + /// + // An editable element is selected. + /// + CM_TYPEFLAG_EDITABLE = 1 << 5, +} cef_context_menu_type_flags_t; + +/// +// Supported context menu media types. +/// +typedef enum { + /// + // No special node is in context. + /// + CM_MEDIATYPE_NONE, + /// + // An image node is selected. + /// + CM_MEDIATYPE_IMAGE, + /// + // A video node is selected. + /// + CM_MEDIATYPE_VIDEO, + /// + // An audio node is selected. + /// + CM_MEDIATYPE_AUDIO, + /// + // A file node is selected. + /// + CM_MEDIATYPE_FILE, + /// + // A plugin node is selected. + /// + CM_MEDIATYPE_PLUGIN, +} cef_context_menu_media_type_t; + +/// +// Supported context menu media state bit flags. +/// +typedef enum { + CM_MEDIAFLAG_NONE = 0, + CM_MEDIAFLAG_ERROR = 1 << 0, + CM_MEDIAFLAG_PAUSED = 1 << 1, + CM_MEDIAFLAG_MUTED = 1 << 2, + CM_MEDIAFLAG_LOOP = 1 << 3, + CM_MEDIAFLAG_CAN_SAVE = 1 << 4, + CM_MEDIAFLAG_HAS_AUDIO = 1 << 5, + CM_MEDIAFLAG_HAS_VIDEO = 1 << 6, + CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT = 1 << 7, + CM_MEDIAFLAG_CAN_PRINT = 1 << 8, + CM_MEDIAFLAG_CAN_ROTATE = 1 << 9, +} cef_context_menu_media_state_flags_t; + +/// +// Supported context menu edit state bit flags. +/// +typedef enum { + CM_EDITFLAG_NONE = 0, + CM_EDITFLAG_CAN_UNDO = 1 << 0, + CM_EDITFLAG_CAN_REDO = 1 << 1, + CM_EDITFLAG_CAN_CUT = 1 << 2, + CM_EDITFLAG_CAN_COPY = 1 << 3, + CM_EDITFLAG_CAN_PASTE = 1 << 4, + CM_EDITFLAG_CAN_DELETE = 1 << 5, + CM_EDITFLAG_CAN_SELECT_ALL = 1 << 6, + CM_EDITFLAG_CAN_TRANSLATE = 1 << 7, +} cef_context_menu_edit_state_flags_t; + +/// +// Key event types. +/// +typedef enum { + /// + // Notification that a key transitioned from "up" to "down". + /// + KEYEVENT_RAWKEYDOWN = 0, + + /// + // Notification that a key was pressed. This does not necessarily correspond + // to a character depending on the key and language. Use KEYEVENT_CHAR for + // character input. + /// + KEYEVENT_KEYDOWN, + + /// + // Notification that a key was released. + /// + KEYEVENT_KEYUP, + + /// + // Notification that a character was typed. Use this for text input. Key + // down events may generate 0, 1, or more than one character event depending + // on the key, locale, and operating system. + /// + KEYEVENT_CHAR +} cef_key_event_type_t; + +/// +// Structure representing keyboard event information. +/// +typedef struct _cef_key_event_t { + /// + // The type of keyboard event. + /// + cef_key_event_type_t type; + + /// + // Bit flags describing any pressed modifier keys. See + // cef_event_flags_t for values. + /// + uint32 modifiers; + + /// + // The Windows key code for the key event. This value is used by the DOM + // specification. Sometimes it comes directly from the event (i.e. on + // Windows) and sometimes it's determined using a mapping function. See + // WebCore/platform/chromium/KeyboardCodes.h for the list of values. + /// + int windows_key_code; + + /// + // The actual key code genenerated by the platform. + /// + int native_key_code; + + /// + // Indicates whether the event is considered a "system key" event (see + // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details). + // This value will always be false on non-Windows platforms. + /// + int is_system_key; + + /// + // The character generated by the keystroke. + /// + char16 character; + + /// + // Same as |character| but unmodified by any concurrently-held modifiers + // (except shift). This is useful for working out shortcut keys. + /// + char16 unmodified_character; + + /// + // True if the focus is currently on an editable field on the page. This is + // useful for determining if standard key events should be intercepted. + /// + int focus_on_editable_field; +} cef_key_event_t; + +/// +// Focus sources. +/// +typedef enum { + /// + // The source is explicit navigation via the API (LoadURL(), etc). + /// + FOCUS_SOURCE_NAVIGATION = 0, + /// + // The source is a system-generated focus event. + /// + FOCUS_SOURCE_SYSTEM, +} cef_focus_source_t; + +/// +// Navigation types. +/// +typedef enum { + NAVIGATION_LINK_CLICKED = 0, + NAVIGATION_FORM_SUBMITTED, + NAVIGATION_BACK_FORWARD, + NAVIGATION_RELOAD, + NAVIGATION_FORM_RESUBMITTED, + NAVIGATION_OTHER, +} cef_navigation_type_t; + +/// +// Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and +// UTF16 (LE and BE) by default. All other types must be translated to UTF8 +// before being passed to the parser. If a BOM is detected and the correct +// decoder is available then that decoder will be used automatically. +/// +typedef enum { + XML_ENCODING_NONE = 0, + XML_ENCODING_UTF8, + XML_ENCODING_UTF16LE, + XML_ENCODING_UTF16BE, + XML_ENCODING_ASCII, +} cef_xml_encoding_type_t; + +/// +// XML node types. +/// +typedef enum { + XML_NODE_UNSUPPORTED = 0, + XML_NODE_PROCESSING_INSTRUCTION, + XML_NODE_DOCUMENT_TYPE, + XML_NODE_ELEMENT_START, + XML_NODE_ELEMENT_END, + XML_NODE_ATTRIBUTE, + XML_NODE_TEXT, + XML_NODE_CDATA, + XML_NODE_ENTITY_REFERENCE, + XML_NODE_WHITESPACE, + XML_NODE_COMMENT, +} cef_xml_node_type_t; + +/// +// Popup window features. +/// +typedef struct _cef_popup_features_t { + int x; + int xSet; + int y; + int ySet; + int width; + int widthSet; + int height; + int heightSet; + + int menuBarVisible; + int statusBarVisible; + int toolBarVisible; + int locationBarVisible; + int scrollbarsVisible; + int resizable; + + int fullscreen; + int dialog; + cef_string_list_t additionalFeatures; +} cef_popup_features_t; + +/// +// DOM document types. +/// +typedef enum { + DOM_DOCUMENT_TYPE_UNKNOWN = 0, + DOM_DOCUMENT_TYPE_HTML, + DOM_DOCUMENT_TYPE_XHTML, + DOM_DOCUMENT_TYPE_PLUGIN, +} cef_dom_document_type_t; + +/// +// DOM event category flags. +/// +typedef enum { + DOM_EVENT_CATEGORY_UNKNOWN = 0x0, + DOM_EVENT_CATEGORY_UI = 0x1, + DOM_EVENT_CATEGORY_MOUSE = 0x2, + DOM_EVENT_CATEGORY_MUTATION = 0x4, + DOM_EVENT_CATEGORY_KEYBOARD = 0x8, + DOM_EVENT_CATEGORY_TEXT = 0x10, + DOM_EVENT_CATEGORY_COMPOSITION = 0x20, + DOM_EVENT_CATEGORY_DRAG = 0x40, + DOM_EVENT_CATEGORY_CLIPBOARD = 0x80, + DOM_EVENT_CATEGORY_MESSAGE = 0x100, + DOM_EVENT_CATEGORY_WHEEL = 0x200, + DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400, + DOM_EVENT_CATEGORY_OVERFLOW = 0x800, + DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000, + DOM_EVENT_CATEGORY_POPSTATE = 0x2000, + DOM_EVENT_CATEGORY_PROGRESS = 0x4000, + DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000, +} cef_dom_event_category_t; + +/// +// DOM event processing phases. +/// +typedef enum { + DOM_EVENT_PHASE_UNKNOWN = 0, + DOM_EVENT_PHASE_CAPTURING, + DOM_EVENT_PHASE_AT_TARGET, + DOM_EVENT_PHASE_BUBBLING, +} cef_dom_event_phase_t; + +/// +// DOM node types. +/// +typedef enum { + DOM_NODE_TYPE_UNSUPPORTED = 0, + DOM_NODE_TYPE_ELEMENT, + DOM_NODE_TYPE_ATTRIBUTE, + DOM_NODE_TYPE_TEXT, + DOM_NODE_TYPE_CDATA_SECTION, + DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS, + DOM_NODE_TYPE_COMMENT, + DOM_NODE_TYPE_DOCUMENT, + DOM_NODE_TYPE_DOCUMENT_TYPE, + DOM_NODE_TYPE_DOCUMENT_FRAGMENT, +} cef_dom_node_type_t; + +/// +// Supported file dialog modes. +/// +typedef enum { + /// + // Requires that the file exists before allowing the user to pick it. + /// + FILE_DIALOG_OPEN = 0, + + /// + // Like Open, but allows picking multiple files to open. + /// + FILE_DIALOG_OPEN_MULTIPLE, + + /// + // Allows picking a nonexistent file, and prompts to overwrite if the file + // already exists. + /// + FILE_DIALOG_SAVE, +} cef_file_dialog_mode_t; + +/// +// Geoposition error codes. +/// +typedef enum { + GEOPOSITON_ERROR_NONE = 0, + GEOPOSITON_ERROR_PERMISSION_DENIED, + GEOPOSITON_ERROR_POSITION_UNAVAILABLE, + GEOPOSITON_ERROR_TIMEOUT, +} cef_geoposition_error_code_t; + +/// +// Structure representing geoposition information. The properties of this +// structure correspond to those of the JavaScript Position object although +// their types may differ. +/// +typedef struct _cef_geoposition_t { + /// + // Latitude in decimal degrees north (WGS84 coordinate frame). + /// + double latitude; + + /// + // Longitude in decimal degrees west (WGS84 coordinate frame). + /// + double longitude; + + /// + // Altitude in meters (above WGS84 datum). + /// + double altitude; + + /// + // Accuracy of horizontal position in meters. + /// + double accuracy; + + /// + // Accuracy of altitude in meters. + /// + double altitude_accuracy; + + /// + // Heading in decimal degrees clockwise from true north. + /// + double heading; + + /// + // Horizontal component of device velocity in meters per second. + /// + double speed; + + /// + // Time of position measurement in miliseconds since Epoch in UTC time. This + // is taken from the host computer's system clock. + /// + cef_time_t timestamp; + + /// + // Error code, see enum above. + /// + cef_geoposition_error_code_t error_code; + + /// + // Human-readable error message. + /// + cef_string_t error_message; +} cef_geoposition_t; + +/// +// Print job color mode values. +/// +typedef enum { + COLOR_MODEL_UNKNOWN, + COLOR_MODEL_GRAY, + COLOR_MODEL_COLOR, + COLOR_MODEL_CMYK, + COLOR_MODEL_CMY, + COLOR_MODEL_KCMY, + COLOR_MODEL_CMY_K, // CMY_K represents CMY+K. + COLOR_MODEL_BLACK, + COLOR_MODEL_GRAYSCALE, + COLOR_MODEL_RGB, + COLOR_MODEL_RGB16, + COLOR_MODEL_RGBA, + COLOR_MODEL_COLORMODE_COLOR, // Used in samsung printer ppds. + COLOR_MODEL_COLORMODE_MONOCHROME, // Used in samsung printer ppds. + COLOR_MODEL_HP_COLOR_COLOR, // Used in HP color printer ppds. + COLOR_MODEL_HP_COLOR_BLACK, // Used in HP color printer ppds. + COLOR_MODEL_PRINTOUTMODE_NORMAL, // Used in foomatic ppds. + COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY, // Used in foomatic ppds. + COLOR_MODEL_PROCESSCOLORMODEL_CMYK, // Used in canon printer ppds. + COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE, // Used in canon printer ppds. + COLOR_MODEL_PROCESSCOLORMODEL_RGB, // Used in canon printer ppds +} cef_color_model_t; + +/// +// Print job duplex mode values. +/// +typedef enum { + DUPLEX_MODE_UNKNOWN = -1, + DUPLEX_MODE_SIMPLEX, + DUPLEX_MODE_LONG_EDGE, + DUPLEX_MODE_SHORT_EDGE, +} cef_duplex_mode_t; + +/// +// Structure representing a print job page range. +/// +typedef struct _cef_page_range_t { + int from; + int to; +} cef_page_range_t; + +/// +// Cursor type values. +/// +typedef enum { + CT_POINTER = 0, + CT_CROSS, + CT_HAND, + CT_IBEAM, + CT_WAIT, + CT_HELP, + CT_EASTRESIZE, + CT_NORTHRESIZE, + CT_NORTHEASTRESIZE, + CT_NORTHWESTRESIZE, + CT_SOUTHRESIZE, + CT_SOUTHEASTRESIZE, + CT_SOUTHWESTRESIZE, + CT_WESTRESIZE, + CT_NORTHSOUTHRESIZE, + CT_EASTWESTRESIZE, + CT_NORTHEASTSOUTHWESTRESIZE, + CT_NORTHWESTSOUTHEASTRESIZE, + CT_COLUMNRESIZE, + CT_ROWRESIZE, + CT_MIDDLEPANNING, + CT_EASTPANNING, + CT_NORTHPANNING, + CT_NORTHEASTPANNING, + CT_NORTHWESTPANNING, + CT_SOUTHPANNING, + CT_SOUTHEASTPANNING, + CT_SOUTHWESTPANNING, + CT_WESTPANNING, + CT_MOVE, + CT_VERTICALTEXT, + CT_CELL, + CT_CONTEXTMENU, + CT_ALIAS, + CT_PROGRESS, + CT_NODROP, + CT_COPY, + CT_NONE, + CT_NOTALLOWED, + CT_ZOOMIN, + CT_ZOOMOUT, + CT_GRAB, + CT_GRABBING, + CT_CUSTOM, +} cef_cursor_type_t; + +/// +// Structure representing cursor information. |buffer| will be +// |size.width|*|size.height|*4 bytes in size and represents a BGRA image with +// an upper-left origin. +/// +typedef struct _cef_cursor_info_t { + cef_point_t hotspot; + float image_scale_factor; + void* buffer; + cef_size_t size; +} cef_cursor_info_t; + +#ifdef __cplusplus +} +#endif + +#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_ diff --git a/vendor/cef3/include/internal/cef_types_win.h b/vendor/cef3/include/internal/cef_types_win.h new file mode 100644 index 00000000000..27bf6053bd8 --- /dev/null +++ b/vendor/cef3/include/internal/cef_types_win.h @@ -0,0 +1,109 @@ +// Copyright (c) 2009 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ +#pragma once + +#include "include/base/cef_build.h" + +#if defined(OS_WIN) +#include +#include "include/internal/cef_string.h" + +// Handle types. +#define cef_cursor_handle_t HCURSOR +#define cef_event_handle_t MSG* +#define cef_window_handle_t HWND +#define cef_text_input_context_t void* + +#define kNullCursorHandle NULL +#define kNullEventHandle NULL +#define kNullWindowHandle NULL + +#ifdef __cplusplus +extern "C" { +#endif + +/// +// Structure representing CefExecuteProcess arguments. +/// +typedef struct _cef_main_args_t { + HINSTANCE instance; +} cef_main_args_t; + +/// +// Structure representing window information. +/// +typedef struct _cef_window_info_t { + // Standard parameters required by CreateWindowEx() + DWORD ex_style; + cef_string_t window_name; + DWORD style; + int x; + int y; + int width; + int height; + cef_window_handle_t parent_window; + HMENU menu; + + /// + // Set to true (1) to create the browser using windowless (off-screen) + // rendering. No window will be created for the browser and all rendering will + // occur via the CefRenderHandler interface. The |parent_window| value will be + // used to identify monitor info and to act as the parent window for dialogs, + // context menus, etc. If |parent_window| is not provided then the main screen + // monitor will be used and some functionality that requires a parent window + // may not function correctly. In order to create windowless browsers the + // CefSettings.windowless_rendering_enabled value must be set to true. + /// + int windowless_rendering_enabled; + + /// + // Set to true (1) to enable transparent painting in combination with + // windowless rendering. When this value is true a transparent background + // color will be used (RGBA=0x00000000). When this value is false the + // background will be white and opaque. + /// + int transparent_painting_enabled; + + /// + // Handle for the new browser window. Only used with windowed rendering. + /// + cef_window_handle_t window; +} cef_window_info_t; + +#ifdef __cplusplus +} +#endif + +#endif // OS_WIN + +#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WIN_H_ diff --git a/vendor/cef3/include/internal/cef_types_wrappers.h b/vendor/cef3/include/internal/cef_types_wrappers.h new file mode 100644 index 00000000000..9a4036d9c9c --- /dev/null +++ b/vendor/cef3/include/internal/cef_types_wrappers.h @@ -0,0 +1,780 @@ +// Copyright (c) 2013 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_ +#define CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_ +#pragma once + +#include "include/internal/cef_string.h" +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_types.h" + +/// +// Template class that provides common functionality for CEF structure wrapping. +/// +template +class CefStructBase : public traits::struct_type { + public: + typedef typename traits::struct_type struct_type; + + CefStructBase() : attached_to_(NULL) { + Init(); + } + virtual ~CefStructBase() { + // Only clear this object's data if it isn't currently attached to a + // structure. + if (!attached_to_) + Clear(this); + } + + CefStructBase(const CefStructBase& r) { + Init(); + *this = r; + } + CefStructBase(const struct_type& r) { // NOLINT(runtime/explicit) + Init(); + *this = r; + } + + /// + // Clear this object's values. + /// + void Reset() { + Clear(this); + Init(); + } + + /// + // Attach to the source structure's existing values. DetachTo() can be called + // to insert the values back into the existing structure. + /// + void AttachTo(struct_type& source) { + // Only clear this object's data if it isn't currently attached to a + // structure. + if (!attached_to_) + Clear(this); + + // This object is now attached to the new structure. + attached_to_ = &source; + + // Transfer ownership of the values from the source structure. + memcpy(static_cast(this), &source, sizeof(struct_type)); + } + + /// + // Relinquish ownership of values to the target structure. + /// + void DetachTo(struct_type& target) { + if (attached_to_ != &target) { + // Clear the target structure's values only if we are not currently + // attached to that structure. + Clear(&target); + } + + // Transfer ownership of the values to the target structure. + memcpy(&target, static_cast(this), sizeof(struct_type)); + + // Remove the references from this object. + Init(); + } + + /// + // Set this object's values. If |copy| is true the source structure's values + // will be copied instead of referenced. + /// + void Set(const struct_type& source, bool copy) { + traits::set(&source, this, copy); + } + + CefStructBase& operator=(const CefStructBase& s) { + return operator=(static_cast(s)); + } + + CefStructBase& operator=(const struct_type& s) { + Set(s, true); + return *this; + } + + protected: + void Init() { + memset(static_cast(this), 0, sizeof(struct_type)); + attached_to_ = NULL; + traits::init(this); + } + + static void Clear(struct_type* s) { traits::clear(s); } + + struct_type* attached_to_; +}; + + +struct CefPointTraits { + typedef cef_point_t struct_type; + + 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) { + *target = *src; + } +}; + +/// +// Class representing a point. +/// +class CefPoint : public CefStructBase { + public: + typedef CefStructBase parent; + + CefPoint() : parent() {} + CefPoint(const cef_point_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefPoint(const CefPoint& r) : parent(r) {} // NOLINT(runtime/explicit) + CefPoint(int x, int y) : parent() { + Set(x, y); + } + + bool IsEmpty() const { return x <= 0 && y <= 0; } + void Set(int x, int y) { + this->x = x, this->y = y; + } +}; + +inline bool operator==(const CefPoint& a, const CefPoint& b) { + return a.x == b.x && a.y == b.y; +} + +inline bool operator!=(const CefPoint& a, const CefPoint& b) { + return !(a == b); +} + + +struct CefRectTraits { + typedef cef_rect_t struct_type; + + 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) { + *target = *src; + } +}; + +/// +// Class representing a rectangle. +/// +class CefRect : public CefStructBase { + public: + typedef CefStructBase parent; + + CefRect() : parent() {} + CefRect(const cef_rect_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefRect(const CefRect& r) : parent(r) {} // NOLINT(runtime/explicit) + CefRect(int x, int y, int width, int height) : parent() { + Set(x, y, width, height); + } + + bool IsEmpty() const { return width <= 0 || height <= 0; } + void Set(int x, int y, int width, int height) { + this->x = x, this->y = y, this->width = width, this->height = height; + } +}; + +inline bool operator==(const CefRect& a, const CefRect& b) { + return a.x == b.x && a.y == b.y && a.width == b.width && a.height == b.height; +} + +inline bool operator!=(const CefRect& a, const CefRect& b) { + return !(a == b); +} + + +struct CefSizeTraits { + typedef cef_size_t struct_type; + + 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) { + *target = *src; + } +}; + +/// +// Class representing a size. +/// +class CefSize : public CefStructBase { + public: + typedef CefStructBase parent; + + CefSize() : parent() {} + CefSize(const cef_size_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefSize(const CefSize& r) : parent(r) {} // NOLINT(runtime/explicit) + CefSize(int width, int height) : parent() { + Set(width, height); + } + + bool IsEmpty() const { return width <= 0 || height <= 0; } + void Set(int width, int height) { + this->width = width, this->height = height; + } +}; + +inline bool operator==(const CefSize& a, const CefSize& b) { + return a.width == b.width && a.height == b.height; +} + +inline bool operator!=(const CefSize& a, const CefSize& b) { + return !(a == b); +} + + +struct CefScreenInfoTraits { + typedef cef_screen_info_t struct_type; + + 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) { + target->device_scale_factor = src->device_scale_factor; + target->depth = src->depth; + target->depth_per_component = src->depth_per_component; + target->is_monochrome = src->is_monochrome; + target->rect = src->rect; + target->available_rect = src->available_rect; + } +}; + +/// +// Class representing the virtual screen information for use when window rendering +// is disabled. +/// +class CefScreenInfo : public CefStructBase { + public: + typedef CefStructBase parent; + + CefScreenInfo() : parent() {} + CefScreenInfo(const cef_screen_info_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefScreenInfo(const CefScreenInfo& r) : parent(r) {} // NOLINT(runtime/explicit) + CefScreenInfo(float device_scale_factor, + int depth, + int depth_per_component, + bool is_monochrome, + const CefRect& rect, + const CefRect& available_rect) : parent() { + Set(device_scale_factor, depth, depth_per_component, + is_monochrome, rect, available_rect); + } + + void Set(float device_scale_factor, + int depth, + int depth_per_component, + bool is_monochrome, + const CefRect& rect, + const CefRect& available_rect) { + this->device_scale_factor = device_scale_factor; + this->depth = depth; + this->depth_per_component = depth_per_component; + this->is_monochrome = is_monochrome; + this->rect = rect; + this->available_rect = available_rect; + } +}; + + +struct CefKeyEventTraits { + typedef cef_key_event_t struct_type; + + 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) { + target->type = src->type; + target->modifiers = src->modifiers; + target->windows_key_code = src->windows_key_code; + target->native_key_code = src->native_key_code; + target->is_system_key = src->is_system_key; + target->character = src->character; + target->unmodified_character = src->unmodified_character; + target->focus_on_editable_field = src->focus_on_editable_field; + } +}; + +/// +// Class representing a a keyboard event. +/// +typedef CefStructBase CefKeyEvent; + + +struct CefMouseEventTraits { + typedef cef_mouse_event_t struct_type; + + 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) { + target->x = src->x; + target->y = src->y; + target->modifiers = src->modifiers; + } +}; + +/// +// Class representing a mouse event. +/// +typedef CefStructBase CefMouseEvent; + + +struct CefPopupFeaturesTraits { + typedef cef_popup_features_t struct_type; + + static inline void init(struct_type* s) { + s->menuBarVisible = true; + s->statusBarVisible = true; + s->toolBarVisible = true; + s->locationBarVisible = true; + s->scrollbarsVisible = true; + s->resizable = true; + } + + static inline void clear(struct_type* s) { + if (s->additionalFeatures) + cef_string_list_free(s->additionalFeatures); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + if (target->additionalFeatures) + cef_string_list_free(target->additionalFeatures); + target->additionalFeatures = src->additionalFeatures ? + cef_string_list_copy(src->additionalFeatures) : NULL; + + target->x = src->x; + target->xSet = src->xSet; + target->y = src->y; + target->ySet = src->ySet; + target->width = src->width; + target->widthSet = src->widthSet; + target->height = src->height; + target->heightSet = src->heightSet; + target->menuBarVisible = src->menuBarVisible; + target->statusBarVisible = src->statusBarVisible; + target->toolBarVisible = src->toolBarVisible; + target->locationBarVisible = src->locationBarVisible; + target->scrollbarsVisible = src->scrollbarsVisible; + target->resizable = src->resizable; + target->fullscreen = src->fullscreen; + target->dialog = src->dialog; + } +}; + +/// +// Class representing popup window features. +/// +typedef CefStructBase CefPopupFeatures; + + +struct CefSettingsTraits { + typedef cef_settings_t struct_type; + + static inline void init(struct_type* s) { + s->size = sizeof(struct_type); + } + + static inline void clear(struct_type* s) { + cef_string_clear(&s->browser_subprocess_path); + cef_string_clear(&s->cache_path); + cef_string_clear(&s->user_agent); + cef_string_clear(&s->product_version); + cef_string_clear(&s->locale); + cef_string_clear(&s->log_file); + cef_string_clear(&s->javascript_flags); + cef_string_clear(&s->resources_dir_path); + cef_string_clear(&s->locales_dir_path); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->single_process = src->single_process; + target->no_sandbox = src->no_sandbox; + cef_string_set(src->browser_subprocess_path.str, + src->browser_subprocess_path.length, + &target->browser_subprocess_path, copy); + target->multi_threaded_message_loop = src->multi_threaded_message_loop; + target->windowless_rendering_enabled = src->windowless_rendering_enabled; + target->command_line_args_disabled = src->command_line_args_disabled; + + cef_string_set(src->cache_path.str, src->cache_path.length, + &target->cache_path, copy); + target->persist_session_cookies = src->persist_session_cookies; + + cef_string_set(src->user_agent.str, src->user_agent.length, + &target->user_agent, copy); + cef_string_set(src->product_version.str, src->product_version.length, + &target->product_version, copy); + cef_string_set(src->locale.str, src->locale.length, &target->locale, copy); + + cef_string_set(src->log_file.str, src->log_file.length, &target->log_file, + copy); + target->log_severity = src->log_severity; + cef_string_set(src->javascript_flags.str, src->javascript_flags.length, + &target->javascript_flags, copy); + + cef_string_set(src->resources_dir_path.str, src->resources_dir_path.length, + &target->resources_dir_path, copy); + cef_string_set(src->locales_dir_path.str, src->locales_dir_path.length, + &target->locales_dir_path, copy); + target->pack_loading_disabled = src->pack_loading_disabled; + target->remote_debugging_port = src->remote_debugging_port; + target->uncaught_exception_stack_size = src->uncaught_exception_stack_size; + target->context_safety_implementation = src->context_safety_implementation; + target->ignore_certificate_errors = src->ignore_certificate_errors; + target->background_color = src->background_color; + } +}; + +/// +// Class representing initialization settings. +/// +typedef CefStructBase CefSettings; + + +struct CefBrowserSettingsTraits { + typedef cef_browser_settings_t struct_type; + + static inline void init(struct_type* s) { + s->size = sizeof(struct_type); + } + + static inline void clear(struct_type* s) { + cef_string_clear(&s->standard_font_family); + cef_string_clear(&s->fixed_font_family); + cef_string_clear(&s->serif_font_family); + cef_string_clear(&s->sans_serif_font_family); + cef_string_clear(&s->cursive_font_family); + cef_string_clear(&s->fantasy_font_family); + cef_string_clear(&s->default_encoding); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->windowless_frame_rate = src->windowless_frame_rate; + + cef_string_set(src->standard_font_family.str, + src->standard_font_family.length, &target->standard_font_family, copy); + cef_string_set(src->fixed_font_family.str, src->fixed_font_family.length, + &target->fixed_font_family, copy); + cef_string_set(src->serif_font_family.str, src->serif_font_family.length, + &target->serif_font_family, copy); + cef_string_set(src->sans_serif_font_family.str, + src->sans_serif_font_family.length, &target->sans_serif_font_family, + copy); + cef_string_set(src->cursive_font_family.str, + src->cursive_font_family.length, &target->cursive_font_family, copy); + cef_string_set(src->fantasy_font_family.str, + src->fantasy_font_family.length, &target->fantasy_font_family, copy); + + target->default_font_size = src->default_font_size; + target->default_fixed_font_size = src->default_fixed_font_size; + target->minimum_font_size = src->minimum_font_size; + target->minimum_logical_font_size = src->minimum_logical_font_size; + + cef_string_set(src->default_encoding.str, src->default_encoding.length, + &target->default_encoding, copy); + + target->remote_fonts = src->remote_fonts; + target->javascript = src->javascript; + target->javascript_open_windows = src->javascript_open_windows; + target->javascript_close_windows = src->javascript_close_windows; + target->javascript_access_clipboard = src->javascript_access_clipboard; + target->javascript_dom_paste = src->javascript_dom_paste; + target->caret_browsing = src->caret_browsing; + target->java = src->java; + target->plugins = src->plugins; + target->universal_access_from_file_urls = + src->universal_access_from_file_urls; + target->file_access_from_file_urls = src->file_access_from_file_urls; + target->web_security = src->web_security; + target->image_loading = src->image_loading; + target->image_shrink_standalone_to_fit = + src->image_shrink_standalone_to_fit; + target->text_area_resize = src->text_area_resize; + target->tab_to_links = src->tab_to_links; + target->local_storage = src->local_storage; + target->databases= src->databases; + target->application_cache = src->application_cache; + target->webgl = src->webgl; + + target->background_color = src->background_color; + } +}; + +/// +// Class representing browser initialization settings. +/// +typedef CefStructBase CefBrowserSettings; + + +struct CefURLPartsTraits { + typedef cef_urlparts_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->spec); + cef_string_clear(&s->scheme); + cef_string_clear(&s->username); + cef_string_clear(&s->password); + cef_string_clear(&s->host); + cef_string_clear(&s->port); + cef_string_clear(&s->origin); + cef_string_clear(&s->path); + cef_string_clear(&s->query); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + cef_string_set(src->spec.str, src->spec.length, &target->spec, copy); + cef_string_set(src->scheme.str, src->scheme.length, &target->scheme, copy); + cef_string_set(src->username.str, src->username.length, &target->username, + copy); + cef_string_set(src->password.str, src->password.length, &target->password, + copy); + cef_string_set(src->host.str, src->host.length, &target->host, copy); + cef_string_set(src->port.str, src->port.length, &target->port, copy); + cef_string_set(src->origin.str, src->origin.length, &target->origin, copy); + cef_string_set(src->path.str, src->path.length, &target->path, copy); + cef_string_set(src->query.str, src->query.length, &target->query, copy); + } +}; + +/// +// Class representing a URL's component parts. +/// +typedef CefStructBase CefURLParts; + + +struct CefTimeTraits { + typedef cef_time_t struct_type; + + 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) { + *target = *src; + } +}; + +/// +// Class representing a time. +/// +class CefTime : public CefStructBase { + public: + typedef CefStructBase parent; + + CefTime() : parent() {} + CefTime(const cef_time_t& r) : parent(r) {} // NOLINT(runtime/explicit) + CefTime(const CefTime& r) : parent(r) {} // NOLINT(runtime/explicit) + explicit CefTime(time_t r) : parent() { SetTimeT(r); } + explicit CefTime(double r) : parent() { SetDoubleT(r); } + + // Converts to/from time_t. + void SetTimeT(time_t r) { + cef_time_from_timet(r, this); + } + time_t GetTimeT() const { + time_t time = 0; + cef_time_to_timet(this, &time); + return time; + } + + // Converts to/from a double which is the number of seconds since epoch + // (Jan 1, 1970). Webkit uses this format to represent time. A value of 0 + // means "not initialized". + void SetDoubleT(double r) { + cef_time_from_doublet(r, this); + } + double GetDoubleT() const { + double time = 0; + cef_time_to_doublet(this, &time); + return time; + } + + // Set this object to now. + void Now() { + cef_time_now(this); + } + + // Return the delta between this object and |other| in milliseconds. + long long Delta(const CefTime& other) { + long long delta = 0; + cef_time_delta(this, &other, &delta); + return delta; + } +}; + + +struct CefCookieTraits { + typedef cef_cookie_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->name); + cef_string_clear(&s->value); + cef_string_clear(&s->domain); + cef_string_clear(&s->path); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + cef_string_set(src->name.str, src->name.length, &target->name, copy); + cef_string_set(src->value.str, src->value.length, &target->value, copy); + cef_string_set(src->domain.str, src->domain.length, &target->domain, copy); + cef_string_set(src->path.str, src->path.length, &target->path, copy); + target->secure = src->secure; + target->httponly = src->httponly; + target->creation = src->creation; + target->last_access = src->last_access; + target->has_expires = src->has_expires; + target->expires = src->expires; + } +}; + +/// +// Class representing a cookie. +/// +typedef CefStructBase CefCookie; + + +struct CefGeopositionTraits { + typedef cef_geoposition_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->error_message); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->latitude = src->latitude; + target->longitude = src->longitude; + target->altitude = src->altitude; + target->accuracy = src->accuracy; + target->altitude_accuracy = src->altitude_accuracy; + target->heading = src->heading; + target->speed = src->speed; + target->timestamp = src->timestamp; + target->error_code = src->error_code; + cef_string_set(src->error_message.str, src->error_message.length, + &target->error_message, copy); + } +}; + +/// +// Class representing a geoposition. +/// +typedef CefStructBase CefGeoposition; + + +struct CefPageRangeTraits { + typedef cef_page_range_t struct_type; + + 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) { + *target = *src; + } +}; + +/// +// Class representing a print job page range. +/// +class CefPageRange : public CefStructBase { + public: + typedef CefStructBase parent; + + CefPageRange() : parent() {} + CefPageRange(const cef_page_range_t& r) // NOLINT(runtime/explicit) + : parent(r) {} + CefPageRange(const CefPageRange& r) // NOLINT(runtime/explicit) + : parent(r) {} + CefPageRange(int from, int to) : parent() { + Set(from, to); + } + + void Set(int from, int to) { + this->from = from, this->to = to; + } +}; + +inline bool operator==(const CefPageRange& a, const CefPageRange& b) { + return a.from == b.from && a.to == b.to; +} + +inline bool operator!=(const CefPageRange& a, const CefPageRange& b) { + return !(a == b); +} + + +struct CefCursorInfoTraits { + typedef cef_cursor_info_t struct_type; + + 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) { + target->hotspot = src->hotspot; + target->image_scale_factor = src->image_scale_factor; + target->buffer = src->buffer; + target->size = src->size; + } +}; + +/// +// Class representing cursor information. +/// +typedef CefStructBase CefCursorInfo; + +#endif // CEF_INCLUDE_INTERNAL_CEF_TYPES_WRAPPERS_H_ diff --git a/vendor/cef3/include/internal/cef_win.h b/vendor/cef3/include/internal/cef_win.h new file mode 100644 index 00000000000..7361a3ce4c5 --- /dev/null +++ b/vendor/cef3/include/internal/cef_win.h @@ -0,0 +1,156 @@ +// Copyright (c) 2008 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +#ifndef CEF_INCLUDE_INTERNAL_CEF_WIN_H_ +#define CEF_INCLUDE_INTERNAL_CEF_WIN_H_ +#pragma once + +#include "include/internal/cef_types_win.h" +#include "include/internal/cef_types_wrappers.h" + +/// +// Handle types. +/// +#define CefCursorHandle cef_cursor_handle_t +#define CefEventHandle cef_event_handle_t +#define CefWindowHandle cef_window_handle_t +#define CefTextInputContext cef_text_input_context_t + +struct CefMainArgsTraits { + typedef cef_main_args_t struct_type; + + 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) { + target->instance = src->instance; + } +}; + +// Class representing CefExecuteProcess arguments. +class CefMainArgs : public CefStructBase { + public: + typedef CefStructBase parent; + + CefMainArgs() : parent() {} + explicit CefMainArgs(const cef_main_args_t& r) : parent(r) {} + explicit CefMainArgs(const CefMainArgs& r) : parent(r) {} + explicit CefMainArgs(HINSTANCE hInstance) : parent() { + instance = hInstance; + } +}; + +struct CefWindowInfoTraits { + typedef cef_window_info_t struct_type; + + static inline void init(struct_type* s) {} + + static inline void clear(struct_type* s) { + cef_string_clear(&s->window_name); + } + + static inline void set(const struct_type* src, struct_type* target, + bool copy) { + target->ex_style = src->ex_style; + cef_string_set(src->window_name.str, src->window_name.length, + &target->window_name, copy); + target->style = src->style; + target->x = src->x; + target->y = src->y; + target->width = src->width; + target->height = src->height; + target->parent_window = src->parent_window; + target->menu = src->menu; + target->transparent_painting_enabled = src->transparent_painting_enabled; + target->windowless_rendering_enabled = src->windowless_rendering_enabled; + target->window = src->window; + } +}; + +/// +// Class representing window information. +/// +class CefWindowInfo : public CefStructBase { + public: + typedef CefStructBase parent; + + CefWindowInfo() : parent() {} + explicit CefWindowInfo(const cef_window_info_t& r) : parent(r) {} + explicit CefWindowInfo(const CefWindowInfo& r) : parent(r) {} + + /// + // Create the browser as a child window. + /// + void SetAsChild(CefWindowHandle parent, RECT windowRect) { + style = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_TABSTOP | + WS_VISIBLE; + parent_window = parent; + x = windowRect.left; + y = windowRect.top; + width = windowRect.right - windowRect.left; + height = windowRect.bottom - windowRect.top; + } + + /// + // Create the browser as a popup window. + /// + void SetAsPopup(CefWindowHandle parent, const CefString& windowName) { + style = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | + WS_VISIBLE; + parent_window = parent; + x = CW_USEDEFAULT; + y = CW_USEDEFAULT; + width = CW_USEDEFAULT; + height = CW_USEDEFAULT; + + cef_string_copy(windowName.c_str(), windowName.length(), &window_name); + } + + /// + // Create the browser using windowless (off-screen) rendering. No window + // will be created for the browser and all rendering will occur via the + // CefRenderHandler interface. The |parent| value will be used to identify + // monitor info and to act as the parent window for dialogs, context menus, + // etc. If |parent| is not provided then the main screen monitor will be used + // and some functionality that requires a parent window may not function + // correctly. If |transparent| is true a transparent background color will be + // used (RGBA=0x00000000). If |transparent| is false the background will be + // white and opaque. In order to create windowless browsers the + // CefSettings.windowless_rendering_enabled value must be set to true. + /// + void SetAsWindowless(CefWindowHandle parent, bool transparent) { + windowless_rendering_enabled = TRUE; + parent_window = parent; + transparent_painting_enabled = transparent; + } +}; + +#endif // CEF_INCLUDE_INTERNAL_CEF_WIN_H_ diff --git a/vendor/cef3/include/wrapper/cef_byte_read_handler.h b/vendor/cef3/include/wrapper/cef_byte_read_handler.h new file mode 100644 index 00000000000..559cdd81885 --- /dev/null +++ b/vendor/cef3/include/wrapper/cef_byte_read_handler.h @@ -0,0 +1,79 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_ +#define CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_ +#pragma once + +#include "include/base/cef_lock.h" +#include "include/base/cef_macros.h" +#include "include/cef_base.h" +#include "include/cef_stream.h" + +/// +// Thread safe implementation of the CefReadHandler class for reading an +// in-memory array of bytes. +/// +class CefByteReadHandler : public CefReadHandler { + public: + /// + // Create a new object for reading an array of bytes. An optional |source| + // reference can be kept to keep the underlying data source from being + // released while the reader exists. + /// + CefByteReadHandler(const unsigned char* bytes, + size_t size, + CefRefPtr source); + + // CefReadHandler methods. + virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; + virtual int Eof() OVERRIDE; + virtual bool MayBlock() OVERRIDE { return false; } + + private: + const unsigned char* bytes_; + int64 size_; + int64 offset_; + CefRefPtr source_; + + base::Lock lock_; + + IMPLEMENT_REFCOUNTING(CefByteReadHandler); + DISALLOW_COPY_AND_ASSIGN(CefByteReadHandler); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_BYTE_READ_HANDLER_H_ diff --git a/vendor/cef3/include/wrapper/cef_closure_task.h b/vendor/cef3/include/wrapper/cef_closure_task.h new file mode 100644 index 00000000000..8828c656662 --- /dev/null +++ b/vendor/cef3/include/wrapper/cef_closure_task.h @@ -0,0 +1,101 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ +#define CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ +#pragma once + +#include "include/base/cef_callback_forward.h" +#include "include/base/cef_macros.h" +#include "include/cef_task.h" + +/// +// Helpers for asynchronously executing a base::Closure (bound function or +// method) on a CEF thread. Creation of base::Closures can be facilitated using +// base::Bind. See include/base/cef_callback.h for complete usage instructions. +// +// TO use these helpers you should include this header and the header that +// defines base::Bind. +// +// #include "include/base/cef_bind.h" +// #include "include/wrapper/cef_closure_task.h" +// +// Example of executing a bound function: +// +// // Define a function. +// void MyFunc(int arg) { /* do something with |arg| on the UI thread */ } +// +// // Post a task that will execute MyFunc on the UI thread and pass an |arg| +// // value of 5. +// CefPostTask(TID_UI, base::Bind(&MyFunc, 5)); +// +// Example of executing a bound method: +// +// // Define a class. +// class MyClass : public CefBase { +// public: +// MyClass() {} +// void MyMethod(int arg) { /* do something with |arg| on the UI thread */ } +// private: +// IMPLEMENT_REFCOUNTING(MyClass); +// }; +// +// // Create an instance of MyClass. +// CefRefPtr instance = new MyClass(); +// +// // Post a task that will execute MyClass::MyMethod on the UI thread and pass +// // an |arg| value of 5. |instance| will be kept alive until after the task +// // completes. +// CefPostTask(TID_UI, base::Bind(&MyClass::MyMethod, instance, 5)); +/// + +/// +// Create a CefTask that wraps a base::Closure. Can be used in combination with +// CefTaskRunner. +/// +CefRefPtr CefCreateClosureTask(const base::Closure& closure); + +/// +// Post a Closure for execution on the specified thread. +/// +bool CefPostTask(CefThreadId threadId, const base::Closure& closure); + +/// +// Post a Closure for delayed execution on the specified thread. +/// +bool CefPostDelayedTask(CefThreadId threadId, const base::Closure& closure, + int64 delay_ms); + +#endif // CEF_INCLUDE_WRAPPER_CEF_CLOSURE_TASK_H_ diff --git a/vendor/cef3/include/wrapper/cef_helpers.h b/vendor/cef3/include/wrapper/cef_helpers.h new file mode 100644 index 00000000000..3624c74dbeb --- /dev/null +++ b/vendor/cef3/include/wrapper/cef_helpers.h @@ -0,0 +1,81 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_ +#define CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_ +#pragma once + +#include +#include +#include + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_task.h" + +#define CEF_REQUIRE_UI_THREAD() DCHECK(CefCurrentlyOn(TID_UI)); +#define CEF_REQUIRE_IO_THREAD() DCHECK(CefCurrentlyOn(TID_IO)); +#define CEF_REQUIRE_FILE_THREAD() DCHECK(CefCurrentlyOn(TID_FILE)); +#define CEF_REQUIRE_RENDERER_THREAD() DCHECK(CefCurrentlyOn(TID_RENDERER)); + +/// +// Helper class to manage a scoped copy of |argv|. +/// +class CefScopedArgArray { + public: + CefScopedArgArray(int argc, char* argv[]) { + array_ = new char*[argc]; + for (int i = 0; i < argc; ++i) { + values_.push_back(argv[i]); + array_[i] = const_cast(values_[i].c_str()); + } + } + ~CefScopedArgArray() { + delete [] array_; + } + + char** array() const { return array_; } + + private: + char** array_; + + // Keep values in a vector separate from |array_| because various users may + // modify |array_| and we still want to clean up memory properly. + std::vector values_; + + DISALLOW_COPY_AND_ASSIGN(CefScopedArgArray); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_HELPERS_H_ diff --git a/vendor/cef3/include/wrapper/cef_message_router.h b/vendor/cef3/include/wrapper/cef_message_router.h new file mode 100644 index 00000000000..2a6fcfe6f60 --- /dev/null +++ b/vendor/cef3/include/wrapper/cef_message_router.h @@ -0,0 +1,428 @@ +// Copyright (c) 2014 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_ +#define CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_ +#pragma once + +#include "include/base/cef_ref_counted.h" +#include "include/cef_base.h" +#include "include/cef_browser.h" +#include "include/cef_process_message.h" +#include "include/cef_v8.h" + +// The below classes implement support for routing aynchronous messages between +// JavaScript running in the renderer process and C++ running in the browser +// process. An application interacts with the router by passing it data from +// standard CEF C++ callbacks (OnBeforeBrowse, OnProcessMessageRecieved, +// OnContextCreated, etc). The renderer-side router supports generic JavaScript +// callback registration and execution while the browser-side router supports +// application-specific logic via one or more application-provided Handler +// instances. +// +// The renderer-side router implementation exposes a query function and a cancel +// function via the JavaScript 'window' object: +// +// // Create and send a new query. +// var request_id = window.cefQuery({ +// request: 'my_request', +// persistent: false, +// onSuccess: function(response) {}, +// onFailure: function(error_code, error_message) {} +// }); +// +// // Optionally cancel the query. +// window.cefQueryCancel(request_id); +// +// When |window.cefQuery| is executed the request is sent asynchronously to one +// or more C++ Handler objects registered in the browser process. Each C++ +// Handler can choose to either handle or ignore the query in the +// Handler::OnQuery callback. If a Handler chooses to handle the query then it +// should execute Callback::Success when a response is available or +// Callback::Failure if an error occurs. This will result in asynchronous +// execution of the associated JavaScript callback in the renderer process. Any +// queries unhandled by C++ code in the browser process will be automatically +// canceled and the associated JavaScript onFailure callback will be executed +// with an error code of -1. +// +// Queries can be either persistent or non-persistent. If the query is +// persistent than the callbacks will remain registered until one of the +// following conditions are met: +// +// A. The query is canceled in JavaScript using the |window.cefQueryCancel| +// function. +// B. The query is canceled in C++ code using the Callback::Failure function. +// C. The context associated with the query is released due to browser +// destruction, navigation or renderer process termination. +// +// If the query is non-persistent then the registration will be removed after +// the JavaScript callback is executed a single time. If a query is canceled for +// a reason other than Callback::Failure being executed then the associated +// Handler's OnQueryCanceled method will be called. +// +// Some possible usage patterns include: +// +// One-time Request. Use a non-persistent query to send a JavaScript request. +// The Handler evaluates the request and returns the response. The query is +// then discarded. +// +// Broadcast. Use a persistent query to register as a JavaScript broadcast +// receiver. The Handler keeps track of all registered Callbacks and executes +// them sequentially to deliver the broadcast message. +// +// Subscription. Use a persistent query to register as a JavaScript subscription +// receiver. The Handler initiates the subscription feed on the first request +// and delivers responses to all registered subscribers as they become +// available. The Handler cancels the subscription feed when there are no +// longer any registered JavaScript receivers. +// +// Message routing occurs on a per-browser and per-context basis. Consequently, +// additional application logic can be applied by restricting which browser or +// context instances are passed into the router. If you choose to use this +// approach do so cautiously. In order for the router to function correctly any +// browser or context instance passed into a single router callback must then +// be passed into all router callbacks. +// +// There is generally no need to have multiple renderer-side routers unless you +// wish to have multiple bindings with different JavaScript function names. It +// can be useful to have multiple browser-side routers with different client- +// provided Handler instances when implementing different behaviors on a per- +// browser basis. +// +// This implementation places no formatting restrictions on payload content. +// An application may choose to exchange anything from simple formatted +// strings to serialized XML or JSON data. +// +// +// EXAMPLE USAGE +// +// 1. Define the router configuration. You can optionally specify settings +// like the JavaScript function names. The configuration must be the same in +// both the browser and renderer processes. If using multiple routers in the +// same application make sure to specify unique function names for each +// router configuration. +// +// // Example config object showing the default values. +// CefMessageRouterConfig config; +// config.js_query_function = "cefQuery"; +// config.js_cancel_function = "cefQueryCancel"; +// +// 2. Create an instance of CefMessageRouterBrowserSide in the browser process. +// You might choose to make it a member of your CefClient implementation, +// for example. +// +// browser_side_router_ = CefMessageRouterBrowserSide::Create(config); +// +// 3. Register one or more Handlers. The Handler instances must either outlive +// the router or be removed from the router before they're deleted. +// +// browser_side_router_->AddHandler(my_handler); +// +// 4. Call all required CefMessageRouterBrowserSide methods from other callbacks +// in your CefClient implementation (OnBeforeClose, etc). See the +// CefMessageRouterBrowserSide class documentation for the complete list of +// methods. +// +// 5. Create an instance of CefMessageRouterRendererSide in the renderer process. +// You might choose to make it a member of your CefApp implementation, for +// example. +// +// renderer_side_router_ = CefMessageRouterRendererSide::Create(config); +// +// 6. Call all required CefMessageRouterRendererSide methods from other +// callbacks in your CefRenderProcessHandler implementation +// (OnContextCreated, etc). See the CefMessageRouterRendererSide class +// documentation for the complete list of methods. +// +// 7. Execute the query function from JavaScript code. +// +// window.cefQuery({request: 'my_request', +// persistent: false, +// onSuccess: function(response) { print(response); }, +// onFailure: function(error_code, error_message) {} }); +// +// 8. Handle the query in your Handler::OnQuery implementation and execute the +// appropriate callback either immediately or asynchronously. +// +// void MyHandler::OnQuery(int64 query_id, +// CefRefPtr browser, +// CefRefPtr frame, +// const CefString& request, +// bool persistent, +// CefRefPtr callback) { +// if (request == "my_request") { +// callback->Continue("my_response"); +// return true; +// } +// return false; // Not handled. +// } +// +// 9. Notice that the onSuccess callback is executed in JavaScript. + +/// +// Used to configure the query router. The same values must be passed to both +// CefMessageRouterBrowserSide and CefMessageRouterRendererSide. If using multiple +// router pairs make sure to choose values that do not conflict. +/// +struct CefMessageRouterConfig { + CefMessageRouterConfig(); + + // Name of the JavaScript function that will be added to the 'window' object + // for sending a query. The default value is "cefQuery". + CefString js_query_function; + + // Name of the JavaScript function that will be added to the 'window' object + // for canceling a pending query. The default value is "cefQueryCancel". + CefString js_cancel_function; +}; + +/// +// Implements the browser side of query routing. The methods of this class may +// be called on any browser process thread unless otherwise indicated. +/// +class CefMessageRouterBrowserSide : + public base::RefCountedThreadSafe { + public: + /// + // Callback associated with a single pending asynchronous query. Execute the + // Success or Failure method to send an asynchronous response to the + // associated JavaScript handler. It is a runtime error to destroy a Callback + // object associated with an uncanceled query without first executing one of + // the callback methods. The methods of this class may be called on any + // browser process thread. + /// + class Callback : public CefBase { + public: + /// + // Notify the associated JavaScript onSuccess callback that the query has + // completed successfully with the specified |response|. + /// + virtual void Success(const CefString& response) =0; + + /// + // Notify the associated JavaScript onFailure callback that the query has + // failed with the specified |error_code| and |error_message|. + /// + virtual void Failure(int error_code, const CefString& error_message) =0; + }; + + /// + // Implement this interface to handle queries. All methods will be executed on + // the browser process UI thread. + /// + class Handler { + public: + typedef CefMessageRouterBrowserSide::Callback Callback; + + /// + // Executed when a new query is received. |query_id| uniquely identifies the + // query for the life span of the router. Return true to handle the query + // or false to propagate the query to other registered handlers, if any. If + // no handlers return true from this method then the query will be + // automatically canceled with an error code of -1 delivered to the + // JavaScript onFailure callback. If this method returns true then a + // Callback method must be executed either in this method or asynchronously + // to complete the query. + /// + virtual bool OnQuery(CefRefPtr browser, + CefRefPtr frame, + int64 query_id, + const CefString& request, + bool persistent, + CefRefPtr callback) { + return false; + } + + /// + // Executed when a query has been canceled either explicitly using the + // JavaScript cancel function or implicitly due to browser destruction, + // navigation or renderer process termination. It will only be called for + // the single handler that returned true from OnQuery for the same + // |query_id|. No references to the associated Callback object should be + // kept after this method is called, nor should any Callback methods be + // executed. + /// + virtual void OnQueryCanceled(CefRefPtr browser, + CefRefPtr frame, + int64 query_id) {} + + virtual ~Handler() {} + }; + + /// + // Create a new router with the specified configuration. + /// + static CefRefPtr Create( + const CefMessageRouterConfig& config); + + /// + // Add a new query handler. If |first| is true it will be added as the first + // handler, otherwise it will be added as the last handler. Returns true if + // the handler is added successfully or false if the handler has already been + // added. Must be called on the browser process UI thread. The Handler object + // must either outlive the router or be removed before deletion. + /// + virtual bool AddHandler(Handler* handler, bool first) =0; + + /// + // Remove an existing query handler. Any pending queries associated with the + // handler will be canceled. Handler::OnQueryCanceled will be called and the + // associated JavaScript onFailure callback will be executed with an error + // code of -1. Returns true if the handler is removed successfully or false + // if the handler is not found. Must be called on the browser process UI + // thread. + /// + virtual bool RemoveHandler(Handler* handler) =0; + + /// + // Cancel all pending queries associated with either |browser| or |handler|. + // If both |browser| and |handler| are NULL all pending queries will be + // canceled. Handler::OnQueryCanceled will be called and the associated + // JavaScript onFailure callback will be executed in all cases with an error + // code of -1. + /// + virtual void CancelPending(CefRefPtr browser, + Handler* handler) =0; + + /// + // Returns the number of queries currently pending for the specified |browser| + // and/or |handler|. Either or both values may be empty. Must be called on the + // browser process UI thread. + /// + virtual int GetPendingCount(CefRefPtr browser, + Handler* handler) =0; + + + // The below methods should be called from other CEF handlers. They must be + // called exactly as documented for the router to function correctly. + + /// + // Call from CefLifeSpanHandler::OnBeforeClose. Any pending queries associated + // with |browser| will be canceled and Handler::OnQueryCanceled will be called. + // No JavaScript callbacks will be executed since this indicates destruction + // of the browser. + /// + virtual void OnBeforeClose(CefRefPtr browser) =0; + + /// + // Call from CefRequestHandler::OnRenderProcessTerminated. Any pending queries + // associated with |browser| will be canceled and Handler::OnQueryCanceled + // will be called. No JavaScript callbacks will be executed since this + // indicates destruction of the context. + /// + virtual void OnRenderProcessTerminated(CefRefPtr browser) =0; + + /// + // Call from CefRequestHandler::OnBeforeBrowse only if the navigation is + // allowed to proceed. If |frame| is the main frame then any pending queries + // associated with |browser| will be canceled and Handler::OnQueryCanceled + // will be called. No JavaScript callbacks will be executed since this + // indicates destruction of the context. + /// + virtual void OnBeforeBrowse(CefRefPtr browser, + CefRefPtr frame) =0; + + /// + // Call from CefClient::OnProcessMessageReceived. Returns true if the message + // is handled by this router or false otherwise. + /// + virtual bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) =0; + + protected: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + virtual ~CefMessageRouterBrowserSide() {} +}; + +/// +// Implements the renderer side of query routing. The methods of this class must +// be called on the render process main thread. +/// +class CefMessageRouterRendererSide : + public base::RefCountedThreadSafe { + public: + /// + // Create a new router with the specified configuration. + /// + static CefRefPtr Create( + const CefMessageRouterConfig& config); + + /// + // Returns the number of queries currently pending for the specified |browser| + // and/or |context|. Either or both values may be empty. + /// + virtual int GetPendingCount(CefRefPtr browser, + CefRefPtr context) =0; + + + // The below methods should be called from other CEF handlers. They must be + // called exactly as documented for the router to function correctly. + + /// + // Call from CefRenderProcessHandler::OnContextCreated. Registers the + // JavaScripts functions with the new context. + /// + virtual void OnContextCreated(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) =0; + + /// + // Call from CefRenderProcessHandler::OnContextReleased. Any pending queries + // associated with the released context will be canceled and + // Handler::OnQueryCanceled will be called in the browser process. + /// + virtual void OnContextReleased(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) =0; + + /// + // Call from CefRenderProcessHandler::OnProcessMessageReceived. Returns true + // if the message is handled by this router or false otherwise. + /// + virtual bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) =0; + + protected: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + virtual ~CefMessageRouterRendererSide() {} +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_MESSAGE_ROUTER_H_ diff --git a/vendor/cef3/include/wrapper/cef_stream_resource_handler.h b/vendor/cef3/include/wrapper/cef_stream_resource_handler.h new file mode 100644 index 00000000000..6a9a69814cf --- /dev/null +++ b/vendor/cef3/include/wrapper/cef_stream_resource_handler.h @@ -0,0 +1,104 @@ +// Copyright (c) 2012 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ +#define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ +#pragma once + +#include "include/base/cef_macros.h" +#include "include/base/cef_scoped_ptr.h" +#include "include/cef_base.h" +#include "include/cef_resource_handler.h" +#include "include/cef_response.h" + +class CefStreamReader; + +/// +// Implementation of the CefResourceHandler class for reading from a CefStream. +/// +class CefStreamResourceHandler : public CefResourceHandler { + public: + /// + // Create a new object with default response values. + /// + CefStreamResourceHandler(const CefString& mime_type, + CefRefPtr stream); + /// + // Create a new object with explicit response values. + /// + CefStreamResourceHandler(int status_code, + const CefString& status_text, + const CefString& mime_type, + CefResponse::HeaderMap header_map, + CefRefPtr stream); + + virtual ~CefStreamResourceHandler(); + + // CefResourceHandler methods. + virtual bool ProcessRequest(CefRefPtr request, + CefRefPtr callback) OVERRIDE; + virtual void GetResponseHeaders(CefRefPtr response, + int64& response_length, + CefString& redirectUrl) OVERRIDE; + virtual bool ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) OVERRIDE; + virtual void Cancel() OVERRIDE; + + private: + void ReadOnFileThread(int bytes_to_read, + CefRefPtr callback); + + const int status_code_; + const CefString status_text_; + const CefString mime_type_; + const CefResponse::HeaderMap header_map_; + const CefRefPtr stream_; + bool read_on_file_thread_; + + class Buffer; + scoped_ptr buffer_; +#ifndef NDEBUG + // Used in debug builds to verify that |buffer_| isn't being accessed on + // multiple threads at the same time. + bool buffer_owned_by_file_thread_; +#endif + + IMPLEMENT_REFCOUNTING(CefStreamResourceHandler); + DISALLOW_COPY_AND_ASSIGN(CefStreamResourceHandler); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_ diff --git a/vendor/cef3/include/wrapper/cef_xml_object.h b/vendor/cef3/include/wrapper/cef_xml_object.h new file mode 100644 index 00000000000..bf1755432b0 --- /dev/null +++ b/vendor/cef3/include/wrapper/cef_xml_object.h @@ -0,0 +1,196 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ +#define CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ +#pragma once + +#include +#include + +#include "include/base/cef_lock.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_ref_counted.h" +#include "include/cef_base.h" +#include "include/cef_xml_reader.h" + +class CefStreamReader; + +/// +// Thread safe class for representing XML data as a structured object. This +// class should not be used with large XML documents because all data will be +// resident in memory at the same time. This implementation supports a +// restricted set of XML features: +//
+// (1) Processing instructions, whitespace and comments are ignored.
+// (2) Elements and attributes must always be referenced using the fully
+//     qualified name (ie, namespace:localname).
+// (3) Empty elements () and elements with zero-length values ()
+//     are considered the same.
+// (4) Element nodes are considered part of a value if:
+//     (a) The element node follows a non-element node at the same depth
+//         (see 5), or
+//     (b) The element node does not have a namespace and the parent node does.
+// (5) Mixed node types at the same depth are combined into a single element
+//     value as follows:
+//     (a) All node values are concatenated to form a single string value.
+//     (b) Entity reference nodes are resolved to the corresponding entity
+//         value.
+//     (c) Element nodes are represented by their outer XML string.
+// 
+/// +class CefXmlObject : public base::RefCountedThreadSafe { + public: + typedef std::vector > ObjectVector; + typedef std::map AttributeMap; + + /// + // Create a new object with the specified name. An object name must always be + // at least one character long. + /// + explicit CefXmlObject(const CefString& name); + + /// + // Load the contents of the specified XML stream into this object. The + // existing children and attributes, if any, will first be cleared. + /// + bool Load(CefRefPtr stream, + CefXmlReader::EncodingType encodingType, + const CefString& URI, CefString* loadError); + + /// + // Set the name, children and attributes of this object to a duplicate of the + // specified object's contents. The existing children and attributes, if any, + // will first be cleared. + /// + void Set(CefRefPtr object); + + /// + // Append a duplicate of the children and attributes of the specified object + // to this object. If |overwriteAttributes| is true then any attributes in + // this object that also exist in the specified object will be overwritten + // with the new values. The name of this object is not changed. + /// + void Append(CefRefPtr object, bool overwriteAttributes); + + /// + // Return a new object with the same name, children and attributes as this + // object. The parent of the new object will be NULL. + /// + CefRefPtr Duplicate(); + + /// + // Clears this object's children and attributes. The name and parenting of + // this object are not changed. + /// + void Clear(); + + /// + // Access the object's name. An object name must always be at least one + // character long. + /// + CefString GetName(); + bool SetName(const CefString& name); + + /// + // Access the object's parent. The parent can be NULL if this object has not + // been added as the child on another object. + /// + bool HasParent(); + CefRefPtr GetParent(); + + /// + // Access the object's value. An object cannot have a value if it also has + // children. Attempting to set the value while children exist will fail. + /// + bool HasValue(); + CefString GetValue(); + bool SetValue(const CefString& value); + + /// + // Access the object's attributes. Attributes must have unique names. + /// + bool HasAttributes(); + size_t GetAttributeCount(); + bool HasAttribute(const CefString& name); + CefString GetAttributeValue(const CefString& name); + bool SetAttributeValue(const CefString& name, const CefString& value); + size_t GetAttributes(AttributeMap& attributes); + void ClearAttributes(); + + /// + // Access the object's children. Each object can only have one parent so + // attempting to add an object that already has a parent will fail. Removing a + // child will set the child's parent to NULL. Adding a child will set the + // child's parent to this object. This object's value, if any, will be cleared + // if a child is added. + /// + bool HasChildren(); + size_t GetChildCount(); + bool HasChild(CefRefPtr child); + bool AddChild(CefRefPtr child); + bool RemoveChild(CefRefPtr child); + size_t GetChildren(ObjectVector& children); + void ClearChildren(); + + /// + // Find the first child with the specified name. + /// + CefRefPtr FindChild(const CefString& name); + + /// + // Find all children with the specified name. + /// + size_t FindChildren(const CefString& name, ObjectVector& children); + + private: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + ~CefXmlObject(); + + void SetParent(CefXmlObject* parent); + + CefString name_; + CefXmlObject* parent_; + CefString value_; + AttributeMap attributes_; + ObjectVector children_; + + base::Lock lock_; + + DISALLOW_COPY_AND_ASSIGN(CefXmlObject); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_XML_OBJECT_H_ diff --git a/vendor/cef3/include/wrapper/cef_zip_archive.h b/vendor/cef3/include/wrapper/cef_zip_archive.h new file mode 100644 index 00000000000..7ad10bda88c --- /dev/null +++ b/vendor/cef3/include/wrapper/cef_zip_archive.h @@ -0,0 +1,143 @@ +// Copyright (c) 2011 Marshall A. Greenblatt. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the name Chromium Embedded +// Framework nor the names of its contributors may be used to endorse +// or promote products derived from this software without specific prior +// written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// --------------------------------------------------------------------------- +// +// The contents of this file are only available to applications that link +// against the libcef_dll_wrapper target. +// + +#ifndef CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ +#define CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ +#pragma once + +#include + +#include "include/base/cef_lock.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_ref_counted.h" +#include "include/cef_base.h" + +class CefStreamReader; + +/// +// Thread-safe class for accessing zip archive file contents. This class should +// not be used with large archive files because all data will be resident in +// memory at the same time. This implementation supports a restricted set of zip +// archive features: +// (1) All file names are stored and compared in lower case. +// (2) File ordering from the original zip archive is not maintained. This +// means that files from the same folder may not be located together in the +// file content map. +/// +class CefZipArchive : public base::RefCountedThreadSafe { + public: + /// + // Class representing a file in the archive. Accessing the file data from + // multiple threads is safe provided a reference to the File object is kept. + /// + class File : public CefBase { + public: + /// + // Returns the read-only data contained in the file. + /// + virtual const unsigned char* GetData() const =0; + + /// + // Returns the size of the data in the file. + /// + virtual size_t GetDataSize() const =0; + + /// + // Returns a CefStreamReader object for streaming the contents of the file. + /// + virtual CefRefPtr GetStreamReader() const =0; + }; + + typedef std::map > FileMap; + + /// + // Create a new object. + /// + CefZipArchive(); + + /// + // Load the contents of the specified zip archive stream into this object. + // If the zip archive requires a password then provide it via |password|. + // If |overwriteExisting| is true then any files in this object that also + // exist in the specified archive will be replaced with the new files. + // Returns the number of files successfully loaded. + /// + size_t Load(CefRefPtr stream, + const CefString& password, + bool overwriteExisting); + + /// + // Clears the contents of this object. + /// + void Clear(); + + /// + // Returns the number of files in the archive. + /// + size_t GetFileCount() const; + + /// + // Returns true if the specified file exists and has contents. + /// + bool HasFile(const CefString& fileName) const; + + /// + // Returns the specified file. + /// + CefRefPtr GetFile(const CefString& fileName) const; + + /// + // Removes the specified file. + /// + bool RemoveFile(const CefString& fileName); + + /// + // Returns the map of all files. + /// + size_t GetFiles(FileMap& map) const; + + private: + // Protect against accidental deletion of this object. + friend class base::RefCountedThreadSafe; + ~CefZipArchive(); + + FileMap contents_; + + mutable base::Lock lock_; + + DISALLOW_COPY_AND_ASSIGN(CefZipArchive); +}; + +#endif // CEF_INCLUDE_WRAPPER_CEF_ZIP_ARCHIVE_H_ diff --git a/vendor/cef3/libcef_dll/CMakeLists.txt b/vendor/cef3/libcef_dll/CMakeLists.txt new file mode 100644 index 00000000000..0e478377d05 --- /dev/null +++ b/vendor/cef3/libcef_dll/CMakeLists.txt @@ -0,0 +1,470 @@ +# Copyright (c) 2014 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. + +add_definitions(-DUSING_CEF_SHARED) + +# Append platform specific sources to a list of sources. +macro(LIBCEF_APPEND_PLATFORM_SOURCES name_of_list) + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin" AND ${name_of_list}_MACOSX) + list(APPEND ${name_of_list} ${${name_of_list}_MACOSX}) + endif() + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND ${name_of_list}_LINUX) + list(APPEND ${name_of_list} ${${name_of_list}_LINUX}) + endif() + if("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" AND ${name_of_list}_WINDOWS) + list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS}) + endif() +endmacro() + +set(LIBCEF_SRCS + transfer_util.cpp + transfer_util.h + ) +source_group(libcef_dll FILES ${LIBCEF_SRCS}) + +set(LIBCEF_BASE_SRCS + base/cef_atomicops_x86_gcc.cc + base/cef_bind_helpers.cc + base/cef_callback_helpers.cc + base/cef_callback_internal.cc + base/cef_lock.cc + base/cef_lock_impl.cc + base/cef_logging.cc + base/cef_ref_counted.cc + base/cef_string16.cc + base/cef_thread_checker_impl.cc + base/cef_thread_collision_warner.cc + base/cef_weak_ptr.cc + ) +source_group(libcef_dll\\\\base FILES ${LIBCEF_BASE_SRCS}) + +set(LIBCEF_CPPTOC_SRCS + cpptoc/app_cpptoc.cc + cpptoc/app_cpptoc.h + cpptoc/base_cpptoc.h + cpptoc/browser_process_handler_cpptoc.cc + cpptoc/browser_process_handler_cpptoc.h + cpptoc/client_cpptoc.cc + cpptoc/client_cpptoc.h + cpptoc/completion_callback_cpptoc.cc + cpptoc/completion_callback_cpptoc.h + cpptoc/context_menu_handler_cpptoc.cc + cpptoc/context_menu_handler_cpptoc.h + cpptoc/cookie_visitor_cpptoc.cc + cpptoc/cookie_visitor_cpptoc.h + cpptoc/cpptoc.h + cpptoc/dialog_handler_cpptoc.cc + cpptoc/dialog_handler_cpptoc.h + cpptoc/display_handler_cpptoc.cc + cpptoc/display_handler_cpptoc.h + cpptoc/domvisitor_cpptoc.cc + cpptoc/domvisitor_cpptoc.h + cpptoc/download_handler_cpptoc.cc + cpptoc/download_handler_cpptoc.h + cpptoc/drag_handler_cpptoc.cc + cpptoc/drag_handler_cpptoc.h + cpptoc/end_tracing_callback_cpptoc.cc + cpptoc/end_tracing_callback_cpptoc.h + cpptoc/focus_handler_cpptoc.cc + cpptoc/focus_handler_cpptoc.h + cpptoc/geolocation_handler_cpptoc.cc + cpptoc/geolocation_handler_cpptoc.h + cpptoc/get_geolocation_callback_cpptoc.cc + cpptoc/get_geolocation_callback_cpptoc.h + cpptoc/jsdialog_handler_cpptoc.cc + cpptoc/jsdialog_handler_cpptoc.h + cpptoc/keyboard_handler_cpptoc.cc + cpptoc/keyboard_handler_cpptoc.h + cpptoc/life_span_handler_cpptoc.cc + cpptoc/life_span_handler_cpptoc.h + cpptoc/load_handler_cpptoc.cc + cpptoc/load_handler_cpptoc.h + cpptoc/navigation_entry_visitor_cpptoc.cc + cpptoc/navigation_entry_visitor_cpptoc.h + cpptoc/print_handler_cpptoc.cc + cpptoc/print_handler_cpptoc.h + cpptoc/read_handler_cpptoc.cc + cpptoc/read_handler_cpptoc.h + cpptoc/render_handler_cpptoc.cc + cpptoc/render_handler_cpptoc.h + cpptoc/render_process_handler_cpptoc.cc + cpptoc/render_process_handler_cpptoc.h + cpptoc/request_context_handler_cpptoc.cc + cpptoc/request_context_handler_cpptoc.h + cpptoc/request_handler_cpptoc.cc + cpptoc/request_handler_cpptoc.h + cpptoc/resource_bundle_handler_cpptoc.cc + cpptoc/resource_bundle_handler_cpptoc.h + cpptoc/resource_handler_cpptoc.cc + cpptoc/resource_handler_cpptoc.h + cpptoc/run_file_dialog_callback_cpptoc.cc + cpptoc/run_file_dialog_callback_cpptoc.h + cpptoc/scheme_handler_factory_cpptoc.cc + cpptoc/scheme_handler_factory_cpptoc.h + cpptoc/string_visitor_cpptoc.cc + cpptoc/string_visitor_cpptoc.h + cpptoc/task_cpptoc.cc + cpptoc/task_cpptoc.h + cpptoc/urlrequest_client_cpptoc.cc + cpptoc/urlrequest_client_cpptoc.h + cpptoc/v8accessor_cpptoc.cc + cpptoc/v8accessor_cpptoc.h + cpptoc/v8handler_cpptoc.cc + cpptoc/v8handler_cpptoc.h + cpptoc/web_plugin_info_visitor_cpptoc.cc + cpptoc/web_plugin_info_visitor_cpptoc.h + cpptoc/web_plugin_unstable_callback_cpptoc.cc + cpptoc/web_plugin_unstable_callback_cpptoc.h + cpptoc/write_handler_cpptoc.cc + cpptoc/write_handler_cpptoc.h + ) +source_group(libcef_dll\\\\cpptoc FILES ${LIBCEF_CPPTOC_SRCS}) + +set(LIBCEF_CTOCPP_SRCS + ctocpp/allow_certificate_error_callback_ctocpp.cc + ctocpp/allow_certificate_error_callback_ctocpp.h + ctocpp/auth_callback_ctocpp.cc + ctocpp/auth_callback_ctocpp.h + ctocpp/base_ctocpp.h + ctocpp/before_download_callback_ctocpp.cc + ctocpp/before_download_callback_ctocpp.h + ctocpp/binary_value_ctocpp.cc + ctocpp/binary_value_ctocpp.h + ctocpp/browser_ctocpp.cc + ctocpp/browser_ctocpp.h + ctocpp/browser_host_ctocpp.cc + ctocpp/browser_host_ctocpp.h + ctocpp/callback_ctocpp.cc + ctocpp/callback_ctocpp.h + ctocpp/command_line_ctocpp.cc + ctocpp/command_line_ctocpp.h + ctocpp/context_menu_params_ctocpp.cc + ctocpp/context_menu_params_ctocpp.h + ctocpp/cookie_manager_ctocpp.cc + ctocpp/cookie_manager_ctocpp.h + ctocpp/ctocpp.h + ctocpp/dictionary_value_ctocpp.cc + ctocpp/dictionary_value_ctocpp.h + ctocpp/domdocument_ctocpp.cc + ctocpp/domdocument_ctocpp.h + ctocpp/domnode_ctocpp.cc + ctocpp/domnode_ctocpp.h + ctocpp/download_item_callback_ctocpp.cc + ctocpp/download_item_callback_ctocpp.h + ctocpp/download_item_ctocpp.cc + ctocpp/download_item_ctocpp.h + ctocpp/drag_data_ctocpp.cc + ctocpp/drag_data_ctocpp.h + ctocpp/file_dialog_callback_ctocpp.cc + ctocpp/file_dialog_callback_ctocpp.h + ctocpp/frame_ctocpp.cc + ctocpp/frame_ctocpp.h + ctocpp/geolocation_callback_ctocpp.cc + ctocpp/geolocation_callback_ctocpp.h + ctocpp/jsdialog_callback_ctocpp.cc + ctocpp/jsdialog_callback_ctocpp.h + ctocpp/list_value_ctocpp.cc + ctocpp/list_value_ctocpp.h + ctocpp/menu_model_ctocpp.cc + ctocpp/menu_model_ctocpp.h + ctocpp/navigation_entry_ctocpp.cc + ctocpp/navigation_entry_ctocpp.h + ctocpp/post_data_ctocpp.cc + ctocpp/post_data_ctocpp.h + ctocpp/post_data_element_ctocpp.cc + ctocpp/post_data_element_ctocpp.h + ctocpp/print_dialog_callback_ctocpp.cc + ctocpp/print_dialog_callback_ctocpp.h + ctocpp/print_job_callback_ctocpp.cc + ctocpp/print_job_callback_ctocpp.h + ctocpp/print_settings_ctocpp.cc + ctocpp/print_settings_ctocpp.h + ctocpp/process_message_ctocpp.cc + ctocpp/process_message_ctocpp.h + ctocpp/quota_callback_ctocpp.cc + ctocpp/quota_callback_ctocpp.h + ctocpp/request_context_ctocpp.cc + ctocpp/request_context_ctocpp.h + ctocpp/request_ctocpp.cc + ctocpp/request_ctocpp.h + ctocpp/response_ctocpp.cc + ctocpp/response_ctocpp.h + ctocpp/scheme_registrar_ctocpp.cc + ctocpp/scheme_registrar_ctocpp.h + ctocpp/stream_reader_ctocpp.cc + ctocpp/stream_reader_ctocpp.h + ctocpp/stream_writer_ctocpp.cc + ctocpp/stream_writer_ctocpp.h + ctocpp/task_runner_ctocpp.cc + ctocpp/task_runner_ctocpp.h + ctocpp/urlrequest_ctocpp.cc + ctocpp/urlrequest_ctocpp.h + ctocpp/v8context_ctocpp.cc + ctocpp/v8context_ctocpp.h + ctocpp/v8exception_ctocpp.cc + ctocpp/v8exception_ctocpp.h + ctocpp/v8stack_frame_ctocpp.cc + ctocpp/v8stack_frame_ctocpp.h + ctocpp/v8stack_trace_ctocpp.cc + ctocpp/v8stack_trace_ctocpp.h + ctocpp/v8value_ctocpp.cc + ctocpp/v8value_ctocpp.h + ctocpp/web_plugin_info_ctocpp.cc + ctocpp/web_plugin_info_ctocpp.h + ctocpp/xml_reader_ctocpp.cc + ctocpp/xml_reader_ctocpp.h + ctocpp/zip_reader_ctocpp.cc + ctocpp/zip_reader_ctocpp.h + ) +source_group(libcef_dll\\\\ctocpp FILES ${LIBCEF_CTOCPP_SRCS}) + +set(LIBCEF_INCLUDE_SRCS + ../include/cef_app.h + ../include/cef_auth_callback.h + ../include/cef_base.h + ../include/cef_browser.h + ../include/cef_browser_process_handler.h + ../include/cef_callback.h + ../include/cef_client.h + ../include/cef_command_line.h + ../include/cef_context_menu_handler.h + ../include/cef_cookie.h + ../include/cef_dialog_handler.h + ../include/cef_display_handler.h + ../include/cef_dom.h + ../include/cef_download_handler.h + ../include/cef_download_item.h + ../include/cef_drag_data.h + ../include/cef_drag_handler.h + ../include/cef_focus_handler.h + ../include/cef_frame.h + ../include/cef_geolocation.h + ../include/cef_geolocation_handler.h + ../include/cef_jsdialog_handler.h + ../include/cef_keyboard_handler.h + ../include/cef_life_span_handler.h + ../include/cef_load_handler.h + ../include/cef_menu_model.h + ../include/cef_navigation_entry.h + ../include/cef_origin_whitelist.h + ../include/cef_pack_resources.h + ../include/cef_pack_strings.h + ../include/cef_path_util.h + ../include/cef_print_handler.h + ../include/cef_print_settings.h + ../include/cef_process_message.h + ../include/cef_process_util.h + ../include/cef_render_handler.h + ../include/cef_render_process_handler.h + ../include/cef_request.h + ../include/cef_request_context.h + ../include/cef_request_context_handler.h + ../include/cef_request_handler.h + ../include/cef_resource_bundle_handler.h + ../include/cef_resource_handler.h + ../include/cef_response.h + ../include/cef_runnable.h + ../include/cef_scheme.h + ../include/cef_stream.h + ../include/cef_string_visitor.h + ../include/cef_task.h + ../include/cef_trace.h + ../include/cef_url.h + ../include/cef_urlrequest.h + ../include/cef_v8.h + ../include/cef_values.h + ../include/cef_version.h + ../include/cef_web_plugin.h + ../include/cef_xml_reader.h + ../include/cef_zip_reader.h + ) +set(LIBCEF_INCLUDE_SRCS_MACOSX + ../include/cef_application_mac.h + ) +set(LIBCEF_INCLUDE_SRCS_WINDOWS + ../include/cef_sandbox_win.h + ) +LIBCEF_APPEND_PLATFORM_SOURCES(LIBCEF_INCLUDE_SRCS) +source_group(include FILES ${LIBCEF_INCLUDE_SRCS}) + +set(LIBCEF_INCLUDE_BASE_SRCS + ../include/base/cef_atomic_ref_count.h + ../include/base/cef_atomicops.h + ../include/base/cef_basictypes.h + ../include/base/cef_bind.h + ../include/base/cef_bind_helpers.h + ../include/base/cef_build.h + ../include/base/cef_callback.h + ../include/base/cef_callback_forward.h + ../include/base/cef_callback_helpers.h + ../include/base/cef_callback_list.h + ../include/base/cef_cancelable_callback.h + ../include/base/cef_lock.h + ../include/base/cef_logging.h + ../include/base/cef_macros.h + ../include/base/cef_move.h + ../include/base/cef_platform_thread.h + ../include/base/cef_ref_counted.h + ../include/base/cef_scoped_ptr.h + ../include/base/cef_string16.h + ../include/base/cef_template_util.h + ../include/base/cef_thread_checker.h + ../include/base/cef_thread_collision_warner.h + ../include/base/cef_trace_event.h + ../include/base/cef_tuple.h + ../include/base/cef_weak_ptr.h + ) +source_group(include\\\\base FILES ${LIBCEF_INCLUDE_BASE_SRCS}) + +set(LIBCEF_INCLUDE_BASE_INTERNAL_SRCS + ../include/base/internal/cef_bind_internal.h + ../include/base/internal/cef_callback_internal.h + ../include/base/internal/cef_lock_impl.h + ../include/base/internal/cef_raw_scoped_refptr_mismatch_checker.h + ../include/base/internal/cef_thread_checker_impl.h + ) +set(LIBCEF_INCLUDE_BASE_INTERNAL_SRCS_LINUX + ../include/base/internal/cef_atomicops_atomicword_compat.h + ../include/base/internal/cef_atomicops_x86_gcc.h + ) +set(LIBCEF_INCLUDE_BASE_INTERNAL_SRCS_MACOSX + ../include/base/internal/cef_atomicops_atomicword_compat.h + ../include/base/internal/cef_atomicops_mac.h + ) +set(LIBCEF_INCLUDE_BASE_INTERNAL_SRCS_WINDOWS + ../include/base/internal/cef_atomicops_x86_msvc.h + ../include/base/internal/cef_bind_internal_win.h + ) +LIBCEF_APPEND_PLATFORM_SOURCES(LIBCEF_INCLUDE_BASE_INTERNAL_SRCS) +source_group(include\\\\base\\\\internal FILES ${LIBCEF_INCLUDE_BASE_INTERNAL_SRCS}) + +set(LIBCEF_INCLUDE_CAPI_SRCS + ../include/capi/cef_app_capi.h + ../include/capi/cef_auth_callback_capi.h + ../include/capi/cef_base_capi.h + ../include/capi/cef_browser_capi.h + ../include/capi/cef_browser_process_handler_capi.h + ../include/capi/cef_callback_capi.h + ../include/capi/cef_client_capi.h + ../include/capi/cef_command_line_capi.h + ../include/capi/cef_context_menu_handler_capi.h + ../include/capi/cef_cookie_capi.h + ../include/capi/cef_dialog_handler_capi.h + ../include/capi/cef_display_handler_capi.h + ../include/capi/cef_dom_capi.h + ../include/capi/cef_download_handler_capi.h + ../include/capi/cef_download_item_capi.h + ../include/capi/cef_drag_data_capi.h + ../include/capi/cef_drag_handler_capi.h + ../include/capi/cef_focus_handler_capi.h + ../include/capi/cef_frame_capi.h + ../include/capi/cef_geolocation_capi.h + ../include/capi/cef_geolocation_handler_capi.h + ../include/capi/cef_jsdialog_handler_capi.h + ../include/capi/cef_keyboard_handler_capi.h + ../include/capi/cef_life_span_handler_capi.h + ../include/capi/cef_load_handler_capi.h + ../include/capi/cef_menu_model_capi.h + ../include/capi/cef_navigation_entry_capi.h + ../include/capi/cef_origin_whitelist_capi.h + ../include/capi/cef_path_util_capi.h + ../include/capi/cef_print_handler_capi.h + ../include/capi/cef_print_settings_capi.h + ../include/capi/cef_process_message_capi.h + ../include/capi/cef_process_util_capi.h + ../include/capi/cef_render_handler_capi.h + ../include/capi/cef_render_process_handler_capi.h + ../include/capi/cef_request_capi.h + ../include/capi/cef_request_context_capi.h + ../include/capi/cef_request_context_handler_capi.h + ../include/capi/cef_request_handler_capi.h + ../include/capi/cef_resource_bundle_handler_capi.h + ../include/capi/cef_resource_handler_capi.h + ../include/capi/cef_response_capi.h + ../include/capi/cef_scheme_capi.h + ../include/capi/cef_stream_capi.h + ../include/capi/cef_string_visitor_capi.h + ../include/capi/cef_task_capi.h + ../include/capi/cef_trace_capi.h + ../include/capi/cef_url_capi.h + ../include/capi/cef_urlrequest_capi.h + ../include/capi/cef_v8_capi.h + ../include/capi/cef_values_capi.h + ../include/capi/cef_web_plugin_capi.h + ../include/capi/cef_xml_reader_capi.h + ../include/capi/cef_zip_reader_capi.h + ) +source_group(include\\\\capi FILES ${LIBCEF_INCLUDE_CAPI_SRCS}) + +set(LIBCEF_INCLUDE_INTERNAL_SRCS + ../include/internal/cef_export.h + ../include/internal/cef_logging_internal.h + ../include/internal/cef_ptr.h + ../include/internal/cef_string.h + ../include/internal/cef_string_list.h + ../include/internal/cef_string_map.h + ../include/internal/cef_string_multimap.h + ../include/internal/cef_string_types.h + ../include/internal/cef_string_wrappers.h + ../include/internal/cef_thread_internal.h + ../include/internal/cef_time.h + ../include/internal/cef_trace_event_internal.h + ../include/internal/cef_types.h + ../include/internal/cef_types_wrappers.h + ) +set(LIBCEF_INCLUDE_INTERNAL_SRCS_LINUX + ../include/internal/cef_linux.h + ../include/internal/cef_types_linux.h + ) +set(LIBCEF_INCLUDE_INTERNAL_SRCS_MACOSX + ../include/internal/cef_mac.h + ../include/internal/cef_types_mac.h + ) +set(LIBCEF_INCLUDE_INTERNAL_SRCS_WINDOWS + ../include/internal/cef_types_win.h + ../include/internal/cef_win.h + ) +LIBCEF_APPEND_PLATFORM_SOURCES(LIBCEF_INCLUDE_INTERNAL_SRCS) +source_group(include\\\\internal FILES ${LIBCEF_INCLUDE_INTERNAL_SRCS}) + +set(LIBCEF_INCLUDE_WRAPPER_SRCS + ../include/wrapper/cef_byte_read_handler.h + ../include/wrapper/cef_closure_task.h + ../include/wrapper/cef_helpers.h + ../include/wrapper/cef_message_router.h + ../include/wrapper/cef_stream_resource_handler.h + ../include/wrapper/cef_xml_object.h + ../include/wrapper/cef_zip_archive.h + ) +source_group(include\\\\wrapper FILES ${LIBCEF_INCLUDE_WRAPPER_SRCS}) + +set(LIBCEF_WRAPPER_SRCS + wrapper/cef_browser_info_map.h + wrapper/cef_byte_read_handler.cc + wrapper/cef_closure_task.cc + wrapper/cef_message_router.cc + wrapper/cef_stream_resource_handler.cc + wrapper/cef_xml_object.cc + wrapper/cef_zip_archive.cc + wrapper/libcef_dll_wrapper.cc + wrapper/libcef_dll_wrapper2.cc + ) +source_group(libcef_dll\\\\wrapper FILES ${LIBCEF_WRAPPER_SRCS}) + +add_library(libcef_dll_wrapper + ${LIBCEF_SRCS} + ${LIBCEF_BASE_SRCS} + ${LIBCEF_CPPTOC_SRCS} + ${LIBCEF_CTOCPP_SRCS} + ${LIBCEF_INCLUDE_SRCS} + ${LIBCEF_INCLUDE_BASE_SRCS} + ${LIBCEF_INCLUDE_BASE_INTERNAL_SRCS} + ${LIBCEF_INCLUDE_CAPI_SRCS} + ${LIBCEF_INCLUDE_INTERNAL_SRCS} + ${LIBCEF_INCLUDE_WRAPPER_SRCS} + ${LIBCEF_WRAPPER_SRCS} + ) + +# Remove the default "lib" prefix from the resulting library. +set_target_properties(libcef_dll_wrapper PROPERTIES PREFIX "") diff --git a/vendor/cef3/libcef_dll/base/cef_atomicops_x86_gcc.cc b/vendor/cef3/libcef_dll/base/cef_atomicops_x86_gcc.cc new file mode 100644 index 00000000000..4471eedaf6e --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_atomicops_x86_gcc.cc @@ -0,0 +1,100 @@ +// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This module gets enough CPU information to optimize the +// atomicops module on x86. + +#include +#include + +#include "include/base/cef_atomicops.h" + +// This file only makes sense with atomicops_internals_x86_gcc.h -- it +// depends on structs that are defined in that file. If atomicops.h +// doesn't sub-include that file, then we aren't needed, and shouldn't +// try to do anything. +#ifdef CEF_INCLUDE_BASE_INTERNAL_CEF_ATOMICOPS_X86_GCC_H_ + +// Inline cpuid instruction. In PIC compilations, %ebx contains the address +// of the global offset table. To avoid breaking such executables, this code +// must preserve that register's value across cpuid instructions. +#if defined(__i386__) +#define cpuid(a, b, c, d, inp) \ + asm("mov %%ebx, %%edi\n" \ + "cpuid\n" \ + "xchg %%edi, %%ebx\n" \ + : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp)) +#elif defined(__x86_64__) +#define cpuid(a, b, c, d, inp) \ + asm("mov %%rbx, %%rdi\n" \ + "cpuid\n" \ + "xchg %%rdi, %%rbx\n" \ + : "=a" (a), "=D" (b), "=c" (c), "=d" (d) : "a" (inp)) +#endif + +#if defined(cpuid) // initialize the struct only on x86 + +// Set the flags so that code will run correctly and conservatively, so even +// if we haven't been initialized yet, we're probably single threaded, and our +// default values should hopefully be pretty safe. +struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = { + false, // bug can't exist before process spawns multiple threads +}; + +namespace { + +// Initialize the AtomicOps_Internalx86CPUFeatures struct. +void AtomicOps_Internalx86CPUFeaturesInit() { + uint32_t eax; + uint32_t ebx; + uint32_t ecx; + uint32_t edx; + + // Get vendor string (issue CPUID with eax = 0) + cpuid(eax, ebx, ecx, edx, 0); + char vendor[13]; + memcpy(vendor, &ebx, 4); + memcpy(vendor + 4, &edx, 4); + memcpy(vendor + 8, &ecx, 4); + vendor[12] = 0; + + // get feature flags in ecx/edx, and family/model in eax + cpuid(eax, ebx, ecx, edx, 1); + + int family = (eax >> 8) & 0xf; // family and model fields + int model = (eax >> 4) & 0xf; + if (family == 0xf) { // use extended family and model fields + family += (eax >> 20) & 0xff; + model += ((eax >> 16) & 0xf) << 4; + } + + // Opteron Rev E has a bug in which on very rare occasions a locked + // instruction doesn't act as a read-acquire barrier if followed by a + // non-locked read-modify-write instruction. Rev F has this bug in + // pre-release versions, but not in versions released to customers, + // so we test only for Rev E, which is family 15, model 32..63 inclusive. + if (strcmp(vendor, "AuthenticAMD") == 0 && // AMD + family == 15 && + 32 <= model && model <= 63) { + AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = true; + } else { + AtomicOps_Internalx86CPUFeatures.has_amd_lock_mb_bug = false; + } +} + +class AtomicOpsx86Initializer { + public: + AtomicOpsx86Initializer() { + AtomicOps_Internalx86CPUFeaturesInit(); + } +}; + +// A global to get use initialized on startup via static initialization :/ +AtomicOpsx86Initializer g_initer; + +} // namespace + +#endif // if x86 + +#endif // ifdef CEF_INCLUDE_BASE_CEF_ATOMICOPS_INTERNALS_X86_GCC_H_ diff --git a/vendor/cef3/libcef_dll/base/cef_bind_helpers.cc b/vendor/cef3/libcef_dll/base/cef_bind_helpers.cc new file mode 100644 index 00000000000..b65f5f31f17 --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_bind_helpers.cc @@ -0,0 +1,14 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/cef_bind_helpers.h" + +#include "include/base/cef_callback.h" + +namespace base { + +void DoNothing() { +} + +} // namespace base diff --git a/vendor/cef3/libcef_dll/base/cef_callback_helpers.cc b/vendor/cef3/libcef_dll/base/cef_callback_helpers.cc new file mode 100644 index 00000000000..726104c7b9a --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_callback_helpers.cc @@ -0,0 +1,42 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/cef_callback_helpers.h" + +#include "include/base/cef_callback.h" + +namespace base { + +ScopedClosureRunner::ScopedClosureRunner() { +} + +ScopedClosureRunner::ScopedClosureRunner(const Closure& closure) + : closure_(closure) { +} + +ScopedClosureRunner::~ScopedClosureRunner() { + if (!closure_.is_null()) + closure_.Run(); +} + +void ScopedClosureRunner::Reset() { + Closure old_closure = Release(); + if (!old_closure.is_null()) + old_closure.Run(); +} + +void ScopedClosureRunner::Reset(const Closure& closure) { + Closure old_closure = Release(); + closure_ = closure; + if (!old_closure.is_null()) + old_closure.Run(); +} + +Closure ScopedClosureRunner::Release() { + Closure result = closure_; + closure_.Reset(); + return result; +} + +} // namespace base diff --git a/vendor/cef3/libcef_dll/base/cef_callback_internal.cc b/vendor/cef3/libcef_dll/base/cef_callback_internal.cc new file mode 100644 index 00000000000..a8aa598613c --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_callback_internal.cc @@ -0,0 +1,34 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/internal/cef_callback_internal.h" + +#include "include/base/cef_logging.h" + +namespace base { +namespace internal { + +void CallbackBase::Reset() { + polymorphic_invoke_ = NULL; + // NULL the bind_state_ last, since it may be holding the last ref to whatever + // object owns us, and we may be deleted after that. + bind_state_ = NULL; +} + +bool CallbackBase::Equals(const CallbackBase& other) const { + return bind_state_.get() == other.bind_state_.get() && + polymorphic_invoke_ == other.polymorphic_invoke_; +} + +CallbackBase::CallbackBase(BindStateBase* bind_state) + : bind_state_(bind_state), + polymorphic_invoke_(NULL) { + DCHECK(!bind_state_.get() || bind_state_->HasOneRef()); +} + +CallbackBase::~CallbackBase() { +} + +} // namespace internal +} // namespace base diff --git a/vendor/cef3/libcef_dll/base/cef_lock.cc b/vendor/cef3/libcef_dll/base/cef_lock.cc new file mode 100644 index 00000000000..f0a2cd44aa0 --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_lock.cc @@ -0,0 +1,44 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// This file is used for debugging assertion support. The Lock class +// is functionally a wrapper around the LockImpl class, so the only +// real intelligence in the class is in the debugging logic. + +#if !defined(NDEBUG) + +#include "include/base/cef_lock.h" +#include "include/base/cef_logging.h" + +namespace base { + +Lock::Lock() : lock_() { +} + +Lock::~Lock() { + DCHECK(owning_thread_ref_.is_null()); +} + +void Lock::AssertAcquired() const { + DCHECK(owning_thread_ref_ == PlatformThread::CurrentRef()); +} + +void Lock::CheckHeldAndUnmark() { + DCHECK(owning_thread_ref_ == PlatformThread::CurrentRef()); + owning_thread_ref_ = PlatformThreadRef(); +} + +void Lock::CheckUnheldAndMark() { + // Hitting this DCHECK means that your code is trying to re-enter a lock that + // is already held. The Chromium Lock implementation is not reentrant. + // See "Why can the holder of a Lock not reacquire it?" at + // http://www.chromium.org/developers/lock-and-condition-variable for more + // information. + DCHECK(owning_thread_ref_.is_null()); + owning_thread_ref_ = PlatformThread::CurrentRef(); +} + +} // namespace base + +#endif // NDEBUG diff --git a/vendor/cef3/libcef_dll/base/cef_lock_impl.cc b/vendor/cef3/libcef_dll/base/cef_lock_impl.cc new file mode 100644 index 00000000000..97a03d1922a --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_lock_impl.cc @@ -0,0 +1,92 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/internal/cef_lock_impl.h" + +#if defined(OS_WIN) + +namespace base { +namespace internal { + +LockImpl::LockImpl() { + // The second parameter is the spin count, for short-held locks it avoid the + // contending thread from going to sleep which helps performance greatly. + ::InitializeCriticalSectionAndSpinCount(&native_handle_, 2000); +} + +LockImpl::~LockImpl() { + ::DeleteCriticalSection(&native_handle_); +} + +bool LockImpl::Try() { + if (::TryEnterCriticalSection(&native_handle_) != FALSE) { + return true; + } + return false; +} + +void LockImpl::Lock() { + ::EnterCriticalSection(&native_handle_); +} + +void LockImpl::Unlock() { + ::LeaveCriticalSection(&native_handle_); +} + +} // namespace internal +} // namespace base + +#elif defined(OS_POSIX) + +#include +#include + +#include "include/base/cef_logging.h" + +namespace base { +namespace internal { + +LockImpl::LockImpl() { +#ifndef NDEBUG + // In debug, setup attributes for lock error checking. + pthread_mutexattr_t mta; + int rv = pthread_mutexattr_init(&mta); + DCHECK_EQ(rv, 0) << ". " << strerror(rv); + rv = pthread_mutexattr_settype(&mta, PTHREAD_MUTEX_ERRORCHECK); + DCHECK_EQ(rv, 0) << ". " << strerror(rv); + rv = pthread_mutex_init(&native_handle_, &mta); + DCHECK_EQ(rv, 0) << ". " << strerror(rv); + rv = pthread_mutexattr_destroy(&mta); + DCHECK_EQ(rv, 0) << ". " << strerror(rv); +#else + // In release, go with the default lock attributes. + pthread_mutex_init(&native_handle_, NULL); +#endif +} + +LockImpl::~LockImpl() { + int rv = pthread_mutex_destroy(&native_handle_); + DCHECK_EQ(rv, 0) << ". " << strerror(rv); +} + +bool LockImpl::Try() { + int rv = pthread_mutex_trylock(&native_handle_); + DCHECK(rv == 0 || rv == EBUSY) << ". " << strerror(rv); + return rv == 0; +} + +void LockImpl::Lock() { + int rv = pthread_mutex_lock(&native_handle_); + DCHECK_EQ(rv, 0) << ". " << strerror(rv); +} + +void LockImpl::Unlock() { + int rv = pthread_mutex_unlock(&native_handle_); + DCHECK_EQ(rv, 0) << ". " << strerror(rv); +} + +} // namespace internal +} // namespace base + +#endif // defined(OS_POSIX) diff --git a/vendor/cef3/libcef_dll/base/cef_logging.cc b/vendor/cef3/libcef_dll/base/cef_logging.cc new file mode 100644 index 00000000000..a828b8fadb6 --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_logging.cc @@ -0,0 +1,259 @@ +// Copyright (c) 2014 The Chromium Embedded Framework Authors. +// Portions copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/cef_logging.h" + +#if defined(OS_WIN) +#include +#include +#include +#elif defined(OS_POSIX) +#include +#include +#include +#endif + +#include "include/internal/cef_string_types.h" + +namespace cef { +namespace logging { + +namespace { + +#if defined(OS_POSIX) +// From base/safe_strerror_posix.cc. + +#define USE_HISTORICAL_STRERRO_R (defined(__GLIBC__) || defined(OS_NACL)) + +#if USE_HISTORICAL_STRERRO_R && defined(__GNUC__) +// GCC will complain about the unused second wrap function unless we tell it +// that we meant for them to be potentially unused, which is exactly what this +// attribute is for. +#define POSSIBLY_UNUSED __attribute__((unused)) +#else +#define POSSIBLY_UNUSED +#endif + +#if USE_HISTORICAL_STRERRO_R +// glibc has two strerror_r functions: a historical GNU-specific one that +// returns type char *, and a POSIX.1-2001 compliant one available since 2.3.4 +// that returns int. This wraps the GNU-specific one. +static void POSSIBLY_UNUSED wrap_posix_strerror_r( + char *(*strerror_r_ptr)(int, char *, size_t), + int err, + char *buf, + size_t len) { + // GNU version. + char *rc = (*strerror_r_ptr)(err, buf, len); + if (rc != buf) { + // glibc did not use buf and returned a static string instead. Copy it + // into buf. + buf[0] = '\0'; + strncat(buf, rc, len - 1); + } + // The GNU version never fails. Unknown errors get an "unknown error" message. + // The result is always null terminated. +} +#endif // USE_HISTORICAL_STRERRO_R + +// Wrapper for strerror_r functions that implement the POSIX interface. POSIX +// does not define the behaviour for some of the edge cases, so we wrap it to +// guarantee that they are handled. This is compiled on all POSIX platforms, but +// it will only be used on Linux if the POSIX strerror_r implementation is +// being used (see below). +static void POSSIBLY_UNUSED wrap_posix_strerror_r( + int (*strerror_r_ptr)(int, char *, size_t), + int err, + char *buf, + size_t len) { + int old_errno = errno; + // Have to cast since otherwise we get an error if this is the GNU version + // (but in such a scenario this function is never called). Sadly we can't use + // C++-style casts because the appropriate one is reinterpret_cast but it's + // considered illegal to reinterpret_cast a type to itself, so we get an + // error in the opposite case. + int result = (*strerror_r_ptr)(err, buf, len); + if (result == 0) { + // POSIX is vague about whether the string will be terminated, although + // it indirectly implies that typically ERANGE will be returned, instead + // of truncating the string. We play it safe by always terminating the + // string explicitly. + buf[len - 1] = '\0'; + } else { + // Error. POSIX is vague about whether the return value is itself a system + // error code or something else. On Linux currently it is -1 and errno is + // set. On BSD-derived systems it is a system error and errno is unchanged. + // We try and detect which case it is so as to put as much useful info as + // we can into our message. + int strerror_error; // The error encountered in strerror + int new_errno = errno; + if (new_errno != old_errno) { + // errno was changed, so probably the return value is just -1 or something + // else that doesn't provide any info, and errno is the error. + strerror_error = new_errno; + } else { + // Either the error from strerror_r was the same as the previous value, or + // errno wasn't used. Assume the latter. + strerror_error = result; + } + // snprintf truncates and always null-terminates. + snprintf(buf, + len, + "Error %d while retrieving error %d", + strerror_error, + err); + } + errno = old_errno; +} + +void safe_strerror_r(int err, char *buf, size_t len) { + if (buf == NULL || len <= 0) { + return; + } + // If using glibc (i.e., Linux), the compiler will automatically select the + // appropriate overloaded function based on the function type of strerror_r. + // The other one will be elided from the translation unit since both are + // static. + wrap_posix_strerror_r(&strerror_r, err, buf, len); +} + +std::string safe_strerror(int err) { + const int buffer_size = 256; + char buf[buffer_size]; + safe_strerror_r(err, buf, sizeof(buf)); + return std::string(buf); +} +#endif // defined(OS_POSIX) + +} // namespace + +// MSVC doesn't like complex extern templates and DLLs. +#if !defined(COMPILER_MSVC) +// Explicit instantiations for commonly used comparisons. +template std::string* MakeCheckOpString( + const int&, const int&, const char* names); +template std::string* MakeCheckOpString( + const unsigned long&, const unsigned long&, const char* names); +template std::string* MakeCheckOpString( + const unsigned long&, const unsigned int&, const char* names); +template std::string* MakeCheckOpString( + const unsigned int&, const unsigned long&, const char* names); +template std::string* MakeCheckOpString( + const std::string&, const std::string&, const char* name); +#endif + +#if defined(OS_WIN) +LogMessage::SaveLastError::SaveLastError() : last_error_(::GetLastError()) { +} + +LogMessage::SaveLastError::~SaveLastError() { + ::SetLastError(last_error_); +} +#endif // defined(OS_WIN) + +LogMessage::LogMessage(const char* file, int line, LogSeverity severity) + : severity_(severity), file_(file), line_(line) { +} + +LogMessage::LogMessage(const char* file, int line, std::string* result) + : severity_(LOG_FATAL), file_(file), line_(line) { + stream_ << "Check failed: " << *result; + delete result; +} + +LogMessage::LogMessage(const char* file, int line, LogSeverity severity, + std::string* result) + : severity_(severity), file_(file), line_(line) { + stream_ << "Check failed: " << *result; + delete result; +} + +LogMessage::~LogMessage() { + stream_ << std::endl; + std::string str_newline(stream_.str()); + cef_log(file_, line_, severity_, str_newline.c_str()); +} + +#if defined(OS_WIN) +// This has already been defined in the header, but defining it again as DWORD +// ensures that the type used in the header is equivalent to DWORD. If not, +// the redefinition is a compile error. +typedef DWORD SystemErrorCode; +#endif + +SystemErrorCode GetLastSystemErrorCode() { +#if defined(OS_WIN) + return ::GetLastError(); +#elif defined(OS_POSIX) + return errno; +#else +#error Not implemented +#endif +} + +#if defined(OS_WIN) +std::string SystemErrorCodeToString(SystemErrorCode error_code) { + const int error_message_buffer_size = 256; + char msgbuf[error_message_buffer_size]; + DWORD flags = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS; + DWORD len = FormatMessageA(flags, NULL, error_code, 0, msgbuf, + arraysize(msgbuf), NULL); + std::stringstream ss; + if (len) { + std::string s(msgbuf); + // Messages returned by system end with line breaks. + s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end()); + ss << s << " (0x" << std::hex << error_code << ")"; + } else { + ss << "Error (0x" << std::hex << GetLastError() << + ") while retrieving error. (0x" << error_code << ")"; + } + return ss.str(); +} +#elif defined(OS_POSIX) +std::string SystemErrorCodeToString(SystemErrorCode error_code) { + return safe_strerror(error_code); +} +#else +#error Not implemented +#endif + +#if defined(OS_WIN) +Win32ErrorLogMessage::Win32ErrorLogMessage(const char* file, + int line, + LogSeverity severity, + SystemErrorCode err) + : err_(err), + log_message_(file, line, severity) { +} + +Win32ErrorLogMessage::~Win32ErrorLogMessage() { + stream() << ": " << SystemErrorCodeToString(err_); +} +#elif defined(OS_POSIX) +ErrnoLogMessage::ErrnoLogMessage(const char* file, + int line, + LogSeverity severity, + SystemErrorCode err) + : err_(err), + log_message_(file, line, severity) { +} + +ErrnoLogMessage::~ErrnoLogMessage() { + stream() << ": " << SystemErrorCodeToString(err_); +} +#endif // OS_WIN + +std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) { + cef_string_utf8_t str = {0}; + std::wstring tmp_str(wstr); + cef_string_wide_to_utf8(wstr, tmp_str.size(), &str); + out << str.str; + cef_string_utf8_clear(&str); + return out; +} + +} // namespace logging +} // namespace cef diff --git a/vendor/cef3/libcef_dll/base/cef_ref_counted.cc b/vendor/cef3/libcef_dll/base/cef_ref_counted.cc new file mode 100644 index 00000000000..76b44b5b3ef --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_ref_counted.cc @@ -0,0 +1,53 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/cef_ref_counted.h" +#include "include/base/cef_thread_collision_warner.h" + +namespace base { + +namespace subtle { + +bool RefCountedThreadSafeBase::HasOneRef() const { + return AtomicRefCountIsOne( + &const_cast(this)->ref_count_); +} + +RefCountedThreadSafeBase::RefCountedThreadSafeBase() : ref_count_(0) { +#ifndef NDEBUG + in_dtor_ = false; +#endif +} + +RefCountedThreadSafeBase::~RefCountedThreadSafeBase() { +#ifndef NDEBUG + DCHECK(in_dtor_) << "RefCountedThreadSafe object deleted without " + "calling Release()"; +#endif +} + +void RefCountedThreadSafeBase::AddRef() const { +#ifndef NDEBUG + DCHECK(!in_dtor_); +#endif + AtomicRefCountInc(&ref_count_); +} + +bool RefCountedThreadSafeBase::Release() const { +#ifndef NDEBUG + DCHECK(!in_dtor_); + DCHECK(!AtomicRefCountIsZero(&ref_count_)); +#endif + if (!AtomicRefCountDec(&ref_count_)) { +#ifndef NDEBUG + in_dtor_ = true; +#endif + return true; + } + return false; +} + +} // namespace subtle + +} // namespace base diff --git a/vendor/cef3/libcef_dll/base/cef_string16.cc b/vendor/cef3/libcef_dll/base/cef_string16.cc new file mode 100644 index 00000000000..2e5f0b82061 --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_string16.cc @@ -0,0 +1,89 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/cef_string16.h" + +#if defined(OS_POSIX) +#if defined(WCHAR_T_IS_UTF16) + +#error This file should not be used on 2-byte wchar_t systems +// If this winds up being needed on 2-byte wchar_t systems, either the +// definitions below can be used, or the host system's wide character +// functions like wmemcmp can be wrapped. + +#elif defined(WCHAR_T_IS_UTF32) + +#include +#include + +#include "include/internal/cef_string_types.h" + +namespace base { + +int c16memcmp(const char16* s1, const char16* s2, size_t n) { + // We cannot call memcmp because that changes the semantics. + while (n-- > 0) { + if (*s1 != *s2) { + // We cannot use (*s1 - *s2) because char16 is unsigned. + return ((*s1 < *s2) ? -1 : 1); + } + ++s1; + ++s2; + } + return 0; +} + +size_t c16len(const char16* s) { + const char16 *s_orig = s; + while (*s) { + ++s; + } + return s - s_orig; +} + +const char16* c16memchr(const char16* s, char16 c, size_t n) { + while (n-- > 0) { + if (*s == c) { + return s; + } + ++s; + } + return 0; +} + +char16* c16memmove(char16* s1, const char16* s2, size_t n) { + return static_cast(memmove(s1, s2, n * sizeof(char16))); +} + +char16* c16memcpy(char16* s1, const char16* s2, size_t n) { + return static_cast(memcpy(s1, s2, n * sizeof(char16))); +} + +char16* c16memset(char16* s, char16 c, size_t n) { + char16 *s_orig = s; + while (n-- > 0) { + *s = c; + ++s; + } + return s_orig; +} + +std::ostream& operator<<(std::ostream& out, const string16& str) { + cef_string_utf8_t cef_str = {0}; + cef_string_utf16_to_utf8(str.c_str(), str.size(), &cef_str); + out << cef_str.str; + cef_string_utf8_clear(&cef_str); + return out; +} + +void PrintTo(const string16& str, std::ostream* out) { + *out << str; +} + +} // namespace base + +template class std::basic_string; + +#endif // WCHAR_T_IS_UTF32 +#endif // OS_POSIX diff --git a/vendor/cef3/libcef_dll/base/cef_thread_checker_impl.cc b/vendor/cef3/libcef_dll/base/cef_thread_checker_impl.cc new file mode 100644 index 00000000000..d3193a28d5e --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_thread_checker_impl.cc @@ -0,0 +1,34 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/internal/cef_thread_checker_impl.h" + +namespace base { + +ThreadCheckerImpl::ThreadCheckerImpl() + : valid_thread_id_() { + EnsureThreadIdAssigned(); +} + +ThreadCheckerImpl::~ThreadCheckerImpl() {} + +bool ThreadCheckerImpl::CalledOnValidThread() const { + EnsureThreadIdAssigned(); + AutoLock auto_lock(lock_); + return valid_thread_id_ == PlatformThread::CurrentRef(); +} + +void ThreadCheckerImpl::DetachFromThread() { + AutoLock auto_lock(lock_); + valid_thread_id_ = PlatformThreadRef(); +} + +void ThreadCheckerImpl::EnsureThreadIdAssigned() const { + AutoLock auto_lock(lock_); + if (valid_thread_id_.is_null()) { + valid_thread_id_ = PlatformThread::CurrentRef(); + } +} + +} // namespace base diff --git a/vendor/cef3/libcef_dll/base/cef_thread_collision_warner.cc b/vendor/cef3/libcef_dll/base/cef_thread_collision_warner.cc new file mode 100644 index 00000000000..794ab64a44f --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_thread_collision_warner.cc @@ -0,0 +1,65 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/cef_thread_collision_warner.h" + +#include "include/base/cef_logging.h" +#include "include/internal/cef_thread_internal.h" + +namespace base { + +void DCheckAsserter::warn() { + NOTREACHED() << "Thread Collision"; +} + +static subtle::Atomic32 CurrentThread() { + const cef_platform_thread_id_t current_thread_id = + cef_get_current_platform_thread_id(); + // We need to get the thread id into an atomic data type. This might be a + // truncating conversion, but any loss-of-information just increases the + // chance of a fault negative, not a false positive. + const subtle::Atomic32 atomic_thread_id = + static_cast(current_thread_id); + + return atomic_thread_id; +} + +void ThreadCollisionWarner::EnterSelf() { + // If the active thread is 0 then I'll write the current thread ID + // if two or more threads arrive here only one will succeed to + // write on valid_thread_id_ the current thread ID. + subtle::Atomic32 current_thread_id = CurrentThread(); + + int previous_value = subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, + 0, + current_thread_id); + if (previous_value != 0 && previous_value != current_thread_id) { + // gotcha! a thread is trying to use the same class and that is + // not current thread. + asserter_->warn(); + } + + subtle::NoBarrier_AtomicIncrement(&counter_, 1); +} + +void ThreadCollisionWarner::Enter() { + subtle::Atomic32 current_thread_id = CurrentThread(); + + if (subtle::NoBarrier_CompareAndSwap(&valid_thread_id_, + 0, + current_thread_id) != 0) { + // gotcha! another thread is trying to use the same class. + asserter_->warn(); + } + + subtle::NoBarrier_AtomicIncrement(&counter_, 1); +} + +void ThreadCollisionWarner::Leave() { + if (subtle::Barrier_AtomicIncrement(&counter_, -1) == 0) { + subtle::NoBarrier_Store(&valid_thread_id_, 0); + } +} + +} // namespace base diff --git a/vendor/cef3/libcef_dll/base/cef_weak_ptr.cc b/vendor/cef3/libcef_dll/base/cef_weak_ptr.cc new file mode 100644 index 00000000000..f8a9779d53e --- /dev/null +++ b/vendor/cef3/libcef_dll/base/cef_weak_ptr.cc @@ -0,0 +1,77 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "include/base/cef_weak_ptr.h" + +namespace base { +namespace internal { + +WeakReference::Flag::Flag() : is_valid_(true) { + // Flags only become bound when checked for validity, or invalidated, + // so that we can check that later validity/invalidation operations on + // the same Flag take place on the same thread. + thread_checker_.DetachFromThread(); +} + +void WeakReference::Flag::Invalidate() { + // The flag being invalidated with a single ref implies that there are no + // weak pointers in existence. Allow deletion on other thread in this case. + DCHECK(thread_checker_.CalledOnValidThread() || HasOneRef()) + << "WeakPtrs must be invalidated on the same thread."; + is_valid_ = false; +} + +bool WeakReference::Flag::IsValid() const { + DCHECK(thread_checker_.CalledOnValidThread()) + << "WeakPtrs must be checked on the same thread."; + return is_valid_; +} + +WeakReference::Flag::~Flag() { +} + +WeakReference::WeakReference() { +} + +WeakReference::WeakReference(const Flag* flag) : flag_(flag) { +} + +WeakReference::~WeakReference() { +} + +bool WeakReference::is_valid() const { return flag_.get() && flag_->IsValid(); } + +WeakReferenceOwner::WeakReferenceOwner() { +} + +WeakReferenceOwner::~WeakReferenceOwner() { + Invalidate(); +} + +WeakReference WeakReferenceOwner::GetRef() const { + // If we hold the last reference to the Flag then create a new one. + if (!HasRefs()) + flag_ = new WeakReference::Flag(); + + return WeakReference(flag_.get()); +} + +void WeakReferenceOwner::Invalidate() { + if (flag_.get()) { + flag_->Invalidate(); + flag_ = NULL; + } +} + +WeakPtrBase::WeakPtrBase() { +} + +WeakPtrBase::~WeakPtrBase() { +} + +WeakPtrBase::WeakPtrBase(const WeakReference& ref) : ref_(ref) { +} + +} // namespace internal +} // namespace base diff --git a/vendor/cef3/libcef_dll/cpptoc/app_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/app_cpptoc.cc new file mode 100644 index 00000000000..557b3a1c85e --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/app_cpptoc.cc @@ -0,0 +1,125 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/app_cpptoc.h" +#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" +#include "libcef_dll/cpptoc/render_process_handler_cpptoc.h" +#include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h" +#include "libcef_dll/ctocpp/command_line_ctocpp.h" +#include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK app_on_before_command_line_processing(struct _cef_app_t* self, + const cef_string_t* process_type, + struct _cef_command_line_t* command_line) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: command_line; type: refptr_diff + DCHECK(command_line); + if (!command_line) + return; + // Unverified params: process_type + + // Execute + CefAppCppToC::Get(self)->OnBeforeCommandLineProcessing( + CefString(process_type), + CefCommandLineCToCpp::Wrap(command_line)); +} + +void CEF_CALLBACK app_on_register_custom_schemes(struct _cef_app_t* self, + struct _cef_scheme_registrar_t* registrar) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: registrar; type: refptr_diff + DCHECK(registrar); + if (!registrar) + return; + + // Execute + CefAppCppToC::Get(self)->OnRegisterCustomSchemes( + CefSchemeRegistrarCToCpp::Wrap(registrar)); +} + +struct _cef_resource_bundle_handler_t* CEF_CALLBACK app_get_resource_bundle_handler( + struct _cef_app_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefAppCppToC::Get( + self)->GetResourceBundleHandler(); + + // Return type: refptr_same + return CefResourceBundleHandlerCppToC::Wrap(_retval); +} + +struct _cef_browser_process_handler_t* CEF_CALLBACK app_get_browser_process_handler( + struct _cef_app_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefAppCppToC::Get( + self)->GetBrowserProcessHandler(); + + // Return type: refptr_same + return CefBrowserProcessHandlerCppToC::Wrap(_retval); +} + +struct _cef_render_process_handler_t* CEF_CALLBACK app_get_render_process_handler( + struct _cef_app_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefAppCppToC::Get( + self)->GetRenderProcessHandler(); + + // Return type: refptr_same + return CefRenderProcessHandlerCppToC::Wrap(_retval); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefAppCppToC::CefAppCppToC(CefApp* cls) + : CefCppToC(cls) { + struct_.struct_.on_before_command_line_processing = + app_on_before_command_line_processing; + struct_.struct_.on_register_custom_schemes = app_on_register_custom_schemes; + struct_.struct_.get_resource_bundle_handler = app_get_resource_bundle_handler; + struct_.struct_.get_browser_process_handler = app_get_browser_process_handler; + struct_.struct_.get_render_process_handler = app_get_render_process_handler; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/app_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/app_cpptoc.h new file mode 100644 index 00000000000..27379e39910 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/app_cpptoc.h @@ -0,0 +1,36 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_app.h" +#include "include/capi/cef_app_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefAppCppToC + : public CefCppToC { + public: + explicit CefAppCppToC(CefApp* cls); + virtual ~CefAppCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_APP_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/base_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/base_cpptoc.h new file mode 100644 index 00000000000..fc20cb7ca49 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/base_cpptoc.h @@ -0,0 +1,148 @@ +// Copyright (c) 2009 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. + +#ifndef CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ +#pragma once + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" + +// CefCppToC implementation for CefBase. +class CefBaseCppToC : public CefBase { + public: + // Use this method to retrieve the underlying class instance from our + // own structure when the structure is passed as the required first + // parameter of a C API function call. No explicit reference counting + // is done in this case. + static CefRefPtr Get(cef_base_t* s) { + DCHECK(s); + + // Cast our structure to the wrapper structure type. + CefBaseCppToC::Struct* wrapperStruct = + reinterpret_cast(s); + // Return the underlying object instance. + return wrapperStruct->class_->GetClass(); + } + + // Use this method to create a wrapper structure for passing our class + // instance to the other side. + static cef_base_t* Wrap(CefRefPtr c) { + if (!c.get()) + return NULL; + + // Wrap our object with the CefCppToC class. + CefBaseCppToC* wrapper = new CefBaseCppToC(c); + // Add a reference to our wrapper object that will be released once our + // structure arrives on the other side. + wrapper->AddRef(); + // Return the structure pointer that can now be passed to the other side. + return wrapper->GetStruct(); + } + + // Use this method to retrieve the underlying class instance when receiving + // our wrapper structure back from the other side. + static CefRefPtr Unwrap(cef_base_t* s) { + if (!s) + return NULL; + + // Cast our structure to the wrapper structure type. + CefBaseCppToC::Struct* wrapperStruct = + reinterpret_cast(s); + // Add the underlying object instance to a smart pointer. + CefRefPtr objectPtr(wrapperStruct->class_->GetClass()); + // Release the reference to our wrapper object that was added before the + // structure was passed back to us. + wrapperStruct->class_->Release(); + // Return the underlying object instance. + return objectPtr; + } + + // Structure representation with pointer to the C++ class. + struct Struct { + cef_base_t struct_; + CefBaseCppToC* class_; + }; + + explicit CefBaseCppToC(CefBase* cls) + : class_(cls) { + DCHECK(cls); + + struct_.class_ = this; + + // zero the underlying structure and set base members + memset(&struct_.struct_, 0, sizeof(cef_base_t)); + struct_.struct_.size = sizeof(cef_base_t); + struct_.struct_.add_ref = struct_add_ref; + struct_.struct_.release = struct_release; + struct_.struct_.has_one_ref = struct_has_one_ref; + } + virtual ~CefBaseCppToC() {} + + CefBase* GetClass() { return class_; } + + // If returning the structure across the DLL boundary you should call + // AddRef() on this CefCppToC object. On the other side of the DLL boundary, + // call UnderlyingRelease() on the wrapping CefCToCpp object. + cef_base_t* GetStruct() { return &struct_.struct_; } + + // CefBase methods increment/decrement reference counts on both this object + // and the underlying wrapper class. + void AddRef() const { + UnderlyingAddRef(); + ref_count_.AddRef(); + } + bool Release() const { + UnderlyingRelease(); + if (ref_count_.Release()) { + delete this; + return true; + } + return false; + } + bool HasOneRef() const { return ref_count_.HasOneRef(); } + + // Increment/decrement reference counts on only the underlying class. + void UnderlyingAddRef() const { class_->AddRef(); } + bool UnderlyingRelease() const { return class_->Release(); } + bool UnderlyingHasOneRef() const { return class_->HasOneRef(); } + + private: + static void CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) { + DCHECK(base); + if (!base) + return; + + Struct* impl = reinterpret_cast(base); + impl->class_->AddRef(); + } + + static int CEF_CALLBACK struct_release(struct _cef_base_t* base) { + DCHECK(base); + if (!base) + return 0; + + Struct* impl = reinterpret_cast(base); + return impl->class_->Release(); + } + + static int CEF_CALLBACK struct_has_one_ref(struct _cef_base_t* base) { + DCHECK(base); + if (!base) + return 0; + + Struct* impl = reinterpret_cast(base); + return impl->class_->HasOneRef(); + } + + CefRefCount ref_count_; + Struct struct_; + CefBase* class_; + + DISALLOW_COPY_AND_ASSIGN(CefBaseCppToC); +}; + +#endif // CEF_LIBCEF_DLL_CPPTOC_BASE_CPPTOC_H_ diff --git a/vendor/cef3/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc new file mode 100644 index 00000000000..7748d276f03 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/browser_process_handler_cpptoc.cc @@ -0,0 +1,105 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" +#include "libcef_dll/cpptoc/print_handler_cpptoc.h" +#include "libcef_dll/ctocpp/command_line_ctocpp.h" +#include "libcef_dll/ctocpp/list_value_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK browser_process_handler_on_context_initialized( + struct _cef_browser_process_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + + // Execute + CefBrowserProcessHandlerCppToC::Get(self)->OnContextInitialized(); +} + +void CEF_CALLBACK browser_process_handler_on_before_child_process_launch( + struct _cef_browser_process_handler_t* self, + struct _cef_command_line_t* command_line) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: command_line; type: refptr_diff + DCHECK(command_line); + if (!command_line) + return; + + // Execute + CefBrowserProcessHandlerCppToC::Get(self)->OnBeforeChildProcessLaunch( + CefCommandLineCToCpp::Wrap(command_line)); +} + +void CEF_CALLBACK browser_process_handler_on_render_process_thread_created( + struct _cef_browser_process_handler_t* self, + struct _cef_list_value_t* extra_info) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: extra_info; type: refptr_diff + DCHECK(extra_info); + if (!extra_info) + return; + + // Execute + CefBrowserProcessHandlerCppToC::Get(self)->OnRenderProcessThreadCreated( + CefListValueCToCpp::Wrap(extra_info)); +} + +struct _cef_print_handler_t* CEF_CALLBACK browser_process_handler_get_print_handler( + struct _cef_browser_process_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefBrowserProcessHandlerCppToC::Get( + self)->GetPrintHandler(); + + // Return type: refptr_same + return CefPrintHandlerCppToC::Wrap(_retval); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefBrowserProcessHandlerCppToC::CefBrowserProcessHandlerCppToC( + CefBrowserProcessHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_context_initialized = + browser_process_handler_on_context_initialized; + struct_.struct_.on_before_child_process_launch = + browser_process_handler_on_before_child_process_launch; + struct_.struct_.on_render_process_thread_created = + browser_process_handler_on_render_process_thread_created; + struct_.struct_.get_print_handler = browser_process_handler_get_print_handler; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/browser_process_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/browser_process_handler_cpptoc.h new file mode 100644 index 00000000000..f8fba275822 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/browser_process_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_browser_process_handler.h" +#include "include/capi/cef_browser_process_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefBrowserProcessHandlerCppToC + : public CefCppToC { + public: + explicit CefBrowserProcessHandlerCppToC(CefBrowserProcessHandler* cls); + virtual ~CefBrowserProcessHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_BROWSER_PROCESS_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/client_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/client_cpptoc.cc new file mode 100644 index 00000000000..c06675e0957 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/client_cpptoc.cc @@ -0,0 +1,294 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/client_cpptoc.h" +#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h" +#include "libcef_dll/cpptoc/dialog_handler_cpptoc.h" +#include "libcef_dll/cpptoc/display_handler_cpptoc.h" +#include "libcef_dll/cpptoc/download_handler_cpptoc.h" +#include "libcef_dll/cpptoc/drag_handler_cpptoc.h" +#include "libcef_dll/cpptoc/focus_handler_cpptoc.h" +#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h" +#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h" +#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h" +#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h" +#include "libcef_dll/cpptoc/load_handler_cpptoc.h" +#include "libcef_dll/cpptoc/render_handler_cpptoc.h" +#include "libcef_dll/cpptoc/request_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/process_message_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +struct _cef_context_menu_handler_t* CEF_CALLBACK client_get_context_menu_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetContextMenuHandler(); + + // Return type: refptr_same + return CefContextMenuHandlerCppToC::Wrap(_retval); +} + +struct _cef_dialog_handler_t* CEF_CALLBACK client_get_dialog_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetDialogHandler(); + + // Return type: refptr_same + return CefDialogHandlerCppToC::Wrap(_retval); +} + +struct _cef_display_handler_t* CEF_CALLBACK client_get_display_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetDisplayHandler(); + + // Return type: refptr_same + return CefDisplayHandlerCppToC::Wrap(_retval); +} + +struct _cef_download_handler_t* CEF_CALLBACK client_get_download_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetDownloadHandler(); + + // Return type: refptr_same + return CefDownloadHandlerCppToC::Wrap(_retval); +} + +struct _cef_drag_handler_t* CEF_CALLBACK client_get_drag_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetDragHandler(); + + // Return type: refptr_same + return CefDragHandlerCppToC::Wrap(_retval); +} + +struct _cef_focus_handler_t* CEF_CALLBACK client_get_focus_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetFocusHandler(); + + // Return type: refptr_same + return CefFocusHandlerCppToC::Wrap(_retval); +} + +struct _cef_geolocation_handler_t* CEF_CALLBACK client_get_geolocation_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetGeolocationHandler(); + + // Return type: refptr_same + return CefGeolocationHandlerCppToC::Wrap(_retval); +} + +struct _cef_jsdialog_handler_t* CEF_CALLBACK client_get_jsdialog_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetJSDialogHandler(); + + // Return type: refptr_same + return CefJSDialogHandlerCppToC::Wrap(_retval); +} + +struct _cef_keyboard_handler_t* CEF_CALLBACK client_get_keyboard_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetKeyboardHandler(); + + // Return type: refptr_same + return CefKeyboardHandlerCppToC::Wrap(_retval); +} + +struct _cef_life_span_handler_t* CEF_CALLBACK client_get_life_span_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetLifeSpanHandler(); + + // Return type: refptr_same + return CefLifeSpanHandlerCppToC::Wrap(_retval); +} + +struct _cef_load_handler_t* CEF_CALLBACK client_get_load_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetLoadHandler(); + + // Return type: refptr_same + return CefLoadHandlerCppToC::Wrap(_retval); +} + +struct _cef_render_handler_t* CEF_CALLBACK client_get_render_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetRenderHandler(); + + // Return type: refptr_same + return CefRenderHandlerCppToC::Wrap(_retval); +} + +struct _cef_request_handler_t* CEF_CALLBACK client_get_request_handler( + struct _cef_client_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefClientCppToC::Get( + self)->GetRequestHandler(); + + // Return type: refptr_same + return CefRequestHandlerCppToC::Wrap(_retval); +} + +int CEF_CALLBACK client_on_process_message_received(struct _cef_client_t* self, + cef_browser_t* browser, cef_process_id_t source_process, + struct _cef_process_message_t* message) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: message; type: refptr_diff + DCHECK(message); + if (!message) + return 0; + + // Execute + bool _retval = CefClientCppToC::Get(self)->OnProcessMessageReceived( + CefBrowserCToCpp::Wrap(browser), + source_process, + CefProcessMessageCToCpp::Wrap(message)); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefClientCppToC::CefClientCppToC(CefClient* cls) + : CefCppToC(cls) { + struct_.struct_.get_context_menu_handler = client_get_context_menu_handler; + struct_.struct_.get_dialog_handler = client_get_dialog_handler; + struct_.struct_.get_display_handler = client_get_display_handler; + struct_.struct_.get_download_handler = client_get_download_handler; + struct_.struct_.get_drag_handler = client_get_drag_handler; + struct_.struct_.get_focus_handler = client_get_focus_handler; + struct_.struct_.get_geolocation_handler = client_get_geolocation_handler; + struct_.struct_.get_jsdialog_handler = client_get_jsdialog_handler; + struct_.struct_.get_keyboard_handler = client_get_keyboard_handler; + struct_.struct_.get_life_span_handler = client_get_life_span_handler; + struct_.struct_.get_load_handler = client_get_load_handler; + struct_.struct_.get_render_handler = client_get_render_handler; + struct_.struct_.get_request_handler = client_get_request_handler; + struct_.struct_.on_process_message_received = + client_on_process_message_received; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/client_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/client_cpptoc.h new file mode 100644 index 00000000000..16919e89b50 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/client_cpptoc.h @@ -0,0 +1,36 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefClientCppToC + : public CefCppToC { + public: + explicit CefClientCppToC(CefClient* cls); + virtual ~CefClientCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_CLIENT_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/completion_callback_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/completion_callback_cpptoc.cc new file mode 100644 index 00000000000..3b8d25a8592 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/completion_callback_cpptoc.cc @@ -0,0 +1,44 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/completion_callback_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK completion_callback_on_complete( + struct _cef_completion_callback_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + + // Execute + CefCompletionCallbackCppToC::Get(self)->OnComplete(); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefCompletionCallbackCppToC::CefCompletionCallbackCppToC( + CefCompletionCallback* cls) + : CefCppToC(cls) { + struct_.struct_.on_complete = completion_callback_on_complete; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/completion_callback_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/completion_callback_cpptoc.h new file mode 100644 index 00000000000..b198ad8ab63 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/completion_callback_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_callback.h" +#include "include/capi/cef_callback_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefCompletionCallbackCppToC + : public CefCppToC { + public: + explicit CefCompletionCallbackCppToC(CefCompletionCallback* cls); + virtual ~CefCompletionCallbackCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_COMPLETION_CALLBACK_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc new file mode 100644 index 00000000000..b1924f430b9 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/context_menu_handler_cpptoc.cc @@ -0,0 +1,132 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/context_menu_params_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/menu_model_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK context_menu_handler_on_before_context_menu( + struct _cef_context_menu_handler_t* self, cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + struct _cef_menu_model_t* model) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + // Verify param: params; type: refptr_diff + DCHECK(params); + if (!params) + return; + // Verify param: model; type: refptr_diff + DCHECK(model); + if (!model) + return; + + // Execute + CefContextMenuHandlerCppToC::Get(self)->OnBeforeContextMenu( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefContextMenuParamsCToCpp::Wrap(params), + CefMenuModelCToCpp::Wrap(model)); +} + +int CEF_CALLBACK context_menu_handler_on_context_menu_command( + struct _cef_context_menu_handler_t* self, cef_browser_t* browser, + struct _cef_frame_t* frame, struct _cef_context_menu_params_t* params, + int command_id, cef_event_flags_t event_flags) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return 0; + // Verify param: params; type: refptr_diff + DCHECK(params); + if (!params) + return 0; + + // Execute + bool _retval = CefContextMenuHandlerCppToC::Get(self)->OnContextMenuCommand( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefContextMenuParamsCToCpp::Wrap(params), + command_id, + event_flags); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK context_menu_handler_on_context_menu_dismissed( + struct _cef_context_menu_handler_t* self, cef_browser_t* browser, + struct _cef_frame_t* frame) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + + // Execute + CefContextMenuHandlerCppToC::Get(self)->OnContextMenuDismissed( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefContextMenuHandlerCppToC::CefContextMenuHandlerCppToC( + CefContextMenuHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_before_context_menu = + context_menu_handler_on_before_context_menu; + struct_.struct_.on_context_menu_command = + context_menu_handler_on_context_menu_command; + struct_.struct_.on_context_menu_dismissed = + context_menu_handler_on_context_menu_dismissed; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/context_menu_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/context_menu_handler_cpptoc.h new file mode 100644 index 00000000000..e84bc23b769 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/context_menu_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_context_menu_handler.h" +#include "include/capi/cef_context_menu_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefContextMenuHandlerCppToC + : public CefCppToC { + public: + explicit CefContextMenuHandlerCppToC(CefContextMenuHandler* cls); + virtual ~CefContextMenuHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_CONTEXT_MENU_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc new file mode 100644 index 00000000000..c93c2eef48a --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/cookie_visitor_cpptoc.cc @@ -0,0 +1,70 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK cookie_visitor_visit(struct _cef_cookie_visitor_t* self, + const struct _cef_cookie_t* cookie, int count, int total, + int* deleteCookie) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: cookie; type: struct_byref_const + DCHECK(cookie); + if (!cookie) + return 0; + // Verify param: deleteCookie; type: bool_byref + DCHECK(deleteCookie); + if (!deleteCookie) + return 0; + + // Translate param: cookie; type: struct_byref_const + CefCookie cookieObj; + if (cookie) + cookieObj.Set(*cookie, false); + // Translate param: deleteCookie; type: bool_byref + bool deleteCookieBool = (deleteCookie && *deleteCookie)?true:false; + + // Execute + bool _retval = CefCookieVisitorCppToC::Get(self)->Visit( + cookieObj, + count, + total, + deleteCookieBool); + + // Restore param: deleteCookie; type: bool_byref + if (deleteCookie) + *deleteCookie = deleteCookieBool?true:false; + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefCookieVisitorCppToC::CefCookieVisitorCppToC(CefCookieVisitor* cls) + : CefCppToC( + cls) { + struct_.struct_.visit = cookie_visitor_visit; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/cookie_visitor_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/cookie_visitor_cpptoc.h new file mode 100644 index 00000000000..5b14176216e --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/cookie_visitor_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_cookie.h" +#include "include/capi/cef_cookie_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefCookieVisitorCppToC + : public CefCppToC { + public: + explicit CefCookieVisitorCppToC(CefCookieVisitor* cls); + virtual ~CefCookieVisitorCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_COOKIE_VISITOR_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/cpptoc.h new file mode 100644 index 00000000000..a1b37d99e4f --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/cpptoc.h @@ -0,0 +1,165 @@ +// Copyright (c) 2009 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. + +#ifndef CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_ +#pragma once + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" + + +// Wrap a C++ class with a C structure. This is used when the class +// implementation exists on this side of the DLL boundary but will have methods +// called from the other side of the DLL boundary. +template +class CefCppToC : public CefBase { + public: + // Structure representation with pointer to the C++ class. + struct Struct { + StructName struct_; + CefCppToC* class_; + }; + + // Use this method to retrieve the underlying class instance from our + // own structure when the structure is passed as the required first + // parameter of a C API function call. No explicit reference counting + // is done in this case. + static CefRefPtr Get(StructName* s) { + DCHECK(s); + + // Cast our structure to the wrapper structure type. + Struct* wrapperStruct = reinterpret_cast(s); + // Return the underlying object instance. + return wrapperStruct->class_->GetClass(); + } + + // Use this method to create a wrapper structure for passing our class + // instance to the other side. + static StructName* Wrap(CefRefPtr c) { + if (!c.get()) + return NULL; + + // Wrap our object with the CefCppToC class. + ClassName* wrapper = new ClassName(c.get()); + // Add a reference to our wrapper object that will be released once our + // structure arrives on the other side. + wrapper->AddRef(); + // Return the structure pointer that can now be passed to the other side. + return wrapper->GetStruct(); + } + + // Use this method to retrieve the underlying class instance when receiving + // our wrapper structure back from the other side. + static CefRefPtr Unwrap(StructName* s) { + if (!s) + return NULL; + + // Cast our structure to the wrapper structure type. + Struct* wrapperStruct = reinterpret_cast(s); + // Add the underlying object instance to a smart pointer. + CefRefPtr objectPtr(wrapperStruct->class_->GetClass()); + // Release the reference to our wrapper object that was added before the + // structure was passed back to us. + wrapperStruct->class_->Release(); + // Return the underlying object instance. + return objectPtr; + } + + explicit CefCppToC(BaseName* cls) + : class_(cls) { + DCHECK(cls); + + struct_.class_ = this; + + // zero the underlying structure and set base members + memset(&struct_.struct_, 0, sizeof(StructName)); + struct_.struct_.base.size = sizeof(StructName); + struct_.struct_.base.add_ref = struct_add_ref; + struct_.struct_.base.release = struct_release; + struct_.struct_.base.has_one_ref = struct_has_one_ref; + +#ifndef NDEBUG + base::AtomicRefCountInc(&DebugObjCt); +#endif + } + virtual ~CefCppToC() { +#ifndef NDEBUG + base::AtomicRefCountDec(&DebugObjCt); +#endif + } + + BaseName* GetClass() { return class_; } + + // If returning the structure across the DLL boundary you should call + // AddRef() on this CefCppToC object. On the other side of the DLL boundary, + // call UnderlyingRelease() on the wrapping CefCToCpp object. + StructName* GetStruct() { return &struct_.struct_; } + + // CefBase methods increment/decrement reference counts on both this object + // and the underlying wrapper class. + void AddRef() const { + UnderlyingAddRef(); + ref_count_.AddRef(); + } + bool Release() const { + UnderlyingRelease(); + if (ref_count_.Release()) { + delete this; + return true; + } + return false; + } + bool HasOneRef() const { return ref_count_.HasOneRef(); } + + // Increment/decrement reference counts on only the underlying class. + void UnderlyingAddRef() const { class_->AddRef(); } + bool UnderlyingRelease() const { return class_->Release(); } + bool UnderlyingHasOneRef() const { return class_->HasOneRef(); } + +#ifndef NDEBUG + // Simple tracking of allocated objects. + static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int) +#endif + + protected: + Struct struct_; + BaseName* class_; + + private: + static void CEF_CALLBACK struct_add_ref(struct _cef_base_t* base) { + DCHECK(base); + if (!base) + return; + + Struct* impl = reinterpret_cast(base); + impl->class_->AddRef(); + } + + static int CEF_CALLBACK struct_release(struct _cef_base_t* base) { + DCHECK(base); + if (!base) + return 0; + + Struct* impl = reinterpret_cast(base); + return impl->class_->Release(); + } + + static int CEF_CALLBACK struct_has_one_ref(struct _cef_base_t* base) { + DCHECK(base); + if (!base) + return 0; + + Struct* impl = reinterpret_cast(base); + return impl->class_->HasOneRef(); + } + + CefRefCount ref_count_; + + DISALLOW_COPY_AND_ASSIGN(CefCppToC); +}; + +#endif // CEF_LIBCEF_DLL_CPPTOC_CPPTOC_H_ diff --git a/vendor/cef3/libcef_dll/cpptoc/dialog_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/dialog_handler_cpptoc.cc new file mode 100644 index 00000000000..80320a36fce --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/dialog_handler_cpptoc.cc @@ -0,0 +1,71 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/dialog_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK dialog_handler_on_file_dialog( + struct _cef_dialog_handler_t* self, cef_browser_t* browser, + cef_file_dialog_mode_t mode, const cef_string_t* title, + const cef_string_t* default_file_name, cef_string_list_t accept_types, + cef_file_dialog_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + // Unverified params: title, default_file_name, accept_types + + // Translate param: accept_types; type: string_vec_byref_const + std::vector accept_typesList; + transfer_string_list_contents(accept_types, accept_typesList); + + // Execute + bool _retval = CefDialogHandlerCppToC::Get(self)->OnFileDialog( + CefBrowserCToCpp::Wrap(browser), + mode, + CefString(title), + CefString(default_file_name), + accept_typesList, + CefFileDialogCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefDialogHandlerCppToC::CefDialogHandlerCppToC(CefDialogHandler* cls) + : CefCppToC( + cls) { + struct_.struct_.on_file_dialog = dialog_handler_on_file_dialog; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/dialog_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/dialog_handler_cpptoc.h new file mode 100644 index 00000000000..a629a5ee02d --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/dialog_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_dialog_handler.h" +#include "include/capi/cef_dialog_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefDialogHandlerCppToC + : public CefCppToC { + public: + explicit CefDialogHandlerCppToC(CefDialogHandler* cls); + virtual ~CefDialogHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DIALOG_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/display_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/display_handler_cpptoc.cc new file mode 100644 index 00000000000..3b950f7818c --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/display_handler_cpptoc.cc @@ -0,0 +1,155 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/display_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK display_handler_on_address_change( + struct _cef_display_handler_t* self, cef_browser_t* browser, + struct _cef_frame_t* frame, const cef_string_t* url) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return; + + // Execute + CefDisplayHandlerCppToC::Get(self)->OnAddressChange( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefString(url)); +} + +void CEF_CALLBACK display_handler_on_title_change( + struct _cef_display_handler_t* self, cef_browser_t* browser, + const cef_string_t* title) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Unverified params: title + + // Execute + CefDisplayHandlerCppToC::Get(self)->OnTitleChange( + CefBrowserCToCpp::Wrap(browser), + CefString(title)); +} + +int CEF_CALLBACK display_handler_on_tooltip(struct _cef_display_handler_t* self, + cef_browser_t* browser, cef_string_t* text) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Unverified params: text + + // Translate param: text; type: string_byref + CefString textStr(text); + + // Execute + bool _retval = CefDisplayHandlerCppToC::Get(self)->OnTooltip( + CefBrowserCToCpp::Wrap(browser), + textStr); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK display_handler_on_status_message( + struct _cef_display_handler_t* self, cef_browser_t* browser, + const cef_string_t* value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Unverified params: value + + // Execute + CefDisplayHandlerCppToC::Get(self)->OnStatusMessage( + CefBrowserCToCpp::Wrap(browser), + CefString(value)); +} + +int CEF_CALLBACK display_handler_on_console_message( + struct _cef_display_handler_t* self, cef_browser_t* browser, + const cef_string_t* message, const cef_string_t* source, int line) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Unverified params: message, source + + // Execute + bool _retval = CefDisplayHandlerCppToC::Get(self)->OnConsoleMessage( + CefBrowserCToCpp::Wrap(browser), + CefString(message), + CefString(source), + line); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefDisplayHandlerCppToC::CefDisplayHandlerCppToC(CefDisplayHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_address_change = display_handler_on_address_change; + struct_.struct_.on_title_change = display_handler_on_title_change; + struct_.struct_.on_tooltip = display_handler_on_tooltip; + struct_.struct_.on_status_message = display_handler_on_status_message; + struct_.struct_.on_console_message = display_handler_on_console_message; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/display_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/display_handler_cpptoc.h new file mode 100644 index 00000000000..305600d54af --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/display_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_display_handler.h" +#include "include/capi/cef_display_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefDisplayHandlerCppToC + : public CefCppToC { + public: + explicit CefDisplayHandlerCppToC(CefDisplayHandler* cls); + virtual ~CefDisplayHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DISPLAY_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/domvisitor_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/domvisitor_cpptoc.cc new file mode 100644 index 00000000000..1cb49108b6a --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/domvisitor_cpptoc.cc @@ -0,0 +1,48 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/domvisitor_cpptoc.h" +#include "libcef_dll/ctocpp/domdocument_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK domvisitor_visit(struct _cef_domvisitor_t* self, + struct _cef_domdocument_t* document) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: document; type: refptr_diff + DCHECK(document); + if (!document) + return; + + // Execute + CefDOMVisitorCppToC::Get(self)->Visit( + CefDOMDocumentCToCpp::Wrap(document)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefDOMVisitorCppToC::CefDOMVisitorCppToC(CefDOMVisitor* cls) + : CefCppToC(cls) { + struct_.struct_.visit = domvisitor_visit; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/domvisitor_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/domvisitor_cpptoc.h new file mode 100644 index 00000000000..c5196b2db59 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/domvisitor_cpptoc.h @@ -0,0 +1,36 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefDOMVisitorCppToC + : public CefCppToC { + public: + explicit CefDOMVisitorCppToC(CefDOMVisitor* cls); + virtual ~CefDOMVisitorCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOMVISITOR_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/download_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/download_handler_cpptoc.cc new file mode 100644 index 00000000000..277b632b988 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/download_handler_cpptoc.cc @@ -0,0 +1,100 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/download_handler_cpptoc.h" +#include "libcef_dll/ctocpp/before_download_callback_ctocpp.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/download_item_ctocpp.h" +#include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK download_handler_on_before_download( + struct _cef_download_handler_t* self, cef_browser_t* browser, + struct _cef_download_item_t* download_item, + const cef_string_t* suggested_name, + cef_before_download_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: download_item; type: refptr_diff + DCHECK(download_item); + if (!download_item) + return; + // Verify param: suggested_name; type: string_byref_const + DCHECK(suggested_name); + if (!suggested_name) + return; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return; + + // Execute + CefDownloadHandlerCppToC::Get(self)->OnBeforeDownload( + CefBrowserCToCpp::Wrap(browser), + CefDownloadItemCToCpp::Wrap(download_item), + CefString(suggested_name), + CefBeforeDownloadCallbackCToCpp::Wrap(callback)); +} + +void CEF_CALLBACK download_handler_on_download_updated( + struct _cef_download_handler_t* self, cef_browser_t* browser, + struct _cef_download_item_t* download_item, + cef_download_item_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: download_item; type: refptr_diff + DCHECK(download_item); + if (!download_item) + return; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return; + + // Execute + CefDownloadHandlerCppToC::Get(self)->OnDownloadUpdated( + CefBrowserCToCpp::Wrap(browser), + CefDownloadItemCToCpp::Wrap(download_item), + CefDownloadItemCallbackCToCpp::Wrap(callback)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefDownloadHandlerCppToC::CefDownloadHandlerCppToC(CefDownloadHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_before_download = download_handler_on_before_download; + struct_.struct_.on_download_updated = download_handler_on_download_updated; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/download_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/download_handler_cpptoc.h new file mode 100644 index 00000000000..dbb13f3b338 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/download_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_download_handler.h" +#include "include/capi/cef_download_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefDownloadHandlerCppToC + : public CefCppToC { + public: + explicit CefDownloadHandlerCppToC(CefDownloadHandler* cls); + virtual ~CefDownloadHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DOWNLOAD_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/drag_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/drag_handler_cpptoc.cc new file mode 100644 index 00000000000..35a67ef9d98 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/drag_handler_cpptoc.cc @@ -0,0 +1,59 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/drag_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/drag_data_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK drag_handler_on_drag_enter(struct _cef_drag_handler_t* self, + cef_browser_t* browser, cef_drag_data_t* dragData, + cef_drag_operations_mask_t mask) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: dragData; type: refptr_diff + DCHECK(dragData); + if (!dragData) + return 0; + + // Execute + bool _retval = CefDragHandlerCppToC::Get(self)->OnDragEnter( + CefBrowserCToCpp::Wrap(browser), + CefDragDataCToCpp::Wrap(dragData), + mask); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefDragHandlerCppToC::CefDragHandlerCppToC(CefDragHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_drag_enter = drag_handler_on_drag_enter; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/drag_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/drag_handler_cpptoc.h new file mode 100644 index 00000000000..91aee16e41d --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/drag_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_drag_handler.h" +#include "include/capi/cef_drag_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefDragHandlerCppToC + : public CefCppToC { + public: + explicit CefDragHandlerCppToC(CefDragHandler* cls); + virtual ~CefDragHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_DRAG_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc new file mode 100644 index 00000000000..5fced58ce9b --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/end_tracing_callback_cpptoc.cc @@ -0,0 +1,51 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK end_tracing_callback_on_end_tracing_complete( + struct _cef_end_tracing_callback_t* self, + const cef_string_t* tracing_file) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: tracing_file; type: string_byref_const + DCHECK(tracing_file); + if (!tracing_file) + return; + + // Execute + CefEndTracingCallbackCppToC::Get(self)->OnEndTracingComplete( + CefString(tracing_file)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefEndTracingCallbackCppToC::CefEndTracingCallbackCppToC( + CefEndTracingCallback* cls) + : CefCppToC(cls) { + struct_.struct_.on_end_tracing_complete = + end_tracing_callback_on_end_tracing_complete; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h new file mode 100644 index 00000000000..6e0f4aade26 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/end_tracing_callback_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_trace.h" +#include "include/capi/cef_trace_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefEndTracingCallbackCppToC + : public CefCppToC { + public: + explicit CefEndTracingCallbackCppToC(CefEndTracingCallback* cls); + virtual ~CefEndTracingCallbackCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_END_TRACING_CALLBACK_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/focus_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/focus_handler_cpptoc.cc new file mode 100644 index 00000000000..9276afcbd7e --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/focus_handler_cpptoc.cc @@ -0,0 +1,90 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/focus_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK focus_handler_on_take_focus(struct _cef_focus_handler_t* self, + cef_browser_t* browser, int next) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefFocusHandlerCppToC::Get(self)->OnTakeFocus( + CefBrowserCToCpp::Wrap(browser), + next?true:false); +} + +int CEF_CALLBACK focus_handler_on_set_focus(struct _cef_focus_handler_t* self, + cef_browser_t* browser, cef_focus_source_t source) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + + // Execute + bool _retval = CefFocusHandlerCppToC::Get(self)->OnSetFocus( + CefBrowserCToCpp::Wrap(browser), + source); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK focus_handler_on_got_focus(struct _cef_focus_handler_t* self, + cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefFocusHandlerCppToC::Get(self)->OnGotFocus( + CefBrowserCToCpp::Wrap(browser)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefFocusHandlerCppToC::CefFocusHandlerCppToC(CefFocusHandler* cls) + : CefCppToC( + cls) { + struct_.struct_.on_take_focus = focus_handler_on_take_focus; + struct_.struct_.on_set_focus = focus_handler_on_set_focus; + struct_.struct_.on_got_focus = focus_handler_on_got_focus; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/focus_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/focus_handler_cpptoc.h new file mode 100644 index 00000000000..96734c863ff --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/focus_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_focus_handler.h" +#include "include/capi/cef_focus_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefFocusHandlerCppToC + : public CefCppToC { + public: + explicit CefFocusHandlerCppToC(CefFocusHandler* cls); + virtual ~CefFocusHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_FOCUS_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc new file mode 100644 index 00000000000..1983aec2f48 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/geolocation_handler_cpptoc.cc @@ -0,0 +1,95 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK geolocation_handler_on_request_geolocation_permission( + struct _cef_geolocation_handler_t* self, cef_browser_t* browser, + const cef_string_t* requesting_url, int request_id, + cef_geolocation_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: requesting_url; type: string_byref_const + DCHECK(requesting_url); + if (!requesting_url) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + + // Execute + bool _retval = CefGeolocationHandlerCppToC::Get( + self)->OnRequestGeolocationPermission( + CefBrowserCToCpp::Wrap(browser), + CefString(requesting_url), + request_id, + CefGeolocationCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK geolocation_handler_on_cancel_geolocation_permission( + struct _cef_geolocation_handler_t* self, cef_browser_t* browser, + const cef_string_t* requesting_url, int request_id) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: requesting_url; type: string_byref_const + DCHECK(requesting_url); + if (!requesting_url) + return; + + // Execute + CefGeolocationHandlerCppToC::Get(self)->OnCancelGeolocationPermission( + CefBrowserCToCpp::Wrap(browser), + CefString(requesting_url), + request_id); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefGeolocationHandlerCppToC::CefGeolocationHandlerCppToC( + CefGeolocationHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_request_geolocation_permission = + geolocation_handler_on_request_geolocation_permission; + struct_.struct_.on_cancel_geolocation_permission = + geolocation_handler_on_cancel_geolocation_permission; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/geolocation_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/geolocation_handler_cpptoc.h new file mode 100644 index 00000000000..a82ad420ba4 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/geolocation_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_geolocation_handler.h" +#include "include/capi/cef_geolocation_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefGeolocationHandlerCppToC + : public CefCppToC { + public: + explicit CefGeolocationHandlerCppToC(CefGeolocationHandler* cls); + virtual ~CefGeolocationHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_GEOLOCATION_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc new file mode 100644 index 00000000000..8036c6008ba --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.cc @@ -0,0 +1,57 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK get_geolocation_callback_on_location_update( + struct _cef_get_geolocation_callback_t* self, + const struct _cef_geoposition_t* position) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: position; type: struct_byref_const + DCHECK(position); + if (!position) + return; + + // Translate param: position; type: struct_byref_const + CefGeoposition positionObj; + if (position) + positionObj.Set(*position, false); + + // Execute + CefGetGeolocationCallbackCppToC::Get(self)->OnLocationUpdate( + positionObj); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefGetGeolocationCallbackCppToC::CefGetGeolocationCallbackCppToC( + CefGetGeolocationCallback* cls) + : CefCppToC(cls) { + struct_.struct_.on_location_update = + get_geolocation_callback_on_location_update; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = + 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h new file mode 100644 index 00000000000..30d03775ac1 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_GET_GEOLOCATION_CALLBACK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_GET_GEOLOCATION_CALLBACK_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_geolocation.h" +#include "include/capi/cef_geolocation_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefGetGeolocationCallbackCppToC + : public CefCppToC { + public: + explicit CefGetGeolocationCallbackCppToC(CefGetGeolocationCallback* cls); + virtual ~CefGetGeolocationCallbackCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_GET_GEOLOCATION_CALLBACK_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc new file mode 100644 index 00000000000..a0b83539258 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/jsdialog_handler_cpptoc.cc @@ -0,0 +1,151 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK jsdialog_handler_on_jsdialog( + struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, + const cef_string_t* origin_url, const cef_string_t* accept_lang, + cef_jsdialog_type_t dialog_type, const cef_string_t* message_text, + const cef_string_t* default_prompt_text, cef_jsdialog_callback_t* callback, + int* suppress_message) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + // Verify param: suppress_message; type: bool_byref + DCHECK(suppress_message); + if (!suppress_message) + return 0; + // Unverified params: origin_url, accept_lang, message_text, + // default_prompt_text + + // Translate param: suppress_message; type: bool_byref + bool suppress_messageBool = ( + suppress_message && *suppress_message)?true:false; + + // Execute + bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnJSDialog( + CefBrowserCToCpp::Wrap(browser), + CefString(origin_url), + CefString(accept_lang), + dialog_type, + CefString(message_text), + CefString(default_prompt_text), + CefJSDialogCallbackCToCpp::Wrap(callback), + suppress_messageBool); + + // Restore param: suppress_message; type: bool_byref + if (suppress_message) + *suppress_message = suppress_messageBool?true:false; + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK jsdialog_handler_on_before_unload_dialog( + struct _cef_jsdialog_handler_t* self, cef_browser_t* browser, + const cef_string_t* message_text, int is_reload, + cef_jsdialog_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + // Unverified params: message_text + + // Execute + bool _retval = CefJSDialogHandlerCppToC::Get(self)->OnBeforeUnloadDialog( + CefBrowserCToCpp::Wrap(browser), + CefString(message_text), + is_reload?true:false, + CefJSDialogCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK jsdialog_handler_on_reset_dialog_state( + struct _cef_jsdialog_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefJSDialogHandlerCppToC::Get(self)->OnResetDialogState( + CefBrowserCToCpp::Wrap(browser)); +} + +void CEF_CALLBACK jsdialog_handler_on_dialog_closed( + struct _cef_jsdialog_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefJSDialogHandlerCppToC::Get(self)->OnDialogClosed( + CefBrowserCToCpp::Wrap(browser)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefJSDialogHandlerCppToC::CefJSDialogHandlerCppToC(CefJSDialogHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_jsdialog = jsdialog_handler_on_jsdialog; + struct_.struct_.on_before_unload_dialog = + jsdialog_handler_on_before_unload_dialog; + struct_.struct_.on_reset_dialog_state = + jsdialog_handler_on_reset_dialog_state; + struct_.struct_.on_dialog_closed = jsdialog_handler_on_dialog_closed; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h new file mode 100644 index 00000000000..0097c80d3c7 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/jsdialog_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_jsdialog_handler.h" +#include "include/capi/cef_jsdialog_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefJSDialogHandlerCppToC + : public CefCppToC { + public: + explicit CefJSDialogHandlerCppToC(CefJSDialogHandler* cls); + virtual ~CefJSDialogHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_JSDIALOG_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc new file mode 100644 index 00000000000..a8822f10cf2 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/keyboard_handler_cpptoc.cc @@ -0,0 +1,110 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK keyboard_handler_on_pre_key_event( + struct _cef_keyboard_handler_t* self, cef_browser_t* browser, + const struct _cef_key_event_t* event, cef_event_handle_t os_event, + int* is_keyboard_shortcut) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: event; type: struct_byref_const + DCHECK(event); + if (!event) + return 0; + // Verify param: is_keyboard_shortcut; type: bool_byaddr + DCHECK(is_keyboard_shortcut); + if (!is_keyboard_shortcut) + return 0; + + // Translate param: event; type: struct_byref_const + CefKeyEvent eventObj; + if (event) + eventObj.Set(*event, false); + // Translate param: is_keyboard_shortcut; type: bool_byaddr + bool is_keyboard_shortcutBool = ( + is_keyboard_shortcut && *is_keyboard_shortcut)?true:false; + + // Execute + bool _retval = CefKeyboardHandlerCppToC::Get(self)->OnPreKeyEvent( + CefBrowserCToCpp::Wrap(browser), + eventObj, + os_event, + &is_keyboard_shortcutBool); + + // Restore param: is_keyboard_shortcut; type: bool_byaddr + if (is_keyboard_shortcut) + *is_keyboard_shortcut = is_keyboard_shortcutBool?true:false; + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK keyboard_handler_on_key_event( + struct _cef_keyboard_handler_t* self, cef_browser_t* browser, + const struct _cef_key_event_t* event, cef_event_handle_t os_event) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: event; type: struct_byref_const + DCHECK(event); + if (!event) + return 0; + + // Translate param: event; type: struct_byref_const + CefKeyEvent eventObj; + if (event) + eventObj.Set(*event, false); + + // Execute + bool _retval = CefKeyboardHandlerCppToC::Get(self)->OnKeyEvent( + CefBrowserCToCpp::Wrap(browser), + eventObj, + os_event); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefKeyboardHandlerCppToC::CefKeyboardHandlerCppToC(CefKeyboardHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_pre_key_event = keyboard_handler_on_pre_key_event; + struct_.struct_.on_key_event = keyboard_handler_on_key_event; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/keyboard_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/keyboard_handler_cpptoc.h new file mode 100644 index 00000000000..bb861b6c779 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/keyboard_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_keyboard_handler.h" +#include "include/capi/cef_keyboard_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefKeyboardHandlerCppToC + : public CefCppToC { + public: + explicit CefKeyboardHandlerCppToC(CefKeyboardHandler* cls); + virtual ~CefKeyboardHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_KEYBOARD_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/life_span_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/life_span_handler_cpptoc.cc new file mode 100644 index 00000000000..d7ee3e68c3f --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/life_span_handler_cpptoc.cc @@ -0,0 +1,211 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/client_cpptoc.h" +#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK life_span_handler_on_before_popup( + struct _cef_life_span_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, const cef_string_t* target_url, + const cef_string_t* target_frame_name, + const struct _cef_popup_features_t* popupFeatures, + cef_window_info_t* windowInfo, cef_client_t** client, + struct _cef_browser_settings_t* settings, int* no_javascript_access) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return 0; + // Verify param: popupFeatures; type: struct_byref_const + DCHECK(popupFeatures); + if (!popupFeatures) + return 0; + // Verify param: windowInfo; type: struct_byref + DCHECK(windowInfo); + if (!windowInfo) + return 0; + // Verify param: client; type: refptr_same_byref + DCHECK(client); + if (!client) + return 0; + // Verify param: settings; type: struct_byref + DCHECK(settings); + if (!settings) + return 0; + // Verify param: no_javascript_access; type: bool_byaddr + DCHECK(no_javascript_access); + if (!no_javascript_access) + return 0; + // Unverified params: target_url, target_frame_name + + // Translate param: popupFeatures; type: struct_byref_const + CefPopupFeatures popupFeaturesObj; + if (popupFeatures) + popupFeaturesObj.Set(*popupFeatures, false); + // Translate param: windowInfo; type: struct_byref + CefWindowInfo windowInfoObj; + if (windowInfo) + windowInfoObj.AttachTo(*windowInfo); + // Translate param: client; type: refptr_same_byref + CefRefPtr clientPtr; + if (client && *client) + clientPtr = CefClientCppToC::Unwrap(*client); + CefClient* clientOrig = clientPtr.get(); + // Translate param: settings; type: struct_byref + CefBrowserSettings settingsObj; + if (settings) + settingsObj.AttachTo(*settings); + // Translate param: no_javascript_access; type: bool_byaddr + bool no_javascript_accessBool = ( + no_javascript_access && *no_javascript_access)?true:false; + + // Execute + bool _retval = CefLifeSpanHandlerCppToC::Get(self)->OnBeforePopup( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefString(target_url), + CefString(target_frame_name), + popupFeaturesObj, + windowInfoObj, + clientPtr, + settingsObj, + &no_javascript_accessBool); + + // Restore param: windowInfo; type: struct_byref + if (windowInfo) + windowInfoObj.DetachTo(*windowInfo); + // Restore param: client; type: refptr_same_byref + if (client) { + if (clientPtr.get()) { + if (clientPtr.get() != clientOrig) { + *client = CefClientCppToC::Wrap(clientPtr); + } + } else { + *client = NULL; + } + } + // Restore param: settings; type: struct_byref + if (settings) + settingsObj.DetachTo(*settings); + // Restore param: no_javascript_access; type: bool_byaddr + if (no_javascript_access) + *no_javascript_access = no_javascript_accessBool?true:false; + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK life_span_handler_on_after_created( + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefLifeSpanHandlerCppToC::Get(self)->OnAfterCreated( + CefBrowserCToCpp::Wrap(browser)); +} + +int CEF_CALLBACK life_span_handler_run_modal( + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + + // Execute + bool _retval = CefLifeSpanHandlerCppToC::Get(self)->RunModal( + CefBrowserCToCpp::Wrap(browser)); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK life_span_handler_do_close( + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + + // Execute + bool _retval = CefLifeSpanHandlerCppToC::Get(self)->DoClose( + CefBrowserCToCpp::Wrap(browser)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK life_span_handler_on_before_close( + struct _cef_life_span_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefLifeSpanHandlerCppToC::Get(self)->OnBeforeClose( + CefBrowserCToCpp::Wrap(browser)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefLifeSpanHandlerCppToC::CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_before_popup = life_span_handler_on_before_popup; + struct_.struct_.on_after_created = life_span_handler_on_after_created; + struct_.struct_.run_modal = life_span_handler_run_modal; + struct_.struct_.do_close = life_span_handler_do_close; + struct_.struct_.on_before_close = life_span_handler_on_before_close; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/life_span_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/life_span_handler_cpptoc.h new file mode 100644 index 00000000000..01021dca681 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/life_span_handler_cpptoc.h @@ -0,0 +1,39 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_life_span_handler.h" +#include "include/capi/cef_life_span_handler_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefLifeSpanHandlerCppToC + : public CefCppToC { + public: + explicit CefLifeSpanHandlerCppToC(CefLifeSpanHandler* cls); + virtual ~CefLifeSpanHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_LIFE_SPAN_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/load_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/load_handler_cpptoc.cc new file mode 100644 index 00000000000..e3829f23fdd --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/load_handler_cpptoc.cc @@ -0,0 +1,133 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/load_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK load_handler_on_loading_state_change( + struct _cef_load_handler_t* self, cef_browser_t* browser, int isLoading, + int canGoBack, int canGoForward) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefLoadHandlerCppToC::Get(self)->OnLoadingStateChange( + CefBrowserCToCpp::Wrap(browser), + isLoading?true:false, + canGoBack?true:false, + canGoForward?true:false); +} + +void CEF_CALLBACK load_handler_on_load_start(struct _cef_load_handler_t* self, + cef_browser_t* browser, cef_frame_t* frame) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + + // Execute + CefLoadHandlerCppToC::Get(self)->OnLoadStart( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame)); +} + +void CEF_CALLBACK load_handler_on_load_end(struct _cef_load_handler_t* self, + cef_browser_t* browser, cef_frame_t* frame, int httpStatusCode) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + + // Execute + CefLoadHandlerCppToC::Get(self)->OnLoadEnd( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + httpStatusCode); +} + +void CEF_CALLBACK load_handler_on_load_error(struct _cef_load_handler_t* self, + cef_browser_t* browser, cef_frame_t* frame, cef_errorcode_t errorCode, + const cef_string_t* errorText, const cef_string_t* failedUrl) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + // Verify param: failedUrl; type: string_byref_const + DCHECK(failedUrl); + if (!failedUrl) + return; + // Unverified params: errorText + + // Execute + CefLoadHandlerCppToC::Get(self)->OnLoadError( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + errorCode, + CefString(errorText), + CefString(failedUrl)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefLoadHandlerCppToC::CefLoadHandlerCppToC(CefLoadHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_loading_state_change = + load_handler_on_loading_state_change; + struct_.struct_.on_load_start = load_handler_on_load_start; + struct_.struct_.on_load_end = load_handler_on_load_end; + struct_.struct_.on_load_error = load_handler_on_load_error; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/load_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/load_handler_cpptoc.h new file mode 100644 index 00000000000..b17f33e840d --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/load_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_load_handler.h" +#include "include/capi/cef_load_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefLoadHandlerCppToC + : public CefCppToC { + public: + explicit CefLoadHandlerCppToC(CefLoadHandler* cls); + virtual ~CefLoadHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_LOAD_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc new file mode 100644 index 00000000000..c09416bc057 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.cc @@ -0,0 +1,59 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h" +#include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK navigation_entry_visitor_visit( + struct _cef_navigation_entry_visitor_t* self, + struct _cef_navigation_entry_t* entry, int current, int index, + int total) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: entry; type: refptr_diff + DCHECK(entry); + if (!entry) + return 0; + + // Execute + bool _retval = CefNavigationEntryVisitorCppToC::Get(self)->Visit( + CefNavigationEntryCToCpp::Wrap(entry), + current?true:false, + index, + total); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefNavigationEntryVisitorCppToC::CefNavigationEntryVisitorCppToC( + CefNavigationEntryVisitor* cls) + : CefCppToC(cls) { + struct_.struct_.visit = navigation_entry_visitor_visit; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = + 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h new file mode 100644 index 00000000000..aadd6bb57a1 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h @@ -0,0 +1,39 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefNavigationEntryVisitorCppToC + : public CefCppToC { + public: + explicit CefNavigationEntryVisitorCppToC(CefNavigationEntryVisitor* cls); + virtual ~CefNavigationEntryVisitorCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_NAVIGATION_ENTRY_VISITOR_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/print_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/print_handler_cpptoc.cc new file mode 100644 index 00000000000..193759e6b00 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/print_handler_cpptoc.cc @@ -0,0 +1,121 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/print_handler_cpptoc.h" +#include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h" +#include "libcef_dll/ctocpp/print_job_callback_ctocpp.h" +#include "libcef_dll/ctocpp/print_settings_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK print_handler_on_print_settings( + struct _cef_print_handler_t* self, struct _cef_print_settings_t* settings, + int get_defaults) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: settings; type: refptr_diff + DCHECK(settings); + if (!settings) + return; + + // Execute + CefPrintHandlerCppToC::Get(self)->OnPrintSettings( + CefPrintSettingsCToCpp::Wrap(settings), + get_defaults?true:false); +} + +int CEF_CALLBACK print_handler_on_print_dialog( + struct _cef_print_handler_t* self, int has_selection, + cef_print_dialog_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + + // Execute + bool _retval = CefPrintHandlerCppToC::Get(self)->OnPrintDialog( + has_selection?true:false, + CefPrintDialogCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK print_handler_on_print_job(struct _cef_print_handler_t* self, + const cef_string_t* document_name, const cef_string_t* pdf_file_path, + cef_print_job_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: document_name; type: string_byref_const + DCHECK(document_name); + if (!document_name) + return 0; + // Verify param: pdf_file_path; type: string_byref_const + DCHECK(pdf_file_path); + if (!pdf_file_path) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + + // Execute + bool _retval = CefPrintHandlerCppToC::Get(self)->OnPrintJob( + CefString(document_name), + CefString(pdf_file_path), + CefPrintJobCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK print_handler_on_print_reset( + struct _cef_print_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + + // Execute + CefPrintHandlerCppToC::Get(self)->OnPrintReset(); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls) + : CefCppToC( + cls) { + struct_.struct_.on_print_settings = print_handler_on_print_settings; + struct_.struct_.on_print_dialog = print_handler_on_print_dialog; + struct_.struct_.on_print_job = print_handler_on_print_job; + struct_.struct_.on_print_reset = print_handler_on_print_reset; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/print_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/print_handler_cpptoc.h new file mode 100644 index 00000000000..775d1166abe --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/print_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_print_handler.h" +#include "include/capi/cef_print_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefPrintHandlerCppToC + : public CefCppToC { + public: + explicit CefPrintHandlerCppToC(CefPrintHandler* cls); + virtual ~CefPrintHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_PRINT_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/read_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/read_handler_cpptoc.cc new file mode 100644 index 00000000000..f6279ae0ad9 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/read_handler_cpptoc.cc @@ -0,0 +1,115 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/read_handler_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +size_t CEF_CALLBACK read_handler_read(struct _cef_read_handler_t* self, + void* ptr, size_t size, size_t n) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = CefReadHandlerCppToC::Get(self)->Read( + ptr, + size, + n); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK read_handler_seek(struct _cef_read_handler_t* self, + int64 offset, int whence) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + int _retval = CefReadHandlerCppToC::Get(self)->Seek( + offset, + whence); + + // Return type: simple + return _retval; +} + +int64 CEF_CALLBACK read_handler_tell(struct _cef_read_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + int64 _retval = CefReadHandlerCppToC::Get(self)->Tell(); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK read_handler_eof(struct _cef_read_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + int _retval = CefReadHandlerCppToC::Get(self)->Eof(); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK read_handler_may_block(struct _cef_read_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefReadHandlerCppToC::Get(self)->MayBlock(); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefReadHandlerCppToC::CefReadHandlerCppToC(CefReadHandler* cls) + : CefCppToC(cls) { + struct_.struct_.read = read_handler_read; + struct_.struct_.seek = read_handler_seek; + struct_.struct_.tell = read_handler_tell; + struct_.struct_.eof = read_handler_eof; + struct_.struct_.may_block = read_handler_may_block; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/read_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/read_handler_cpptoc.h new file mode 100644 index 00000000000..eabe8578253 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/read_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefReadHandlerCppToC + : public CefCppToC { + public: + explicit CefReadHandlerCppToC(CefReadHandler* cls); + virtual ~CefReadHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_READ_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/render_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/render_handler_cpptoc.cc new file mode 100644 index 00000000000..e7e99be2fc9 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/render_handler_cpptoc.cc @@ -0,0 +1,371 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/render_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/drag_data_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK render_handler_get_root_screen_rect( + struct _cef_render_handler_t* self, cef_browser_t* browser, + cef_rect_t* rect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: rect; type: simple_byref + DCHECK(rect); + if (!rect) + return 0; + + // Translate param: rect; type: simple_byref + CefRect rectVal = rect?*rect:CefRect(); + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->GetRootScreenRect( + CefBrowserCToCpp::Wrap(browser), + rectVal); + + // Restore param: rect; type: simple_byref + if (rect) + *rect = rectVal; + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK render_handler_get_view_rect( + struct _cef_render_handler_t* self, cef_browser_t* browser, + cef_rect_t* rect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: rect; type: simple_byref + DCHECK(rect); + if (!rect) + return 0; + + // Translate param: rect; type: simple_byref + CefRect rectVal = rect?*rect:CefRect(); + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->GetViewRect( + CefBrowserCToCpp::Wrap(browser), + rectVal); + + // Restore param: rect; type: simple_byref + if (rect) + *rect = rectVal; + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK render_handler_get_screen_point( + struct _cef_render_handler_t* self, cef_browser_t* browser, int viewX, + int viewY, int* screenX, int* screenY) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: screenX; type: simple_byref + DCHECK(screenX); + if (!screenX) + return 0; + // Verify param: screenY; type: simple_byref + DCHECK(screenY); + if (!screenY) + return 0; + + // Translate param: screenX; type: simple_byref + int screenXVal = screenX?*screenX:0; + // Translate param: screenY; type: simple_byref + int screenYVal = screenY?*screenY:0; + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenPoint( + CefBrowserCToCpp::Wrap(browser), + viewX, + viewY, + screenXVal, + screenYVal); + + // Restore param: screenX; type: simple_byref + if (screenX) + *screenX = screenXVal; + // Restore param: screenY; type: simple_byref + if (screenY) + *screenY = screenYVal; + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK render_handler_get_screen_info( + struct _cef_render_handler_t* self, cef_browser_t* browser, + struct _cef_screen_info_t* screen_info) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: screen_info; type: struct_byref + DCHECK(screen_info); + if (!screen_info) + return 0; + + // Translate param: screen_info; type: struct_byref + CefScreenInfo screen_infoObj; + if (screen_info) + screen_infoObj.AttachTo(*screen_info); + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->GetScreenInfo( + CefBrowserCToCpp::Wrap(browser), + screen_infoObj); + + // Restore param: screen_info; type: struct_byref + if (screen_info) + screen_infoObj.DetachTo(*screen_info); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK render_handler_on_popup_show( + struct _cef_render_handler_t* self, cef_browser_t* browser, int show) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefRenderHandlerCppToC::Get(self)->OnPopupShow( + CefBrowserCToCpp::Wrap(browser), + show?true:false); +} + +void CEF_CALLBACK render_handler_on_popup_size( + struct _cef_render_handler_t* self, cef_browser_t* browser, + const cef_rect_t* rect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: rect; type: simple_byref_const + DCHECK(rect); + if (!rect) + return; + + // Translate param: rect; type: simple_byref_const + CefRect rectVal = rect?*rect:CefRect(); + + // Execute + CefRenderHandlerCppToC::Get(self)->OnPopupSize( + CefBrowserCToCpp::Wrap(browser), + rectVal); +} + +void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self, + cef_browser_t* browser, cef_paint_element_type_t type, + size_t dirtyRectsCount, cef_rect_t const* dirtyRects, const void* buffer, + int width, int height) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: dirtyRects; type: simple_vec_byref_const + DCHECK(dirtyRectsCount == 0 || dirtyRects); + if (dirtyRectsCount > 0 && !dirtyRects) + return; + // Verify param: buffer; type: simple_byaddr + DCHECK(buffer); + if (!buffer) + return; + + // Translate param: dirtyRects; type: simple_vec_byref_const + std::vector dirtyRectsList; + if (dirtyRectsCount > 0) { + for (size_t i = 0; i < dirtyRectsCount; ++i) { + dirtyRectsList.push_back(dirtyRects[i]); + } + } + + // Execute + CefRenderHandlerCppToC::Get(self)->OnPaint( + CefBrowserCToCpp::Wrap(browser), + type, + dirtyRectsList, + buffer, + width, + height); +} + +void CEF_CALLBACK render_handler_on_cursor_change( + struct _cef_render_handler_t* self, cef_browser_t* browser, + cef_cursor_handle_t cursor, cef_cursor_type_t type, + const struct _cef_cursor_info_t* custom_cursor_info) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: custom_cursor_info; type: struct_byref_const + DCHECK(custom_cursor_info); + if (!custom_cursor_info) + return; + + // Translate param: custom_cursor_info; type: struct_byref_const + CefCursorInfo custom_cursor_infoObj; + if (custom_cursor_info) + custom_cursor_infoObj.Set(*custom_cursor_info, false); + + // Execute + CefRenderHandlerCppToC::Get(self)->OnCursorChange( + CefBrowserCToCpp::Wrap(browser), + cursor, + type, + custom_cursor_infoObj); +} + +int CEF_CALLBACK render_handler_start_dragging( + struct _cef_render_handler_t* self, cef_browser_t* browser, + cef_drag_data_t* drag_data, cef_drag_operations_mask_t allowed_ops, int x, + int y) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: drag_data; type: refptr_diff + DCHECK(drag_data); + if (!drag_data) + return 0; + + // Execute + bool _retval = CefRenderHandlerCppToC::Get(self)->StartDragging( + CefBrowserCToCpp::Wrap(browser), + CefDragDataCToCpp::Wrap(drag_data), + allowed_ops, + x, + y); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK render_handler_update_drag_cursor( + struct _cef_render_handler_t* self, cef_browser_t* browser, + cef_drag_operations_mask_t operation) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefRenderHandlerCppToC::Get(self)->UpdateDragCursor( + CefBrowserCToCpp::Wrap(browser), + operation); +} + +void CEF_CALLBACK render_handler_on_scroll_offset_changed( + struct _cef_render_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefRenderHandlerCppToC::Get(self)->OnScrollOffsetChanged( + CefBrowserCToCpp::Wrap(browser)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefRenderHandlerCppToC::CefRenderHandlerCppToC(CefRenderHandler* cls) + : CefCppToC( + cls) { + struct_.struct_.get_root_screen_rect = render_handler_get_root_screen_rect; + struct_.struct_.get_view_rect = render_handler_get_view_rect; + struct_.struct_.get_screen_point = render_handler_get_screen_point; + struct_.struct_.get_screen_info = render_handler_get_screen_info; + struct_.struct_.on_popup_show = render_handler_on_popup_show; + struct_.struct_.on_popup_size = render_handler_on_popup_size; + struct_.struct_.on_paint = render_handler_on_paint; + struct_.struct_.on_cursor_change = render_handler_on_cursor_change; + struct_.struct_.start_dragging = render_handler_start_dragging; + struct_.struct_.update_drag_cursor = render_handler_update_drag_cursor; + struct_.struct_.on_scroll_offset_changed = + render_handler_on_scroll_offset_changed; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/render_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/render_handler_cpptoc.h new file mode 100644 index 00000000000..3c0498af782 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/render_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_render_handler.h" +#include "include/capi/cef_render_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefRenderHandlerCppToC + : public CefCppToC { + public: + explicit CefRenderHandlerCppToC(CefRenderHandler* cls); + virtual ~CefRenderHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_RENDER_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/render_process_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/render_process_handler_cpptoc.cc new file mode 100644 index 00000000000..78a8bd9bbeb --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/render_process_handler_cpptoc.cc @@ -0,0 +1,321 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/load_handler_cpptoc.h" +#include "libcef_dll/cpptoc/render_process_handler_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/domnode_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/list_value_ctocpp.h" +#include "libcef_dll/ctocpp/process_message_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" +#include "libcef_dll/ctocpp/v8context_ctocpp.h" +#include "libcef_dll/ctocpp/v8exception_ctocpp.h" +#include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK render_process_handler_on_render_thread_created( + struct _cef_render_process_handler_t* self, + struct _cef_list_value_t* extra_info) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: extra_info; type: refptr_diff + DCHECK(extra_info); + if (!extra_info) + return; + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnRenderThreadCreated( + CefListValueCToCpp::Wrap(extra_info)); +} + +void CEF_CALLBACK render_process_handler_on_web_kit_initialized( + struct _cef_render_process_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnWebKitInitialized(); +} + +void CEF_CALLBACK render_process_handler_on_browser_created( + struct _cef_render_process_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnBrowserCreated( + CefBrowserCToCpp::Wrap(browser)); +} + +void CEF_CALLBACK render_process_handler_on_browser_destroyed( + struct _cef_render_process_handler_t* self, cef_browser_t* browser) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnBrowserDestroyed( + CefBrowserCToCpp::Wrap(browser)); +} + +cef_load_handler_t* CEF_CALLBACK render_process_handler_get_load_handler( + struct _cef_render_process_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefRenderProcessHandlerCppToC::Get( + self)->GetLoadHandler(); + + // Return type: refptr_same + return CefLoadHandlerCppToC::Wrap(_retval); +} + +int CEF_CALLBACK render_process_handler_on_before_navigation( + struct _cef_render_process_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, struct _cef_request_t* request, + cef_navigation_type_t navigation_type, int is_redirect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return 0; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return 0; + + // Execute + bool _retval = CefRenderProcessHandlerCppToC::Get(self)->OnBeforeNavigation( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), + navigation_type, + is_redirect?true:false); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK render_process_handler_on_context_created( + struct _cef_render_process_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, struct _cef_v8context_t* context) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + // Verify param: context; type: refptr_diff + DCHECK(context); + if (!context) + return; + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnContextCreated( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefV8ContextCToCpp::Wrap(context)); +} + +void CEF_CALLBACK render_process_handler_on_context_released( + struct _cef_render_process_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, struct _cef_v8context_t* context) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + // Verify param: context; type: refptr_diff + DCHECK(context); + if (!context) + return; + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnContextReleased( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefV8ContextCToCpp::Wrap(context)); +} + +void CEF_CALLBACK render_process_handler_on_uncaught_exception( + struct _cef_render_process_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, struct _cef_v8context_t* context, + struct _cef_v8exception_t* exception, + struct _cef_v8stack_trace_t* stackTrace) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + // Verify param: context; type: refptr_diff + DCHECK(context); + if (!context) + return; + // Verify param: exception; type: refptr_diff + DCHECK(exception); + if (!exception) + return; + // Verify param: stackTrace; type: refptr_diff + DCHECK(stackTrace); + if (!stackTrace) + return; + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnUncaughtException( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefV8ContextCToCpp::Wrap(context), + CefV8ExceptionCToCpp::Wrap(exception), + CefV8StackTraceCToCpp::Wrap(stackTrace)); +} + +void CEF_CALLBACK render_process_handler_on_focused_node_changed( + struct _cef_render_process_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, cef_domnode_t* node) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Unverified params: frame, node + + // Execute + CefRenderProcessHandlerCppToC::Get(self)->OnFocusedNodeChanged( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefDOMNodeCToCpp::Wrap(node)); +} + +int CEF_CALLBACK render_process_handler_on_process_message_received( + struct _cef_render_process_handler_t* self, cef_browser_t* browser, + cef_process_id_t source_process, cef_process_message_t* message) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: message; type: refptr_diff + DCHECK(message); + if (!message) + return 0; + + // Execute + bool _retval = CefRenderProcessHandlerCppToC::Get( + self)->OnProcessMessageReceived( + CefBrowserCToCpp::Wrap(browser), + source_process, + CefProcessMessageCToCpp::Wrap(message)); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefRenderProcessHandlerCppToC::CefRenderProcessHandlerCppToC( + CefRenderProcessHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_render_thread_created = + render_process_handler_on_render_thread_created; + struct_.struct_.on_web_kit_initialized = + render_process_handler_on_web_kit_initialized; + struct_.struct_.on_browser_created = + render_process_handler_on_browser_created; + struct_.struct_.on_browser_destroyed = + render_process_handler_on_browser_destroyed; + struct_.struct_.get_load_handler = render_process_handler_get_load_handler; + struct_.struct_.on_before_navigation = + render_process_handler_on_before_navigation; + struct_.struct_.on_context_created = + render_process_handler_on_context_created; + struct_.struct_.on_context_released = + render_process_handler_on_context_released; + struct_.struct_.on_uncaught_exception = + render_process_handler_on_uncaught_exception; + struct_.struct_.on_focused_node_changed = + render_process_handler_on_focused_node_changed; + struct_.struct_.on_process_message_received = + render_process_handler_on_process_message_received; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/render_process_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/render_process_handler_cpptoc.h new file mode 100644 index 00000000000..e21e547151d --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/render_process_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_render_process_handler.h" +#include "include/capi/cef_render_process_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefRenderProcessHandlerCppToC + : public CefCppToC { + public: + explicit CefRenderProcessHandlerCppToC(CefRenderProcessHandler* cls); + virtual ~CefRenderProcessHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_RENDER_PROCESS_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/request_context_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/request_context_handler_cpptoc.cc new file mode 100644 index 00000000000..eea6533513e --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/request_context_handler_cpptoc.cc @@ -0,0 +1,50 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/request_context_handler_cpptoc.h" +#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +cef_cookie_manager_t* CEF_CALLBACK request_context_handler_get_cookie_manager( + struct _cef_request_context_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + + // Execute + CefRefPtr _retval = CefRequestContextHandlerCppToC::Get( + self)->GetCookieManager(); + + // Return type: refptr_diff + return CefCookieManagerCToCpp::Unwrap(_retval); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefRequestContextHandlerCppToC::CefRequestContextHandlerCppToC( + CefRequestContextHandler* cls) + : CefCppToC(cls) { + struct_.struct_.get_cookie_manager = + request_context_handler_get_cookie_manager; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/request_context_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/request_context_handler_cpptoc.h new file mode 100644 index 00000000000..60d27f74288 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/request_context_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request_context_handler.h" +#include "include/capi/cef_request_context_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefRequestContextHandlerCppToC + : public CefCppToC { + public: + explicit CefRequestContextHandlerCppToC(CefRequestContextHandler* cls); + virtual ~CefRequestContextHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_CONTEXT_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/request_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/request_handler_cpptoc.cc new file mode 100644 index 00000000000..779f28ec0d2 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/request_handler_cpptoc.cc @@ -0,0 +1,398 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/request_handler_cpptoc.h" +#include "libcef_dll/cpptoc/resource_handler_cpptoc.h" +#include "libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h" +#include "libcef_dll/ctocpp/auth_callback_ctocpp.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/quota_callback_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" +#include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK request_handler_on_before_browse( + struct _cef_request_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, cef_request_t* request, int is_redirect) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return 0; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return 0; + + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeBrowse( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request), + is_redirect?true:false); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK request_handler_on_before_resource_load( + struct _cef_request_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, cef_request_t* request) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return 0; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return 0; + + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforeResourceLoad( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request)); + + // Return type: bool + return _retval; +} + +struct _cef_resource_handler_t* CEF_CALLBACK request_handler_get_resource_handler( + struct _cef_request_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, cef_request_t* request) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return NULL; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return NULL; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return NULL; + + // Execute + CefRefPtr _retval = CefRequestHandlerCppToC::Get( + self)->GetResourceHandler( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefRequestCToCpp::Wrap(request)); + + // Return type: refptr_same + return CefResourceHandlerCppToC::Wrap(_retval); +} + +void CEF_CALLBACK request_handler_on_resource_redirect( + struct _cef_request_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, const cef_string_t* old_url, cef_string_t* new_url) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return; + // Verify param: old_url; type: string_byref_const + DCHECK(old_url); + if (!old_url) + return; + // Verify param: new_url; type: string_byref + DCHECK(new_url); + if (!new_url) + return; + + // Translate param: new_url; type: string_byref + CefString new_urlStr(new_url); + + // Execute + CefRequestHandlerCppToC::Get(self)->OnResourceRedirect( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefString(old_url), + new_urlStr); +} + +int CEF_CALLBACK request_handler_get_auth_credentials( + struct _cef_request_handler_t* self, cef_browser_t* browser, + cef_frame_t* frame, int isProxy, const cef_string_t* host, int port, + const cef_string_t* realm, const cef_string_t* scheme, + cef_auth_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: frame; type: refptr_diff + DCHECK(frame); + if (!frame) + return 0; + // Verify param: host; type: string_byref_const + DCHECK(host); + if (!host) + return 0; + // Verify param: scheme; type: string_byref_const + DCHECK(scheme); + if (!scheme) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + // Unverified params: realm + + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->GetAuthCredentials( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + isProxy?true:false, + CefString(host), + port, + CefString(realm), + CefString(scheme), + CefAuthCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK request_handler_on_quota_request( + struct _cef_request_handler_t* self, cef_browser_t* browser, + const cef_string_t* origin_url, int64 new_size, + cef_quota_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: origin_url; type: string_byref_const + DCHECK(origin_url); + if (!origin_url) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnQuotaRequest( + CefBrowserCToCpp::Wrap(browser), + CefString(origin_url), + new_size, + CefQuotaCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK request_handler_on_protocol_execution( + struct _cef_request_handler_t* self, cef_browser_t* browser, + const cef_string_t* url, int* allow_os_execution) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: url; type: string_byref_const + DCHECK(url); + if (!url) + return; + // Verify param: allow_os_execution; type: bool_byref + DCHECK(allow_os_execution); + if (!allow_os_execution) + return; + + // Translate param: allow_os_execution; type: bool_byref + bool allow_os_executionBool = ( + allow_os_execution && *allow_os_execution)?true:false; + + // Execute + CefRequestHandlerCppToC::Get(self)->OnProtocolExecution( + CefBrowserCToCpp::Wrap(browser), + CefString(url), + allow_os_executionBool); + + // Restore param: allow_os_execution; type: bool_byref + if (allow_os_execution) + *allow_os_execution = allow_os_executionBool?true:false; +} + +int CEF_CALLBACK request_handler_on_certificate_error( + struct _cef_request_handler_t* self, cef_errorcode_t cert_error, + const cef_string_t* request_url, + cef_allow_certificate_error_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: request_url; type: string_byref_const + DCHECK(request_url); + if (!request_url) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnCertificateError( + cert_error, + CefString(request_url), + CefAllowCertificateErrorCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK request_handler_on_before_plugin_load( + struct _cef_request_handler_t* self, cef_browser_t* browser, + const cef_string_t* url, const cef_string_t* policy_url, + struct _cef_web_plugin_info_t* info) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return 0; + // Verify param: info; type: refptr_diff + DCHECK(info); + if (!info) + return 0; + // Unverified params: url, policy_url + + // Execute + bool _retval = CefRequestHandlerCppToC::Get(self)->OnBeforePluginLoad( + CefBrowserCToCpp::Wrap(browser), + CefString(url), + CefString(policy_url), + CefWebPluginInfoCToCpp::Wrap(info)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK request_handler_on_plugin_crashed( + struct _cef_request_handler_t* self, cef_browser_t* browser, + const cef_string_t* plugin_path) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + // Verify param: plugin_path; type: string_byref_const + DCHECK(plugin_path); + if (!plugin_path) + return; + + // Execute + CefRequestHandlerCppToC::Get(self)->OnPluginCrashed( + CefBrowserCToCpp::Wrap(browser), + CefString(plugin_path)); +} + +void CEF_CALLBACK request_handler_on_render_process_terminated( + struct _cef_request_handler_t* self, cef_browser_t* browser, + cef_termination_status_t status) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser; type: refptr_diff + DCHECK(browser); + if (!browser) + return; + + // Execute + CefRequestHandlerCppToC::Get(self)->OnRenderProcessTerminated( + CefBrowserCToCpp::Wrap(browser), + status); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefRequestHandlerCppToC::CefRequestHandlerCppToC(CefRequestHandler* cls) + : CefCppToC(cls) { + struct_.struct_.on_before_browse = request_handler_on_before_browse; + struct_.struct_.on_before_resource_load = + request_handler_on_before_resource_load; + struct_.struct_.get_resource_handler = request_handler_get_resource_handler; + struct_.struct_.on_resource_redirect = request_handler_on_resource_redirect; + struct_.struct_.get_auth_credentials = request_handler_get_auth_credentials; + struct_.struct_.on_quota_request = request_handler_on_quota_request; + struct_.struct_.on_protocol_execution = request_handler_on_protocol_execution; + struct_.struct_.on_certificate_error = request_handler_on_certificate_error; + struct_.struct_.on_before_plugin_load = request_handler_on_before_plugin_load; + struct_.struct_.on_plugin_crashed = request_handler_on_plugin_crashed; + struct_.struct_.on_render_process_terminated = + request_handler_on_render_process_terminated; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/request_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/request_handler_cpptoc.h new file mode 100644 index 00000000000..75a7b6d01cc --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/request_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request_handler.h" +#include "include/capi/cef_request_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefRequestHandlerCppToC + : public CefCppToC { + public: + explicit CefRequestHandlerCppToC(CefRequestHandler* cls); + virtual ~CefRequestHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_REQUEST_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc new file mode 100644 index 00000000000..cbce1fbbe0f --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.cc @@ -0,0 +1,98 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK resource_bundle_handler_get_localized_string( + struct _cef_resource_bundle_handler_t* self, int message_id, + cef_string_t* string) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: string; type: string_byref + DCHECK(string); + if (!string) + return 0; + + // Translate param: string; type: string_byref + CefString stringStr(string); + + // Execute + bool _retval = CefResourceBundleHandlerCppToC::Get(self)->GetLocalizedString( + message_id, + stringStr); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK resource_bundle_handler_get_data_resource( + struct _cef_resource_bundle_handler_t* self, int resource_id, void** data, + size_t* data_size) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: data; type: simple_byref + DCHECK(data); + if (!data) + return 0; + // Verify param: data_size; type: simple_byref + DCHECK(data_size); + if (!data_size) + return 0; + + // Translate param: data; type: simple_byref + void* dataVal = data?*data:NULL; + // Translate param: data_size; type: simple_byref + size_t data_sizeVal = data_size?*data_size:0; + + // Execute + bool _retval = CefResourceBundleHandlerCppToC::Get(self)->GetDataResource( + resource_id, + dataVal, + data_sizeVal); + + // Restore param: data; type: simple_byref + if (data) + *data = dataVal; + // Restore param: data_size; type: simple_byref + if (data_size) + *data_size = data_sizeVal; + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefResourceBundleHandlerCppToC::CefResourceBundleHandlerCppToC( + CefResourceBundleHandler* cls) + : CefCppToC(cls) { + struct_.struct_.get_localized_string = + resource_bundle_handler_get_localized_string; + struct_.struct_.get_data_resource = resource_bundle_handler_get_data_resource; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h new file mode 100644 index 00000000000..7ebf47172e7 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_resource_bundle_handler.h" +#include "include/capi/cef_resource_bundle_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefResourceBundleHandlerCppToC + : public CefCppToC { + public: + explicit CefResourceBundleHandlerCppToC(CefResourceBundleHandler* cls); + virtual ~CefResourceBundleHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_RESOURCE_BUNDLE_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/resource_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/resource_handler_cpptoc.cc new file mode 100644 index 00000000000..2ce96154887 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/resource_handler_cpptoc.cc @@ -0,0 +1,203 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/resource_handler_cpptoc.h" +#include "libcef_dll/ctocpp/callback_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" +#include "libcef_dll/ctocpp/response_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK resource_handler_process_request( + struct _cef_resource_handler_t* self, cef_request_t* request, + cef_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + + // Execute + bool _retval = CefResourceHandlerCppToC::Get(self)->ProcessRequest( + CefRequestCToCpp::Wrap(request), + CefCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK resource_handler_get_response_headers( + struct _cef_resource_handler_t* self, struct _cef_response_t* response, + int64* response_length, cef_string_t* redirectUrl) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: response; type: refptr_diff + DCHECK(response); + if (!response) + return; + // Verify param: response_length; type: simple_byref + DCHECK(response_length); + if (!response_length) + return; + // Verify param: redirectUrl; type: string_byref + DCHECK(redirectUrl); + if (!redirectUrl) + return; + + // Translate param: response_length; type: simple_byref + int64 response_lengthVal = response_length?*response_length:0; + // Translate param: redirectUrl; type: string_byref + CefString redirectUrlStr(redirectUrl); + + // Execute + CefResourceHandlerCppToC::Get(self)->GetResponseHeaders( + CefResponseCToCpp::Wrap(response), + response_lengthVal, + redirectUrlStr); + + // Restore param: response_length; type: simple_byref + if (response_length) + *response_length = response_lengthVal; +} + +int CEF_CALLBACK resource_handler_read_response( + struct _cef_resource_handler_t* self, void* data_out, int bytes_to_read, + int* bytes_read, cef_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: data_out; type: simple_byaddr + DCHECK(data_out); + if (!data_out) + return 0; + // Verify param: bytes_read; type: simple_byref + DCHECK(bytes_read); + if (!bytes_read) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + + // Translate param: bytes_read; type: simple_byref + int bytes_readVal = bytes_read?*bytes_read:0; + + // Execute + bool _retval = CefResourceHandlerCppToC::Get(self)->ReadResponse( + data_out, + bytes_to_read, + bytes_readVal, + CefCallbackCToCpp::Wrap(callback)); + + // Restore param: bytes_read; type: simple_byref + if (bytes_read) + *bytes_read = bytes_readVal; + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK resource_handler_can_get_cookie( + struct _cef_resource_handler_t* self, const struct _cef_cookie_t* cookie) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: cookie; type: struct_byref_const + DCHECK(cookie); + if (!cookie) + return 0; + + // Translate param: cookie; type: struct_byref_const + CefCookie cookieObj; + if (cookie) + cookieObj.Set(*cookie, false); + + // Execute + bool _retval = CefResourceHandlerCppToC::Get(self)->CanGetCookie( + cookieObj); + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK resource_handler_can_set_cookie( + struct _cef_resource_handler_t* self, const struct _cef_cookie_t* cookie) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: cookie; type: struct_byref_const + DCHECK(cookie); + if (!cookie) + return 0; + + // Translate param: cookie; type: struct_byref_const + CefCookie cookieObj; + if (cookie) + cookieObj.Set(*cookie, false); + + // Execute + bool _retval = CefResourceHandlerCppToC::Get(self)->CanSetCookie( + cookieObj); + + // Return type: bool + return _retval; +} + +void CEF_CALLBACK resource_handler_cancel( + struct _cef_resource_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + + // Execute + CefResourceHandlerCppToC::Get(self)->Cancel(); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefResourceHandlerCppToC::CefResourceHandlerCppToC(CefResourceHandler* cls) + : CefCppToC(cls) { + struct_.struct_.process_request = resource_handler_process_request; + struct_.struct_.get_response_headers = resource_handler_get_response_headers; + struct_.struct_.read_response = resource_handler_read_response; + struct_.struct_.can_get_cookie = resource_handler_can_get_cookie; + struct_.struct_.can_set_cookie = resource_handler_can_set_cookie; + struct_.struct_.cancel = resource_handler_cancel; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/resource_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/resource_handler_cpptoc.h new file mode 100644 index 00000000000..7e59d619123 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/resource_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_resource_handler.h" +#include "include/capi/cef_resource_handler_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefResourceHandlerCppToC + : public CefCppToC { + public: + explicit CefResourceHandlerCppToC(CefResourceHandler* cls); + virtual ~CefResourceHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_RESOURCE_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc new file mode 100644 index 00000000000..ef0f35924b6 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.cc @@ -0,0 +1,61 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h" +#include "libcef_dll/ctocpp/browser_host_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK run_file_dialog_callback_cont( + struct _cef_run_file_dialog_callback_t* self, + struct _cef_browser_host_t* browser_host, cef_string_list_t file_paths) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: browser_host; type: refptr_diff + DCHECK(browser_host); + if (!browser_host) + return; + // Verify param: file_paths; type: string_vec_byref_const + DCHECK(file_paths); + if (!file_paths) + return; + + // Translate param: file_paths; type: string_vec_byref_const + std::vector file_pathsList; + transfer_string_list_contents(file_paths, file_pathsList); + + // Execute + CefRunFileDialogCallbackCppToC::Get(self)->OnFileDialogDismissed( + CefBrowserHostCToCpp::Wrap(browser_host), + file_pathsList); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefRunFileDialogCallbackCppToC::CefRunFileDialogCallbackCppToC( + CefRunFileDialogCallback* cls) + : CefCppToC(cls) { + struct_.struct_.cont = run_file_dialog_callback_cont; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h new file mode 100644 index 00000000000..6f0154624a4 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h @@ -0,0 +1,39 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefRunFileDialogCallbackCppToC + : public CefCppToC { + public: + explicit CefRunFileDialogCallbackCppToC(CefRunFileDialogCallback* cls); + virtual ~CefRunFileDialogCallbackCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_RUN_FILE_DIALOG_CALLBACK_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc new file mode 100644 index 00000000000..0dbf1ee4761 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.cc @@ -0,0 +1,67 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/resource_handler_cpptoc.h" +#include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +cef_resource_handler_t* CEF_CALLBACK scheme_handler_factory_create( + struct _cef_scheme_handler_factory_t* self, cef_browser_t* browser, + cef_frame_t* frame, const cef_string_t* scheme_name, + cef_request_t* request) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return NULL; + // Verify param: scheme_name; type: string_byref_const + DCHECK(scheme_name); + if (!scheme_name) + return NULL; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return NULL; + // Unverified params: browser, frame + + // Execute + CefRefPtr _retval = CefSchemeHandlerFactoryCppToC::Get( + self)->Create( + CefBrowserCToCpp::Wrap(browser), + CefFrameCToCpp::Wrap(frame), + CefString(scheme_name), + CefRequestCToCpp::Wrap(request)); + + // Return type: refptr_same + return CefResourceHandlerCppToC::Wrap(_retval); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefSchemeHandlerFactoryCppToC::CefSchemeHandlerFactoryCppToC( + CefSchemeHandlerFactory* cls) + : CefCppToC(cls) { + struct_.struct_.create = scheme_handler_factory_create; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h new file mode 100644 index 00000000000..82bfa1c686f --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefSchemeHandlerFactoryCppToC + : public CefCppToC { + public: + explicit CefSchemeHandlerFactoryCppToC(CefSchemeHandlerFactory* cls); + virtual ~CefSchemeHandlerFactoryCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_SCHEME_HANDLER_FACTORY_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/string_visitor_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/string_visitor_cpptoc.cc new file mode 100644 index 00000000000..a09cefcaad2 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/string_visitor_cpptoc.cc @@ -0,0 +1,45 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/string_visitor_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK string_visitor_visit(struct _cef_string_visitor_t* self, + const cef_string_t* string) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Unverified params: string + + // Execute + CefStringVisitorCppToC::Get(self)->Visit( + CefString(string)); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefStringVisitorCppToC::CefStringVisitorCppToC(CefStringVisitor* cls) + : CefCppToC( + cls) { + struct_.struct_.visit = string_visitor_visit; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/string_visitor_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/string_visitor_cpptoc.h new file mode 100644 index 00000000000..8b24a92cbfd --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/string_visitor_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_string_visitor.h" +#include "include/capi/cef_string_visitor_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefStringVisitorCppToC + : public CefCppToC { + public: + explicit CefStringVisitorCppToC(CefStringVisitor* cls); + virtual ~CefStringVisitorCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_STRING_VISITOR_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/task_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/task_cpptoc.cc new file mode 100644 index 00000000000..d85f58b9e10 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/task_cpptoc.cc @@ -0,0 +1,41 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/task_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK task_execute(struct _cef_task_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + + // Execute + CefTaskCppToC::Get(self)->Execute(); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefTaskCppToC::CefTaskCppToC(CefTask* cls) + : CefCppToC(cls) { + struct_.struct_.execute = task_execute; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/task_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/task_cpptoc.h new file mode 100644 index 00000000000..118ef926be2 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/task_cpptoc.h @@ -0,0 +1,36 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_task.h" +#include "include/capi/cef_task_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefTaskCppToC + : public CefCppToC { + public: + explicit CefTaskCppToC(CefTask* cls); + virtual ~CefTaskCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_TASK_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc new file mode 100644 index 00000000000..8a770ec6677 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/urlrequest_client_cpptoc.cc @@ -0,0 +1,154 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" +#include "libcef_dll/ctocpp/auth_callback_ctocpp.h" +#include "libcef_dll/ctocpp/urlrequest_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK urlrequest_client_on_request_complete( + struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return; + + // Execute + CefURLRequestClientCppToC::Get(self)->OnRequestComplete( + CefURLRequestCToCpp::Wrap(request)); +} + +void CEF_CALLBACK urlrequest_client_on_upload_progress( + struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request, + uint64 current, uint64 total) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return; + + // Execute + CefURLRequestClientCppToC::Get(self)->OnUploadProgress( + CefURLRequestCToCpp::Wrap(request), + current, + total); +} + +void CEF_CALLBACK urlrequest_client_on_download_progress( + struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request, + uint64 current, uint64 total) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return; + + // Execute + CefURLRequestClientCppToC::Get(self)->OnDownloadProgress( + CefURLRequestCToCpp::Wrap(request), + current, + total); +} + +void CEF_CALLBACK urlrequest_client_on_download_data( + struct _cef_urlrequest_client_t* self, cef_urlrequest_t* request, + const void* data, size_t data_length) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: request; type: refptr_diff + DCHECK(request); + if (!request) + return; + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return; + + // Execute + CefURLRequestClientCppToC::Get(self)->OnDownloadData( + CefURLRequestCToCpp::Wrap(request), + data, + data_length); +} + +int CEF_CALLBACK urlrequest_client_get_auth_credentials( + struct _cef_urlrequest_client_t* self, int isProxy, + const cef_string_t* host, int port, const cef_string_t* realm, + const cef_string_t* scheme, cef_auth_callback_t* callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: host; type: string_byref_const + DCHECK(host); + if (!host) + return 0; + // Verify param: scheme; type: string_byref_const + DCHECK(scheme); + if (!scheme) + return 0; + // Verify param: callback; type: refptr_diff + DCHECK(callback); + if (!callback) + return 0; + // Unverified params: realm + + // Execute + bool _retval = CefURLRequestClientCppToC::Get(self)->GetAuthCredentials( + isProxy?true:false, + CefString(host), + port, + CefString(realm), + CefString(scheme), + CefAuthCallbackCToCpp::Wrap(callback)); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefURLRequestClientCppToC::CefURLRequestClientCppToC(CefURLRequestClient* cls) + : CefCppToC(cls) { + struct_.struct_.on_request_complete = urlrequest_client_on_request_complete; + struct_.struct_.on_upload_progress = urlrequest_client_on_upload_progress; + struct_.struct_.on_download_progress = urlrequest_client_on_download_progress; + struct_.struct_.on_download_data = urlrequest_client_on_download_data; + struct_.struct_.get_auth_credentials = urlrequest_client_get_auth_credentials; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/urlrequest_client_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/urlrequest_client_cpptoc.h new file mode 100644 index 00000000000..ff185d68455 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/urlrequest_client_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_urlrequest.h" +#include "include/capi/cef_urlrequest_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefURLRequestClientCppToC + : public CefCppToC { + public: + explicit CefURLRequestClientCppToC(CefURLRequestClient* cls); + virtual ~CefURLRequestClientCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_URLREQUEST_CLIENT_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/v8accessor_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/v8accessor_cpptoc.cc new file mode 100644 index 00000000000..20b101e13a9 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/v8accessor_cpptoc.cc @@ -0,0 +1,126 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/v8accessor_cpptoc.h" +#include "libcef_dll/ctocpp/v8value_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK v8accessor_get(struct _cef_v8accessor_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + struct _cef_v8value_t** retval, cef_string_t* exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) + return 0; + // Verify param: object; type: refptr_diff + DCHECK(object); + if (!object) + return 0; + // Verify param: retval; type: refptr_diff_byref + DCHECK(retval); + if (!retval) + return 0; + // Verify param: exception; type: string_byref + DCHECK(exception); + if (!exception) + return 0; + + // Translate param: retval; type: refptr_diff_byref + CefRefPtr retvalPtr; + if (retval && *retval) + retvalPtr = CefV8ValueCToCpp::Wrap(*retval); + CefV8Value* retvalOrig = retvalPtr.get(); + // Translate param: exception; type: string_byref + CefString exceptionStr(exception); + + // Execute + bool _retval = CefV8AccessorCppToC::Get(self)->Get( + CefString(name), + CefV8ValueCToCpp::Wrap(object), + retvalPtr, + exceptionStr); + + // Restore param: retval; type: refptr_diff_byref + if (retval) { + if (retvalPtr.get()) { + if (retvalPtr.get() != retvalOrig) { + *retval = CefV8ValueCToCpp::Unwrap(retvalPtr); + } + } else { + *retval = NULL; + } + } + + // Return type: bool + return _retval; +} + +int CEF_CALLBACK v8accessor_set(struct _cef_v8accessor_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + struct _cef_v8value_t* value, cef_string_t* exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) + return 0; + // Verify param: object; type: refptr_diff + DCHECK(object); + if (!object) + return 0; + // Verify param: value; type: refptr_diff + DCHECK(value); + if (!value) + return 0; + // Verify param: exception; type: string_byref + DCHECK(exception); + if (!exception) + return 0; + + // Translate param: exception; type: string_byref + CefString exceptionStr(exception); + + // Execute + bool _retval = CefV8AccessorCppToC::Get(self)->Set( + CefString(name), + CefV8ValueCToCpp::Wrap(object), + CefV8ValueCToCpp::Wrap(value), + exceptionStr); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefV8AccessorCppToC::CefV8AccessorCppToC(CefV8Accessor* cls) + : CefCppToC(cls) { + struct_.struct_.get = v8accessor_get; + struct_.struct_.set = v8accessor_set; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/v8accessor_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/v8accessor_cpptoc.h new file mode 100644 index 00000000000..d73e8ca3b70 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/v8accessor_cpptoc.h @@ -0,0 +1,36 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefV8AccessorCppToC + : public CefCppToC { + public: + explicit CefV8AccessorCppToC(CefV8Accessor* cls); + virtual ~CefV8AccessorCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8ACCESSOR_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/v8handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/v8handler_cpptoc.cc new file mode 100644 index 00000000000..0b34e56aca4 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/v8handler_cpptoc.cc @@ -0,0 +1,99 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/v8handler_cpptoc.h" +#include "libcef_dll/ctocpp/v8value_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK v8handler_execute(struct _cef_v8handler_t* self, + const cef_string_t* name, struct _cef_v8value_t* object, + size_t argumentsCount, struct _cef_v8value_t* const* arguments, + struct _cef_v8value_t** retval, cef_string_t* exception) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: name; type: string_byref_const + DCHECK(name); + if (!name) + return 0; + // Verify param: object; type: refptr_diff + DCHECK(object); + if (!object) + return 0; + // Verify param: arguments; type: refptr_vec_diff_byref_const + DCHECK(argumentsCount == 0 || arguments); + if (argumentsCount > 0 && !arguments) + return 0; + // Verify param: retval; type: refptr_diff_byref + DCHECK(retval); + if (!retval) + return 0; + // Verify param: exception; type: string_byref + DCHECK(exception); + if (!exception) + return 0; + + // Translate param: arguments; type: refptr_vec_diff_byref_const + std::vector > argumentsList; + if (argumentsCount > 0) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList.push_back(CefV8ValueCToCpp::Wrap(arguments[i])); + } + } + // Translate param: retval; type: refptr_diff_byref + CefRefPtr retvalPtr; + if (retval && *retval) + retvalPtr = CefV8ValueCToCpp::Wrap(*retval); + CefV8Value* retvalOrig = retvalPtr.get(); + // Translate param: exception; type: string_byref + CefString exceptionStr(exception); + + // Execute + bool _retval = CefV8HandlerCppToC::Get(self)->Execute( + CefString(name), + CefV8ValueCToCpp::Wrap(object), + argumentsList, + retvalPtr, + exceptionStr); + + // Restore param: retval; type: refptr_diff_byref + if (retval) { + if (retvalPtr.get()) { + if (retvalPtr.get() != retvalOrig) { + *retval = CefV8ValueCToCpp::Unwrap(retvalPtr); + } + } else { + *retval = NULL; + } + } + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefV8HandlerCppToC::CefV8HandlerCppToC(CefV8Handler* cls) + : CefCppToC(cls) { + struct_.struct_.execute = v8handler_execute; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/v8handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/v8handler_cpptoc.h new file mode 100644 index 00000000000..e2cbe1a79e5 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/v8handler_cpptoc.h @@ -0,0 +1,36 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefV8HandlerCppToC + : public CefCppToC { + public: + explicit CefV8HandlerCppToC(CefV8Handler* cls); + virtual ~CefV8HandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_V8HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc new file mode 100644 index 00000000000..254e1466e8f --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.cc @@ -0,0 +1,56 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h" +#include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +int CEF_CALLBACK web_plugin_info_visitor_visit( + struct _cef_web_plugin_info_visitor_t* self, cef_web_plugin_info_t* info, + int count, int total) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: info; type: refptr_diff + DCHECK(info); + if (!info) + return 0; + + // Execute + bool _retval = CefWebPluginInfoVisitorCppToC::Get(self)->Visit( + CefWebPluginInfoCToCpp::Wrap(info), + count, + total); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefWebPluginInfoVisitorCppToC::CefWebPluginInfoVisitorCppToC( + CefWebPluginInfoVisitor* cls) + : CefCppToC(cls) { + struct_.struct_.visit = web_plugin_info_visitor_visit; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h new file mode 100644 index 00000000000..a3182ff1ef9 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_VISITOR_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_VISITOR_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_web_plugin.h" +#include "include/capi/cef_web_plugin_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefWebPluginInfoVisitorCppToC + : public CefCppToC { + public: + explicit CefWebPluginInfoVisitorCppToC(CefWebPluginInfoVisitor* cls); + virtual ~CefWebPluginInfoVisitorCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_INFO_VISITOR_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc new file mode 100644 index 00000000000..47ad22052dd --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.cc @@ -0,0 +1,53 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +void CEF_CALLBACK web_plugin_unstable_callback_is_unstable( + struct _cef_web_plugin_unstable_callback_t* self, const cef_string_t* path, + int unstable) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return; + // Verify param: path; type: string_byref_const + DCHECK(path); + if (!path) + return; + + // Execute + CefWebPluginUnstableCallbackCppToC::Get(self)->IsUnstable( + CefString(path), + unstable?true:false); +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefWebPluginUnstableCallbackCppToC::CefWebPluginUnstableCallbackCppToC( + CefWebPluginUnstableCallback* cls) + : CefCppToC( + cls) { + struct_.struct_.is_unstable = web_plugin_unstable_callback_is_unstable; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h new file mode 100644 index 00000000000..0dc0cb6e7c1 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h @@ -0,0 +1,38 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_UNSTABLE_CALLBACK_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_UNSTABLE_CALLBACK_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_web_plugin.h" +#include "include/capi/cef_web_plugin_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefWebPluginUnstableCallbackCppToC + : public CefCppToC { + public: + explicit CefWebPluginUnstableCallbackCppToC( + CefWebPluginUnstableCallback* cls); + virtual ~CefWebPluginUnstableCallbackCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_WEB_PLUGIN_UNSTABLE_CALLBACK_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/cpptoc/write_handler_cpptoc.cc b/vendor/cef3/libcef_dll/cpptoc/write_handler_cpptoc.cc new file mode 100644 index 00000000000..4cbfb69e0c7 --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/write_handler_cpptoc.cc @@ -0,0 +1,116 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/write_handler_cpptoc.h" + + +// MEMBER FUNCTIONS - Body may be edited by hand. + +size_t CEF_CALLBACK write_handler_write(struct _cef_write_handler_t* self, + const void* ptr, size_t size, size_t n) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = CefWriteHandlerCppToC::Get(self)->Write( + ptr, + size, + n); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK write_handler_seek(struct _cef_write_handler_t* self, + int64 offset, int whence) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + int _retval = CefWriteHandlerCppToC::Get(self)->Seek( + offset, + whence); + + // Return type: simple + return _retval; +} + +int64 CEF_CALLBACK write_handler_tell(struct _cef_write_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + int64 _retval = CefWriteHandlerCppToC::Get(self)->Tell(); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK write_handler_flush(struct _cef_write_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + int _retval = CefWriteHandlerCppToC::Get(self)->Flush(); + + // Return type: simple + return _retval; +} + +int CEF_CALLBACK write_handler_may_block(struct _cef_write_handler_t* self) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + DCHECK(self); + if (!self) + return 0; + + // Execute + bool _retval = CefWriteHandlerCppToC::Get(self)->MayBlock(); + + // Return type: bool + return _retval; +} + + +// CONSTRUCTOR - Do not edit by hand. + +CefWriteHandlerCppToC::CefWriteHandlerCppToC(CefWriteHandler* cls) + : CefCppToC( + cls) { + struct_.struct_.write = write_handler_write; + struct_.struct_.seek = write_handler_seek; + struct_.struct_.tell = write_handler_tell; + struct_.struct_.flush = write_handler_flush; + struct_.struct_.may_block = write_handler_may_block; +} + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCppToC::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/cpptoc/write_handler_cpptoc.h b/vendor/cef3/libcef_dll/cpptoc/write_handler_cpptoc.h new file mode 100644 index 00000000000..5852e4eba0b --- /dev/null +++ b/vendor/cef3/libcef_dll/cpptoc/write_handler_cpptoc.h @@ -0,0 +1,37 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ +#define CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" +#include "libcef_dll/cpptoc/cpptoc.h" + +// Wrap a C++ class with a C structure. +// This class may be instantiated and accessed wrapper-side only. +class CefWriteHandlerCppToC + : public CefCppToC { + public: + explicit CefWriteHandlerCppToC(CefWriteHandler* cls); + virtual ~CefWriteHandlerCppToC() {} +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CPPTOC_WRITE_HANDLER_CPPTOC_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.cc new file mode 100644 index 00000000000..4cc64f58b72 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.cc @@ -0,0 +1,35 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefAllowCertificateErrorCallbackCToCpp::Continue(bool allow) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cont(struct_, + allow); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h new file mode 100644 index 00000000000..ae35463cf78 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h @@ -0,0 +1,45 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_ALLOW_CERTIFICATE_ERROR_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_ALLOW_CERTIFICATE_ERROR_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request_handler.h" +#include "include/capi/cef_request_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefAllowCertificateErrorCallbackCToCpp + : public CefCToCpp { + public: + explicit CefAllowCertificateErrorCallbackCToCpp( + cef_allow_certificate_error_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefAllowCertificateErrorCallbackCToCpp() {} + + // CefAllowCertificateErrorCallback methods + virtual void Continue(bool allow) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_ALLOW_CERTIFICATE_ERROR_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/auth_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/auth_callback_ctocpp.cc new file mode 100644 index 00000000000..1266e56ce15 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/auth_callback_ctocpp.cc @@ -0,0 +1,55 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/auth_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefAuthCallbackCToCpp::Continue(const CefString& username, + const CefString& password) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: username; type: string_byref_const + DCHECK(!username.empty()); + if (username.empty()) + return; + // Verify param: password; type: string_byref_const + DCHECK(!password.empty()); + if (password.empty()) + return; + + // Execute + struct_->cont(struct_, + username.GetStruct(), + password.GetStruct()); +} + +void CefAuthCallbackCToCpp::Cancel() { + if (CEF_MEMBER_MISSING(struct_, cancel)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cancel(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/auth_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/auth_callback_ctocpp.h new file mode 100644 index 00000000000..2171f67e50d --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/auth_callback_ctocpp.h @@ -0,0 +1,44 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_auth_callback.h" +#include "include/capi/cef_auth_callback_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefAuthCallbackCToCpp + : public CefCToCpp { + public: + explicit CefAuthCallbackCToCpp(cef_auth_callback_t* str) + : CefCToCpp( + str) {} + virtual ~CefAuthCallbackCToCpp() {} + + // CefAuthCallback methods + virtual void Continue(const CefString& username, + const CefString& password) OVERRIDE; + virtual void Cancel() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_AUTH_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/base_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/base_ctocpp.h new file mode 100644 index 00000000000..f085183b153 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/base_ctocpp.h @@ -0,0 +1,101 @@ +// Copyright (c) 2009 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. + +#ifndef CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ +#pragma once + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" + + +// CefCToCpp implementation for CefBase. +class CefBaseCToCpp : public CefBase { + public: + // Use this method to create a wrapper class instance for a structure + // received from the other side. + static CefRefPtr Wrap(cef_base_t* s) { + if (!s) + return NULL; + + // Wrap their structure with the CefCToCpp object. + CefBaseCToCpp* wrapper = new CefBaseCToCpp(s); + // Put the wrapper object in a smart pointer. + CefRefPtr wrapperPtr(wrapper); + // Release the reference that was added to the CefCppToC wrapper object on + // the other side before their structure was passed to us. + wrapper->UnderlyingRelease(); + // Return the smart pointer. + return wrapperPtr; + } + + // Use this method to retrieve the underlying structure from a wrapper class + // instance for return back to the other side. + static cef_base_t* Unwrap(CefRefPtr c) { + if (!c.get()) + return NULL; + + // Cast the object to our wrapper class type. + CefBaseCToCpp* wrapper = static_cast(c.get()); + // Add a reference to the CefCppToC wrapper object on the other side that + // will be released once the structure is received. + wrapper->UnderlyingAddRef(); + // Return their original structure. + return wrapper->GetStruct(); + } + + explicit CefBaseCToCpp(cef_base_t* str) + : struct_(str) { + DCHECK(str); + } + virtual ~CefBaseCToCpp() {} + + // If returning the structure across the DLL boundary you should call + // UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of + // the DLL boundary, call Release() on the CefCppToC object. + cef_base_t* GetStruct() { return struct_; } + + // CefBase methods increment/decrement reference counts on both this object + // and the underlying wrapped structure. + void AddRef() const { + UnderlyingAddRef(); + ref_count_.AddRef(); + } + bool Release() const { + UnderlyingRelease(); + if (ref_count_.Release()) { + delete this; + return true; + } + return false; + } + bool HasOneRef() const { return ref_count_.HasOneRef(); } + + // Increment/decrement reference counts on only the underlying class. + void UnderlyingAddRef() const { + if (struct_->add_ref) + struct_->add_ref(struct_); + } + bool UnderlyingRelease() const { + if (!struct_->release) + return false; + return struct_->release(struct_) ? true : false; + } + bool UnderlyingHasOneRef() const { + if (!struct_->has_one_ref) + return false; + return struct_->has_one_ref(struct_) ? true : false; + } + + private: + CefRefCount ref_count_; + cef_base_t* struct_; + + DISALLOW_COPY_AND_ASSIGN(CefBaseCToCpp); +}; + + +#endif // CEF_LIBCEF_DLL_CTOCPP_BASE_CTOCPP_H_ diff --git a/vendor/cef3/libcef_dll/ctocpp/before_download_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/before_download_callback_ctocpp.cc new file mode 100644 index 00000000000..972325959b1 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/before_download_callback_ctocpp.cc @@ -0,0 +1,39 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/before_download_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefBeforeDownloadCallbackCToCpp::Continue(const CefString& download_path, + bool show_dialog) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: download_path + + // Execute + struct_->cont(struct_, + download_path.GetStruct(), + show_dialog); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = + 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/before_download_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/before_download_callback_ctocpp.h new file mode 100644 index 00000000000..30e1c0c1063 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/before_download_callback_ctocpp.h @@ -0,0 +1,43 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_download_handler.h" +#include "include/capi/cef_download_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefBeforeDownloadCallbackCToCpp + : public CefCToCpp { + public: + explicit CefBeforeDownloadCallbackCToCpp(cef_before_download_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefBeforeDownloadCallbackCToCpp() {} + + // CefBeforeDownloadCallback methods + virtual void Continue(const CefString& download_path, + bool show_dialog) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_BEFORE_DOWNLOAD_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/binary_value_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/binary_value_ctocpp.cc new file mode 100644 index 00000000000..24bb115e554 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/binary_value_ctocpp.cc @@ -0,0 +1,118 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/binary_value_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefBinaryValue::Create(const void* data, + size_t data_size) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return NULL; + + // Execute + cef_binary_value_t* _retval = cef_binary_value_create( + data, + data_size); + + // Return type: refptr_same + return CefBinaryValueCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefBinaryValueCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefBinaryValueCToCpp::IsOwned() { + if (CEF_MEMBER_MISSING(struct_, is_owned)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_owned(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefBinaryValueCToCpp::Copy() { + if (CEF_MEMBER_MISSING(struct_, copy)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_binary_value_t* _retval = struct_->copy(struct_); + + // Return type: refptr_same + return CefBinaryValueCToCpp::Wrap(_retval); +} + +size_t CefBinaryValueCToCpp::GetSize() { + if (CEF_MEMBER_MISSING(struct_, get_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_size(struct_); + + // Return type: simple + return _retval; +} + +size_t CefBinaryValueCToCpp::GetData(void* buffer, size_t buffer_size, + size_t data_offset) { + if (CEF_MEMBER_MISSING(struct_, get_data)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: buffer; type: simple_byaddr + DCHECK(buffer); + if (!buffer) + return 0; + + // Execute + size_t _retval = struct_->get_data(struct_, + buffer, + buffer_size, + data_offset); + + // Return type: simple + return _retval; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/binary_value_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/binary_value_ctocpp.h new file mode 100644 index 00000000000..bd0f359bb7c --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/binary_value_ctocpp.h @@ -0,0 +1,47 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_values.h" +#include "include/capi/cef_values_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefBinaryValueCToCpp + : public CefCToCpp { + public: + explicit CefBinaryValueCToCpp(cef_binary_value_t* str) + : CefCToCpp( + str) {} + virtual ~CefBinaryValueCToCpp() {} + + // CefBinaryValue methods + virtual bool IsValid() OVERRIDE; + virtual bool IsOwned() OVERRIDE; + virtual CefRefPtr Copy() OVERRIDE; + virtual size_t GetSize() OVERRIDE; + virtual size_t GetData(void* buffer, size_t buffer_size, + size_t data_offset) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_BINARY_VALUE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/browser_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/browser_ctocpp.cc new file mode 100644 index 00000000000..bab4d979d89 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/browser_ctocpp.cc @@ -0,0 +1,340 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/browser_host_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/process_message_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefRefPtr CefBrowserCToCpp::GetHost() { + if (CEF_MEMBER_MISSING(struct_, get_host)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_browser_host_t* _retval = struct_->get_host(struct_); + + // Return type: refptr_same + return CefBrowserHostCToCpp::Wrap(_retval); +} + +bool CefBrowserCToCpp::CanGoBack() { + if (CEF_MEMBER_MISSING(struct_, can_go_back)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->can_go_back(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefBrowserCToCpp::GoBack() { + if (CEF_MEMBER_MISSING(struct_, go_back)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->go_back(struct_); +} + +bool CefBrowserCToCpp::CanGoForward() { + if (CEF_MEMBER_MISSING(struct_, can_go_forward)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->can_go_forward(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefBrowserCToCpp::GoForward() { + if (CEF_MEMBER_MISSING(struct_, go_forward)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->go_forward(struct_); +} + +bool CefBrowserCToCpp::IsLoading() { + if (CEF_MEMBER_MISSING(struct_, is_loading)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_loading(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefBrowserCToCpp::Reload() { + if (CEF_MEMBER_MISSING(struct_, reload)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->reload(struct_); +} + +void CefBrowserCToCpp::ReloadIgnoreCache() { + if (CEF_MEMBER_MISSING(struct_, reload_ignore_cache)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->reload_ignore_cache(struct_); +} + +void CefBrowserCToCpp::StopLoad() { + if (CEF_MEMBER_MISSING(struct_, stop_load)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->stop_load(struct_); +} + +int CefBrowserCToCpp::GetIdentifier() { + if (CEF_MEMBER_MISSING(struct_, get_identifier)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_identifier(struct_); + + // Return type: simple + return _retval; +} + +bool CefBrowserCToCpp::IsSame(CefRefPtr that) { + if (CEF_MEMBER_MISSING(struct_, is_same)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefBrowserCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; +} + +bool CefBrowserCToCpp::IsPopup() { + if (CEF_MEMBER_MISSING(struct_, is_popup)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_popup(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefBrowserCToCpp::HasDocument() { + if (CEF_MEMBER_MISSING(struct_, has_document)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_document(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefBrowserCToCpp::GetMainFrame() { + if (CEF_MEMBER_MISSING(struct_, get_main_frame)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_frame_t* _retval = struct_->get_main_frame(struct_); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); +} + +CefRefPtr CefBrowserCToCpp::GetFocusedFrame() { + if (CEF_MEMBER_MISSING(struct_, get_focused_frame)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_frame_t* _retval = struct_->get_focused_frame(struct_); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); +} + +CefRefPtr CefBrowserCToCpp::GetFrame(int64 identifier) { + if (CEF_MEMBER_MISSING(struct_, get_frame_byident)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_frame_t* _retval = struct_->get_frame_byident(struct_, + identifier); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); +} + +CefRefPtr CefBrowserCToCpp::GetFrame(const CefString& name) { + if (CEF_MEMBER_MISSING(struct_, get_frame)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: name + + // Execute + cef_frame_t* _retval = struct_->get_frame(struct_, + name.GetStruct()); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); +} + +size_t CefBrowserCToCpp::GetFrameCount() { + if (CEF_MEMBER_MISSING(struct_, get_frame_count)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_frame_count(struct_); + + // Return type: simple + return _retval; +} + +void CefBrowserCToCpp::GetFrameIdentifiers(std::vector& identifiers) { + if (CEF_MEMBER_MISSING(struct_, get_frame_identifiers)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: identifiers; type: simple_vec_byref + size_t identifiersSize = identifiers.size(); + size_t identifiersCount = std::max(GetFrameCount(), identifiersSize); + int64* identifiersList = NULL; + if (identifiersCount > 0) { + identifiersList = new int64[identifiersCount]; + DCHECK(identifiersList); + if (identifiersList) { + memset(identifiersList, 0, sizeof(int64)*identifiersCount); + } + if (identifiersList && identifiersSize > 0) { + for (size_t i = 0; i < identifiersSize; ++i) { + identifiersList[i] = identifiers[i]; + } + } + } + + // Execute + struct_->get_frame_identifiers(struct_, + &identifiersCount, + identifiersList); + + // Restore param:identifiers; type: simple_vec_byref + identifiers.clear(); + if (identifiersCount > 0 && identifiersList) { + for (size_t i = 0; i < identifiersCount; ++i) { + identifiers.push_back(identifiersList[i]); + } + delete [] identifiersList; + } +} + +void CefBrowserCToCpp::GetFrameNames(std::vector& names) { + if (CEF_MEMBER_MISSING(struct_, get_frame_names)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: names; type: string_vec_byref + cef_string_list_t namesList = cef_string_list_alloc(); + DCHECK(namesList); + if (namesList) + transfer_string_list_contents(names, namesList); + + // Execute + struct_->get_frame_names(struct_, + namesList); + + // Restore param:names; type: string_vec_byref + if (namesList) { + names.clear(); + transfer_string_list_contents(namesList, names); + cef_string_list_free(namesList); + } +} + +bool CefBrowserCToCpp::SendProcessMessage(CefProcessId target_process, + CefRefPtr message) { + if (CEF_MEMBER_MISSING(struct_, send_process_message)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: message; type: refptr_same + DCHECK(message.get()); + if (!message.get()) + return false; + + // Execute + int _retval = struct_->send_process_message(struct_, + target_process, + CefProcessMessageCToCpp::Unwrap(message)); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/browser_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/browser_ctocpp.h new file mode 100644 index 00000000000..8f73e483746 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/browser_ctocpp.h @@ -0,0 +1,64 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefBrowserCToCpp + : public CefCToCpp { + public: + explicit CefBrowserCToCpp(cef_browser_t* str) + : CefCToCpp(str) {} + virtual ~CefBrowserCToCpp() {} + + // CefBrowser methods + virtual CefRefPtr GetHost() OVERRIDE; + virtual bool CanGoBack() OVERRIDE; + virtual void GoBack() OVERRIDE; + virtual bool CanGoForward() OVERRIDE; + virtual void GoForward() OVERRIDE; + virtual bool IsLoading() OVERRIDE; + virtual void Reload() OVERRIDE; + virtual void ReloadIgnoreCache() OVERRIDE; + virtual void StopLoad() OVERRIDE; + virtual int GetIdentifier() OVERRIDE; + virtual bool IsSame(CefRefPtr that) OVERRIDE; + virtual bool IsPopup() OVERRIDE; + virtual bool HasDocument() OVERRIDE; + virtual CefRefPtr GetMainFrame() OVERRIDE; + virtual CefRefPtr GetFocusedFrame() OVERRIDE; + virtual CefRefPtr GetFrame(int64 identifier) OVERRIDE; + virtual CefRefPtr GetFrame(const CefString& name) OVERRIDE; + virtual size_t GetFrameCount() OVERRIDE; + virtual void GetFrameIdentifiers(std::vector& identifiers) OVERRIDE; + virtual void GetFrameNames(std::vector& names) OVERRIDE; + virtual bool SendProcessMessage(CefProcessId target_process, + CefRefPtr message) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/browser_host_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/browser_host_ctocpp.cc new file mode 100644 index 00000000000..b4e073749ca --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/browser_host_ctocpp.cc @@ -0,0 +1,646 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/client_cpptoc.h" +#include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h" +#include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/browser_host_ctocpp.h" +#include "libcef_dll/ctocpp/drag_data_ctocpp.h" +#include "libcef_dll/ctocpp/request_context_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +bool CefBrowserHost::CreateBrowser(const CefWindowInfo& windowInfo, + CefRefPtr client, const CefString& url, + const CefBrowserSettings& settings, + CefRefPtr request_context) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: client, url, request_context + + // Execute + int _retval = cef_browser_host_create_browser( + &windowInfo, + CefClientCppToC::Wrap(client), + url.GetStruct(), + &settings, + CefRequestContextCToCpp::Unwrap(request_context)); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefBrowserHost::CreateBrowserSync( + const CefWindowInfo& windowInfo, CefRefPtr client, + const CefString& url, const CefBrowserSettings& settings, + CefRefPtr request_context) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: client, url, request_context + + // Execute + cef_browser_t* _retval = cef_browser_host_create_browser_sync( + &windowInfo, + CefClientCppToC::Wrap(client), + url.GetStruct(), + &settings, + CefRequestContextCToCpp::Unwrap(request_context)); + + // Return type: refptr_same + return CefBrowserCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefRefPtr CefBrowserHostCToCpp::GetBrowser() { + if (CEF_MEMBER_MISSING(struct_, get_browser)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_browser_t* _retval = struct_->get_browser(struct_); + + // Return type: refptr_same + return CefBrowserCToCpp::Wrap(_retval); +} + +void CefBrowserHostCToCpp::CloseBrowser(bool force_close) { + if (CEF_MEMBER_MISSING(struct_, close_browser)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->close_browser(struct_, + force_close); +} + +void CefBrowserHostCToCpp::SetFocus(bool focus) { + if (CEF_MEMBER_MISSING(struct_, set_focus)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_focus(struct_, + focus); +} + +void CefBrowserHostCToCpp::SetWindowVisibility(bool visible) { + if (CEF_MEMBER_MISSING(struct_, set_window_visibility)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_window_visibility(struct_, + visible); +} + +CefWindowHandle CefBrowserHostCToCpp::GetWindowHandle() { + if (CEF_MEMBER_MISSING(struct_, get_window_handle)) + return kNullWindowHandle; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_window_handle_t _retval = struct_->get_window_handle(struct_); + + // Return type: simple + return _retval; +} + +CefWindowHandle CefBrowserHostCToCpp::GetOpenerWindowHandle() { + if (CEF_MEMBER_MISSING(struct_, get_opener_window_handle)) + return kNullWindowHandle; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_window_handle_t _retval = struct_->get_opener_window_handle(struct_); + + // Return type: simple + return _retval; +} + +CefRefPtr CefBrowserHostCToCpp::GetClient() { + if (CEF_MEMBER_MISSING(struct_, get_client)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_client_t* _retval = struct_->get_client(struct_); + + // Return type: refptr_diff + return CefClientCppToC::Unwrap(_retval); +} + +CefRefPtr CefBrowserHostCToCpp::GetRequestContext() { + if (CEF_MEMBER_MISSING(struct_, get_request_context)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_request_context_t* _retval = struct_->get_request_context(struct_); + + // Return type: refptr_same + return CefRequestContextCToCpp::Wrap(_retval); +} + +double CefBrowserHostCToCpp::GetZoomLevel() { + if (CEF_MEMBER_MISSING(struct_, get_zoom_level)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + double _retval = struct_->get_zoom_level(struct_); + + // Return type: simple + return _retval; +} + +void CefBrowserHostCToCpp::SetZoomLevel(double zoomLevel) { + if (CEF_MEMBER_MISSING(struct_, set_zoom_level)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_zoom_level(struct_, + zoomLevel); +} + +void CefBrowserHostCToCpp::RunFileDialog(FileDialogMode mode, + const CefString& title, const CefString& default_file_name, + const std::vector& accept_types, + CefRefPtr callback) { + if (CEF_MEMBER_MISSING(struct_, run_file_dialog)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: callback; type: refptr_diff + DCHECK(callback.get()); + if (!callback.get()) + return; + // Unverified params: title, default_file_name, accept_types + + // Translate param: accept_types; type: string_vec_byref_const + cef_string_list_t accept_typesList = cef_string_list_alloc(); + DCHECK(accept_typesList); + if (accept_typesList) + transfer_string_list_contents(accept_types, accept_typesList); + + // Execute + struct_->run_file_dialog(struct_, + mode, + title.GetStruct(), + default_file_name.GetStruct(), + accept_typesList, + CefRunFileDialogCallbackCppToC::Wrap(callback)); + + // Restore param:accept_types; type: string_vec_byref_const + if (accept_typesList) + cef_string_list_free(accept_typesList); +} + +void CefBrowserHostCToCpp::StartDownload(const CefString& url) { + if (CEF_MEMBER_MISSING(struct_, start_download)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->start_download(struct_, + url.GetStruct()); +} + +void CefBrowserHostCToCpp::Print() { + if (CEF_MEMBER_MISSING(struct_, print)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->print(struct_); +} + +void CefBrowserHostCToCpp::Find(int identifier, const CefString& searchText, + bool forward, bool matchCase, bool findNext) { + if (CEF_MEMBER_MISSING(struct_, find)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: searchText; type: string_byref_const + DCHECK(!searchText.empty()); + if (searchText.empty()) + return; + + // Execute + struct_->find(struct_, + identifier, + searchText.GetStruct(), + forward, + matchCase, + findNext); +} + +void CefBrowserHostCToCpp::StopFinding(bool clearSelection) { + if (CEF_MEMBER_MISSING(struct_, stop_finding)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->stop_finding(struct_, + clearSelection); +} + +void CefBrowserHostCToCpp::ShowDevTools(const CefWindowInfo& windowInfo, + CefRefPtr client, const CefBrowserSettings& settings, + const CefPoint& inspect_element_at) { + if (CEF_MEMBER_MISSING(struct_, show_dev_tools)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: client; type: refptr_diff + DCHECK(client.get()); + if (!client.get()) + return; + // Unverified params: inspect_element_at + + // Execute + struct_->show_dev_tools(struct_, + &windowInfo, + CefClientCppToC::Wrap(client), + &settings, + &inspect_element_at); +} + +void CefBrowserHostCToCpp::CloseDevTools() { + if (CEF_MEMBER_MISSING(struct_, close_dev_tools)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->close_dev_tools(struct_); +} + +void CefBrowserHostCToCpp::GetNavigationEntries( + CefRefPtr visitor, bool current_only) { + if (CEF_MEMBER_MISSING(struct_, get_navigation_entries)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return; + + // Execute + struct_->get_navigation_entries(struct_, + CefNavigationEntryVisitorCppToC::Wrap(visitor), + current_only); +} + +void CefBrowserHostCToCpp::SetMouseCursorChangeDisabled(bool disabled) { + if (CEF_MEMBER_MISSING(struct_, set_mouse_cursor_change_disabled)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_mouse_cursor_change_disabled(struct_, + disabled); +} + +bool CefBrowserHostCToCpp::IsMouseCursorChangeDisabled() { + if (CEF_MEMBER_MISSING(struct_, is_mouse_cursor_change_disabled)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_mouse_cursor_change_disabled(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefBrowserHostCToCpp::ReplaceMisspelling(const CefString& word) { + if (CEF_MEMBER_MISSING(struct_, replace_misspelling)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: word; type: string_byref_const + DCHECK(!word.empty()); + if (word.empty()) + return; + + // Execute + struct_->replace_misspelling(struct_, + word.GetStruct()); +} + +void CefBrowserHostCToCpp::AddWordToDictionary(const CefString& word) { + if (CEF_MEMBER_MISSING(struct_, add_word_to_dictionary)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: word; type: string_byref_const + DCHECK(!word.empty()); + if (word.empty()) + return; + + // Execute + struct_->add_word_to_dictionary(struct_, + word.GetStruct()); +} + +bool CefBrowserHostCToCpp::IsWindowRenderingDisabled() { + if (CEF_MEMBER_MISSING(struct_, is_window_rendering_disabled)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_window_rendering_disabled(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefBrowserHostCToCpp::WasResized() { + if (CEF_MEMBER_MISSING(struct_, was_resized)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->was_resized(struct_); +} + +void CefBrowserHostCToCpp::WasHidden(bool hidden) { + if (CEF_MEMBER_MISSING(struct_, was_hidden)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->was_hidden(struct_, + hidden); +} + +void CefBrowserHostCToCpp::NotifyScreenInfoChanged() { + if (CEF_MEMBER_MISSING(struct_, notify_screen_info_changed)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->notify_screen_info_changed(struct_); +} + +void CefBrowserHostCToCpp::Invalidate(PaintElementType type) { + if (CEF_MEMBER_MISSING(struct_, invalidate)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->invalidate(struct_, + type); +} + +void CefBrowserHostCToCpp::SendKeyEvent(const CefKeyEvent& event) { + if (CEF_MEMBER_MISSING(struct_, send_key_event)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_key_event(struct_, + &event); +} + +void CefBrowserHostCToCpp::SendMouseClickEvent(const CefMouseEvent& event, + MouseButtonType type, bool mouseUp, int clickCount) { + if (CEF_MEMBER_MISSING(struct_, send_mouse_click_event)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_mouse_click_event(struct_, + &event, + type, + mouseUp, + clickCount); +} + +void CefBrowserHostCToCpp::SendMouseMoveEvent(const CefMouseEvent& event, + bool mouseLeave) { + if (CEF_MEMBER_MISSING(struct_, send_mouse_move_event)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_mouse_move_event(struct_, + &event, + mouseLeave); +} + +void CefBrowserHostCToCpp::SendMouseWheelEvent(const CefMouseEvent& event, + int deltaX, int deltaY) { + if (CEF_MEMBER_MISSING(struct_, send_mouse_wheel_event)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_mouse_wheel_event(struct_, + &event, + deltaX, + deltaY); +} + +void CefBrowserHostCToCpp::SendFocusEvent(bool setFocus) { + if (CEF_MEMBER_MISSING(struct_, send_focus_event)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_focus_event(struct_, + setFocus); +} + +void CefBrowserHostCToCpp::SendCaptureLostEvent() { + if (CEF_MEMBER_MISSING(struct_, send_capture_lost_event)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->send_capture_lost_event(struct_); +} + +void CefBrowserHostCToCpp::NotifyMoveOrResizeStarted() { + if (CEF_MEMBER_MISSING(struct_, notify_move_or_resize_started)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->notify_move_or_resize_started(struct_); +} + +CefTextInputContext CefBrowserHostCToCpp::GetNSTextInputContext() { + if (CEF_MEMBER_MISSING(struct_, get_nstext_input_context)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_text_input_context_t _retval = struct_->get_nstext_input_context(struct_); + + // Return type: simple + return _retval; +} + +void CefBrowserHostCToCpp::HandleKeyEventBeforeTextInputClient( + CefEventHandle keyEvent) { + if (CEF_MEMBER_MISSING(struct_, handle_key_event_before_text_input_client)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->handle_key_event_before_text_input_client(struct_, + keyEvent); +} + +void CefBrowserHostCToCpp::HandleKeyEventAfterTextInputClient( + CefEventHandle keyEvent) { + if (CEF_MEMBER_MISSING(struct_, handle_key_event_after_text_input_client)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->handle_key_event_after_text_input_client(struct_, + keyEvent); +} + +void CefBrowserHostCToCpp::DragTargetDragEnter(CefRefPtr drag_data, + const CefMouseEvent& event, DragOperationsMask allowed_ops) { + if (CEF_MEMBER_MISSING(struct_, drag_target_drag_enter)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: drag_data; type: refptr_same + DCHECK(drag_data.get()); + if (!drag_data.get()) + return; + + // Execute + struct_->drag_target_drag_enter(struct_, + CefDragDataCToCpp::Unwrap(drag_data), + &event, + allowed_ops); +} + +void CefBrowserHostCToCpp::DragTargetDragOver(const CefMouseEvent& event, + DragOperationsMask allowed_ops) { + if (CEF_MEMBER_MISSING(struct_, drag_target_drag_over)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->drag_target_drag_over(struct_, + &event, + allowed_ops); +} + +void CefBrowserHostCToCpp::DragTargetDragLeave() { + if (CEF_MEMBER_MISSING(struct_, drag_target_drag_leave)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->drag_target_drag_leave(struct_); +} + +void CefBrowserHostCToCpp::DragTargetDrop(const CefMouseEvent& event) { + if (CEF_MEMBER_MISSING(struct_, drag_target_drop)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->drag_target_drop(struct_, + &event); +} + +void CefBrowserHostCToCpp::DragSourceEndedAt(int x, int y, + DragOperationsMask op) { + if (CEF_MEMBER_MISSING(struct_, drag_source_ended_at)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->drag_source_ended_at(struct_, + x, + y, + op); +} + +void CefBrowserHostCToCpp::DragSourceSystemDragEnded() { + if (CEF_MEMBER_MISSING(struct_, drag_source_system_drag_ended)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->drag_source_system_drag_ended(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/browser_host_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/browser_host_ctocpp.h new file mode 100644 index 00000000000..afe2c1f6ad1 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/browser_host_ctocpp.h @@ -0,0 +1,102 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_client.h" +#include "include/capi/cef_client_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefBrowserHostCToCpp + : public CefCToCpp { + public: + explicit CefBrowserHostCToCpp(cef_browser_host_t* str) + : CefCToCpp( + str) {} + virtual ~CefBrowserHostCToCpp() {} + + // CefBrowserHost methods + virtual CefRefPtr GetBrowser() OVERRIDE; + virtual void CloseBrowser(bool force_close) OVERRIDE; + virtual void SetFocus(bool focus) OVERRIDE; + virtual void SetWindowVisibility(bool visible) OVERRIDE; + virtual CefWindowHandle GetWindowHandle() OVERRIDE; + virtual CefWindowHandle GetOpenerWindowHandle() OVERRIDE; + virtual CefRefPtr GetClient() OVERRIDE; + virtual CefRefPtr GetRequestContext() OVERRIDE; + virtual double GetZoomLevel() OVERRIDE; + virtual void SetZoomLevel(double zoomLevel) OVERRIDE; + virtual void RunFileDialog(FileDialogMode mode, const CefString& title, + const CefString& default_file_name, + const std::vector& accept_types, + CefRefPtr callback) OVERRIDE; + virtual void StartDownload(const CefString& url) OVERRIDE; + virtual void Print() OVERRIDE; + virtual void Find(int identifier, const CefString& searchText, bool forward, + bool matchCase, bool findNext) OVERRIDE; + virtual void StopFinding(bool clearSelection) OVERRIDE; + virtual void ShowDevTools(const CefWindowInfo& windowInfo, + CefRefPtr client, const CefBrowserSettings& settings, + const CefPoint& inspect_element_at) OVERRIDE; + virtual void CloseDevTools() OVERRIDE; + virtual void GetNavigationEntries( + CefRefPtr visitor, + bool current_only) OVERRIDE; + virtual void SetMouseCursorChangeDisabled(bool disabled) OVERRIDE; + virtual bool IsMouseCursorChangeDisabled() OVERRIDE; + virtual void ReplaceMisspelling(const CefString& word) OVERRIDE; + virtual void AddWordToDictionary(const CefString& word) OVERRIDE; + virtual bool IsWindowRenderingDisabled() OVERRIDE; + virtual void WasResized() OVERRIDE; + virtual void WasHidden(bool hidden) OVERRIDE; + virtual void NotifyScreenInfoChanged() OVERRIDE; + virtual void Invalidate(PaintElementType type) OVERRIDE; + virtual void SendKeyEvent(const CefKeyEvent& event) OVERRIDE; + virtual void SendMouseClickEvent(const CefMouseEvent& event, + MouseButtonType type, bool mouseUp, int clickCount) OVERRIDE; + virtual void SendMouseMoveEvent(const CefMouseEvent& event, + bool mouseLeave) OVERRIDE; + virtual void SendMouseWheelEvent(const CefMouseEvent& event, int deltaX, + int deltaY) OVERRIDE; + virtual void SendFocusEvent(bool setFocus) OVERRIDE; + virtual void SendCaptureLostEvent() OVERRIDE; + virtual void NotifyMoveOrResizeStarted() OVERRIDE; + virtual CefTextInputContext GetNSTextInputContext() OVERRIDE; + virtual void HandleKeyEventBeforeTextInputClient( + CefEventHandle keyEvent) OVERRIDE; + virtual void HandleKeyEventAfterTextInputClient( + CefEventHandle keyEvent) OVERRIDE; + virtual void DragTargetDragEnter(CefRefPtr drag_data, + const CefMouseEvent& event, DragOperationsMask allowed_ops) OVERRIDE; + virtual void DragTargetDragOver(const CefMouseEvent& event, + DragOperationsMask allowed_ops) OVERRIDE; + virtual void DragTargetDragLeave() OVERRIDE; + virtual void DragTargetDrop(const CefMouseEvent& event) OVERRIDE; + virtual void DragSourceEndedAt(int x, int y, DragOperationsMask op) OVERRIDE; + virtual void DragSourceSystemDragEnded() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/callback_ctocpp.cc new file mode 100644 index 00000000000..7fe0daab58a --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/callback_ctocpp.cc @@ -0,0 +1,43 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefCallbackCToCpp::Continue() { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cont(struct_); +} + +void CefCallbackCToCpp::Cancel() { + if (CEF_MEMBER_MISSING(struct_, cancel)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cancel(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/callback_ctocpp.h new file mode 100644 index 00000000000..ade67876ccc --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/callback_ctocpp.h @@ -0,0 +1,41 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_callback.h" +#include "include/capi/cef_callback_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefCallbackCToCpp + : public CefCToCpp { + public: + explicit CefCallbackCToCpp(cef_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefCallbackCToCpp() {} + + // CefCallback methods + virtual void Continue() OVERRIDE; + virtual void Cancel() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/command_line_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/command_line_ctocpp.cc new file mode 100644 index 00000000000..f08030da348 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/command_line_ctocpp.cc @@ -0,0 +1,398 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "include/cef_version.h" +#include "libcef_dll/ctocpp/command_line_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefCommandLine::CreateCommandLine() { + const char* api_hash = cef_api_hash(0); + if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) { + // The libcef API hash does not match the current header API hash. + NOTREACHED(); + return NULL; + } + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_command_line_t* _retval = cef_command_line_create(); + + // Return type: refptr_same + return CefCommandLineCToCpp::Wrap(_retval); +} + +CefRefPtr CefCommandLine::GetGlobalCommandLine() { + const char* api_hash = cef_api_hash(0); + if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) { + // The libcef API hash does not match the current header API hash. + NOTREACHED(); + return NULL; + } + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_command_line_t* _retval = cef_command_line_get_global(); + + // Return type: refptr_same + return CefCommandLineCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefCommandLineCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefCommandLineCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefCommandLineCToCpp::Copy() { + if (CEF_MEMBER_MISSING(struct_, copy)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_command_line_t* _retval = struct_->copy(struct_); + + // Return type: refptr_same + return CefCommandLineCToCpp::Wrap(_retval); +} + +void CefCommandLineCToCpp::InitFromArgv(int argc, const char* const* argv) { + if (CEF_MEMBER_MISSING(struct_, init_from_argv)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: argv; type: simple_byaddr + DCHECK(argv); + if (!argv) + return; + + // Execute + struct_->init_from_argv(struct_, + argc, + argv); +} + +void CefCommandLineCToCpp::InitFromString(const CefString& command_line) { + if (CEF_MEMBER_MISSING(struct_, init_from_string)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: command_line; type: string_byref_const + DCHECK(!command_line.empty()); + if (command_line.empty()) + return; + + // Execute + struct_->init_from_string(struct_, + command_line.GetStruct()); +} + +void CefCommandLineCToCpp::Reset() { + if (CEF_MEMBER_MISSING(struct_, reset)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->reset(struct_); +} + +void CefCommandLineCToCpp::GetArgv(std::vector& argv) { + if (CEF_MEMBER_MISSING(struct_, get_argv)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: argv; type: string_vec_byref + cef_string_list_t argvList = cef_string_list_alloc(); + DCHECK(argvList); + if (argvList) + transfer_string_list_contents(argv, argvList); + + // Execute + struct_->get_argv(struct_, + argvList); + + // Restore param:argv; type: string_vec_byref + if (argvList) { + argv.clear(); + transfer_string_list_contents(argvList, argv); + cef_string_list_free(argvList); + } +} + +CefString CefCommandLineCToCpp::GetCommandLineString() { + if (CEF_MEMBER_MISSING(struct_, get_command_line_string)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_command_line_string(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefCommandLineCToCpp::GetProgram() { + if (CEF_MEMBER_MISSING(struct_, get_program)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_program(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefCommandLineCToCpp::SetProgram(const CefString& program) { + if (CEF_MEMBER_MISSING(struct_, set_program)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: program; type: string_byref_const + DCHECK(!program.empty()); + if (program.empty()) + return; + + // Execute + struct_->set_program(struct_, + program.GetStruct()); +} + +bool CefCommandLineCToCpp::HasSwitches() { + if (CEF_MEMBER_MISSING(struct_, has_switches)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_switches(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefCommandLineCToCpp::HasSwitch(const CefString& name) { + if (CEF_MEMBER_MISSING(struct_, has_switch)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return false; + + // Execute + int _retval = struct_->has_switch(struct_, + name.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +CefString CefCommandLineCToCpp::GetSwitchValue(const CefString& name) { + if (CEF_MEMBER_MISSING(struct_, get_switch_value)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_switch_value(struct_, + name.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefCommandLineCToCpp::GetSwitches(SwitchMap& switches) { + if (CEF_MEMBER_MISSING(struct_, get_switches)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: switches; type: string_map_single_byref + cef_string_map_t switchesMap = cef_string_map_alloc(); + DCHECK(switchesMap); + if (switchesMap) + transfer_string_map_contents(switches, switchesMap); + + // Execute + struct_->get_switches(struct_, + switchesMap); + + // Restore param:switches; type: string_map_single_byref + if (switchesMap) { + switches.clear(); + transfer_string_map_contents(switchesMap, switches); + cef_string_map_free(switchesMap); + } +} + +void CefCommandLineCToCpp::AppendSwitch(const CefString& name) { + if (CEF_MEMBER_MISSING(struct_, append_switch)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return; + + // Execute + struct_->append_switch(struct_, + name.GetStruct()); +} + +void CefCommandLineCToCpp::AppendSwitchWithValue(const CefString& name, + const CefString& value) { + if (CEF_MEMBER_MISSING(struct_, append_switch_with_value)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return; + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return; + + // Execute + struct_->append_switch_with_value(struct_, + name.GetStruct(), + value.GetStruct()); +} + +bool CefCommandLineCToCpp::HasArguments() { + if (CEF_MEMBER_MISSING(struct_, has_arguments)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_arguments(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefCommandLineCToCpp::GetArguments(ArgumentList& arguments) { + if (CEF_MEMBER_MISSING(struct_, get_arguments)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: arguments; type: string_vec_byref + cef_string_list_t argumentsList = cef_string_list_alloc(); + DCHECK(argumentsList); + if (argumentsList) + transfer_string_list_contents(arguments, argumentsList); + + // Execute + struct_->get_arguments(struct_, + argumentsList); + + // Restore param:arguments; type: string_vec_byref + if (argumentsList) { + arguments.clear(); + transfer_string_list_contents(argumentsList, arguments); + cef_string_list_free(argumentsList); + } +} + +void CefCommandLineCToCpp::AppendArgument(const CefString& argument) { + if (CEF_MEMBER_MISSING(struct_, append_argument)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: argument; type: string_byref_const + DCHECK(!argument.empty()); + if (argument.empty()) + return; + + // Execute + struct_->append_argument(struct_, + argument.GetStruct()); +} + +void CefCommandLineCToCpp::PrependWrapper(const CefString& wrapper) { + if (CEF_MEMBER_MISSING(struct_, prepend_wrapper)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: wrapper; type: string_byref_const + DCHECK(!wrapper.empty()); + if (wrapper.empty()) + return; + + // Execute + struct_->prepend_wrapper(struct_, + wrapper.GetStruct()); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/command_line_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/command_line_ctocpp.h new file mode 100644 index 00000000000..b73bff9998a --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/command_line_ctocpp.h @@ -0,0 +1,63 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_command_line.h" +#include "include/capi/cef_command_line_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefCommandLineCToCpp + : public CefCToCpp { + public: + explicit CefCommandLineCToCpp(cef_command_line_t* str) + : CefCToCpp( + str) {} + virtual ~CefCommandLineCToCpp() {} + + // CefCommandLine methods + virtual bool IsValid() OVERRIDE; + virtual bool IsReadOnly() OVERRIDE; + virtual CefRefPtr Copy() OVERRIDE; + virtual void InitFromArgv(int argc, const char* const* argv) OVERRIDE; + virtual void InitFromString(const CefString& command_line) OVERRIDE; + virtual void Reset() OVERRIDE; + virtual void GetArgv(std::vector& argv) OVERRIDE; + virtual CefString GetCommandLineString() OVERRIDE; + virtual CefString GetProgram() OVERRIDE; + virtual void SetProgram(const CefString& program) OVERRIDE; + virtual bool HasSwitches() OVERRIDE; + virtual bool HasSwitch(const CefString& name) OVERRIDE; + virtual CefString GetSwitchValue(const CefString& name) OVERRIDE; + virtual void GetSwitches(SwitchMap& switches) OVERRIDE; + virtual void AppendSwitch(const CefString& name) OVERRIDE; + virtual void AppendSwitchWithValue(const CefString& name, + const CefString& value) OVERRIDE; + virtual bool HasArguments() OVERRIDE; + virtual void GetArguments(ArgumentList& arguments) OVERRIDE; + virtual void AppendArgument(const CefString& argument) OVERRIDE; + virtual void PrependWrapper(const CefString& wrapper) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_COMMAND_LINE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/context_menu_params_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/context_menu_params_ctocpp.cc new file mode 100644 index 00000000000..950869bcd06 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/context_menu_params_ctocpp.cc @@ -0,0 +1,306 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/context_menu_params_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +int CefContextMenuParamsCToCpp::GetXCoord() { + if (CEF_MEMBER_MISSING(struct_, get_xcoord)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_xcoord(struct_); + + // Return type: simple + return _retval; +} + +int CefContextMenuParamsCToCpp::GetYCoord() { + if (CEF_MEMBER_MISSING(struct_, get_ycoord)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_ycoord(struct_); + + // Return type: simple + return _retval; +} + +CefContextMenuParams::TypeFlags CefContextMenuParamsCToCpp::GetTypeFlags() { + if (CEF_MEMBER_MISSING(struct_, get_type_flags)) + return CM_TYPEFLAG_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_context_menu_type_flags_t _retval = struct_->get_type_flags(struct_); + + // Return type: simple + return _retval; +} + +CefString CefContextMenuParamsCToCpp::GetLinkUrl() { + if (CEF_MEMBER_MISSING(struct_, get_link_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_link_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefContextMenuParamsCToCpp::GetUnfilteredLinkUrl() { + if (CEF_MEMBER_MISSING(struct_, get_unfiltered_link_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_unfiltered_link_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefContextMenuParamsCToCpp::GetSourceUrl() { + if (CEF_MEMBER_MISSING(struct_, get_source_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_source_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefContextMenuParamsCToCpp::HasImageContents() { + if (CEF_MEMBER_MISSING(struct_, has_image_contents)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_image_contents(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefContextMenuParamsCToCpp::GetPageUrl() { + if (CEF_MEMBER_MISSING(struct_, get_page_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_page_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefContextMenuParamsCToCpp::GetFrameUrl() { + if (CEF_MEMBER_MISSING(struct_, get_frame_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_frame_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefContextMenuParamsCToCpp::GetFrameCharset() { + if (CEF_MEMBER_MISSING(struct_, get_frame_charset)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_frame_charset(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() { + if (CEF_MEMBER_MISSING(struct_, get_media_type)) + return CM_MEDIATYPE_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_context_menu_media_type_t _retval = struct_->get_media_type(struct_); + + // Return type: simple + return _retval; +} + +CefContextMenuParams::MediaStateFlags CefContextMenuParamsCToCpp::GetMediaStateFlags( + ) { + if (CEF_MEMBER_MISSING(struct_, get_media_state_flags)) + return CM_MEDIAFLAG_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_context_menu_media_state_flags_t _retval = struct_->get_media_state_flags( + struct_); + + // Return type: simple + return _retval; +} + +CefString CefContextMenuParamsCToCpp::GetSelectionText() { + if (CEF_MEMBER_MISSING(struct_, get_selection_text)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_selection_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefContextMenuParamsCToCpp::GetMisspelledWord() { + if (CEF_MEMBER_MISSING(struct_, get_misspelled_word)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_misspelled_word(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +int CefContextMenuParamsCToCpp::GetMisspellingHash() { + if (CEF_MEMBER_MISSING(struct_, get_misspelling_hash)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_misspelling_hash(struct_); + + // Return type: simple + return _retval; +} + +bool CefContextMenuParamsCToCpp::GetDictionarySuggestions( + std::vector& suggestions) { + if (CEF_MEMBER_MISSING(struct_, get_dictionary_suggestions)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: suggestions; type: string_vec_byref + cef_string_list_t suggestionsList = cef_string_list_alloc(); + DCHECK(suggestionsList); + if (suggestionsList) + transfer_string_list_contents(suggestions, suggestionsList); + + // Execute + int _retval = struct_->get_dictionary_suggestions(struct_, + suggestionsList); + + // Restore param:suggestions; type: string_vec_byref + if (suggestionsList) { + suggestions.clear(); + transfer_string_list_contents(suggestionsList, suggestions); + cef_string_list_free(suggestionsList); + } + + // Return type: bool + return _retval?true:false; +} + +bool CefContextMenuParamsCToCpp::IsEditable() { + if (CEF_MEMBER_MISSING(struct_, is_editable)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_editable(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() { + if (CEF_MEMBER_MISSING(struct_, is_spell_check_enabled)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_spell_check_enabled(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefContextMenuParams::EditStateFlags CefContextMenuParamsCToCpp::GetEditStateFlags( + ) { + if (CEF_MEMBER_MISSING(struct_, get_edit_state_flags)) + return CM_EDITFLAG_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_context_menu_edit_state_flags_t _retval = struct_->get_edit_state_flags( + struct_); + + // Return type: simple + return _retval; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/context_menu_params_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/context_menu_params_ctocpp.h new file mode 100644 index 00000000000..33b6481f6cc --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/context_menu_params_ctocpp.h @@ -0,0 +1,62 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_context_menu_handler.h" +#include "include/capi/cef_context_menu_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefContextMenuParamsCToCpp + : public CefCToCpp { + public: + explicit CefContextMenuParamsCToCpp(cef_context_menu_params_t* str) + : CefCToCpp(str) {} + virtual ~CefContextMenuParamsCToCpp() {} + + // CefContextMenuParams methods + virtual int GetXCoord() OVERRIDE; + virtual int GetYCoord() OVERRIDE; + virtual TypeFlags GetTypeFlags() OVERRIDE; + virtual CefString GetLinkUrl() OVERRIDE; + virtual CefString GetUnfilteredLinkUrl() OVERRIDE; + virtual CefString GetSourceUrl() OVERRIDE; + virtual bool HasImageContents() OVERRIDE; + virtual CefString GetPageUrl() OVERRIDE; + virtual CefString GetFrameUrl() OVERRIDE; + virtual CefString GetFrameCharset() OVERRIDE; + virtual MediaType GetMediaType() OVERRIDE; + virtual MediaStateFlags GetMediaStateFlags() OVERRIDE; + virtual CefString GetSelectionText() OVERRIDE; + virtual CefString GetMisspelledWord() OVERRIDE; + virtual int GetMisspellingHash() OVERRIDE; + virtual bool GetDictionarySuggestions( + std::vector& suggestions) OVERRIDE; + virtual bool IsEditable() OVERRIDE; + virtual bool IsSpellCheckEnabled() OVERRIDE; + virtual EditStateFlags GetEditStateFlags() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/cookie_manager_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/cookie_manager_ctocpp.cc new file mode 100644 index 00000000000..c081f606f03 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/cookie_manager_ctocpp.cc @@ -0,0 +1,199 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/completion_callback_cpptoc.h" +#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" +#include "libcef_dll/ctocpp/cookie_manager_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefCookieManager::GetGlobalManager() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_cookie_manager_t* _retval = cef_cookie_manager_get_global_manager(); + + // Return type: refptr_same + return CefCookieManagerCToCpp::Wrap(_retval); +} + +CefRefPtr CefCookieManager::CreateManager( + const CefString& path, bool persist_session_cookies) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: path + + // Execute + cef_cookie_manager_t* _retval = cef_cookie_manager_create_manager( + path.GetStruct(), + persist_session_cookies); + + // Return type: refptr_same + return CefCookieManagerCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefCookieManagerCToCpp::SetSupportedSchemes( + const std::vector& schemes) { + if (CEF_MEMBER_MISSING(struct_, set_supported_schemes)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: schemes; type: string_vec_byref_const + cef_string_list_t schemesList = cef_string_list_alloc(); + DCHECK(schemesList); + if (schemesList) + transfer_string_list_contents(schemes, schemesList); + + // Execute + struct_->set_supported_schemes(struct_, + schemesList); + + // Restore param:schemes; type: string_vec_byref_const + if (schemesList) + cef_string_list_free(schemesList); +} + +bool CefCookieManagerCToCpp::VisitAllCookies( + CefRefPtr visitor) { + if (CEF_MEMBER_MISSING(struct_, visit_all_cookies)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return false; + + // Execute + int _retval = struct_->visit_all_cookies(struct_, + CefCookieVisitorCppToC::Wrap(visitor)); + + // Return type: bool + return _retval?true:false; +} + +bool CefCookieManagerCToCpp::VisitUrlCookies(const CefString& url, + bool includeHttpOnly, CefRefPtr visitor) { + if (CEF_MEMBER_MISSING(struct_, visit_url_cookies)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return false; + + // Execute + int _retval = struct_->visit_url_cookies(struct_, + url.GetStruct(), + includeHttpOnly, + CefCookieVisitorCppToC::Wrap(visitor)); + + // Return type: bool + return _retval?true:false; +} + +bool CefCookieManagerCToCpp::SetCookie(const CefString& url, + const CefCookie& cookie) { + if (CEF_MEMBER_MISSING(struct_, set_cookie)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + + // Execute + int _retval = struct_->set_cookie(struct_, + url.GetStruct(), + &cookie); + + // Return type: bool + return _retval?true:false; +} + +bool CefCookieManagerCToCpp::DeleteCookies(const CefString& url, + const CefString& cookie_name) { + if (CEF_MEMBER_MISSING(struct_, delete_cookies)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: url, cookie_name + + // Execute + int _retval = struct_->delete_cookies(struct_, + url.GetStruct(), + cookie_name.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefCookieManagerCToCpp::SetStoragePath(const CefString& path, + bool persist_session_cookies) { + if (CEF_MEMBER_MISSING(struct_, set_storage_path)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: path + + // Execute + int _retval = struct_->set_storage_path(struct_, + path.GetStruct(), + persist_session_cookies); + + // Return type: bool + return _retval?true:false; +} + +bool CefCookieManagerCToCpp::FlushStore( + CefRefPtr callback) { + if (CEF_MEMBER_MISSING(struct_, flush_store)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: callback; type: refptr_diff + DCHECK(callback.get()); + if (!callback.get()) + return false; + + // Execute + int _retval = struct_->flush_store(struct_, + CefCompletionCallbackCppToC::Wrap(callback)); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/cookie_manager_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/cookie_manager_ctocpp.h new file mode 100644 index 00000000000..f6c2127c727 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/cookie_manager_ctocpp.h @@ -0,0 +1,54 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_cookie.h" +#include "include/capi/cef_cookie_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefCookieManagerCToCpp + : public CefCToCpp { + public: + explicit CefCookieManagerCToCpp(cef_cookie_manager_t* str) + : CefCToCpp(str) {} + virtual ~CefCookieManagerCToCpp() {} + + // CefCookieManager methods + virtual void SetSupportedSchemes( + const std::vector& schemes) OVERRIDE; + virtual bool VisitAllCookies(CefRefPtr visitor) OVERRIDE; + virtual bool VisitUrlCookies(const CefString& url, bool includeHttpOnly, + CefRefPtr visitor) OVERRIDE; + virtual bool SetCookie(const CefString& url, + const CefCookie& cookie) OVERRIDE; + virtual bool DeleteCookies(const CefString& url, + const CefString& cookie_name) OVERRIDE; + virtual bool SetStoragePath(const CefString& path, + bool persist_session_cookies) OVERRIDE; + virtual bool FlushStore(CefRefPtr callback) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_COOKIE_MANAGER_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/ctocpp.h new file mode 100644 index 00000000000..063fe1cfde8 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/ctocpp.h @@ -0,0 +1,117 @@ +// Copyright (c) 2009 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. + +#ifndef CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_ +#pragma once + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_base.h" +#include "include/capi/cef_base_capi.h" + +// Wrap a C structure with a C++ class. This is used when the implementation +// exists on the other side of the DLL boundary but will have methods called on +// this side of the DLL boundary. +template +class CefCToCpp : public BaseName { + public: + // Use this method to create a wrapper class instance for a structure + // received from the other side. + static CefRefPtr Wrap(StructName* s) { + if (!s) + return NULL; + + // Wrap their structure with the CefCToCpp object. + ClassName* wrapper = new ClassName(s); + // Put the wrapper object in a smart pointer. + CefRefPtr wrapperPtr(wrapper); + // Release the reference that was added to the CefCppToC wrapper object on + // the other side before their structure was passed to us. + wrapper->UnderlyingRelease(); + // Return the smart pointer. + return wrapperPtr; + } + + // Use this method to retrieve the underlying structure from a wrapper class + // instance for return back to the other side. + static StructName* Unwrap(CefRefPtr c) { + if (!c.get()) + return NULL; + + // Cast the object to our wrapper class type. + ClassName* wrapper = static_cast(c.get()); + // Add a reference to the CefCppToC wrapper object on the other side that + // will be released once the structure is received. + wrapper->UnderlyingAddRef(); + // Return their original structure. + return wrapper->GetStruct(); + } + + explicit CefCToCpp(StructName* str) + : struct_(str) { + DCHECK(str); + +#ifndef NDEBUG + base::AtomicRefCountInc(&DebugObjCt); +#endif + } + virtual ~CefCToCpp() { +#ifndef NDEBUG + base::AtomicRefCountDec(&DebugObjCt); +#endif + } + + // If returning the structure across the DLL boundary you should call + // UnderlyingAddRef() on this wrapping CefCToCpp object. On the other side of + // the DLL boundary, call Release() on the CefCppToC object. + StructName* GetStruct() { return struct_; } + + // CefBase methods increment/decrement reference counts on both this object + // and the underlying wrapped structure. + void AddRef() const { + UnderlyingAddRef(); + ref_count_.AddRef(); + } + bool Release() const { + UnderlyingRelease(); + if (ref_count_.Release()) { + delete this; + return true; + } + return false; + } + bool HasOneRef() const { return ref_count_.HasOneRef(); } + + // Increment/decrement reference counts on only the underlying class. + void UnderlyingAddRef() const { + if (struct_->base.add_ref) + struct_->base.add_ref(&struct_->base); + } + bool UnderlyingRelease() const { + if (!struct_->base.release) + return false; + return struct_->base.release(&struct_->base) ? true : false; + } + bool UnderlyingHasOneRef() const { + if (!struct_->base.has_one_ref) + return false; + return struct_->base.has_one_ref(&struct_->base) ? true : false; + } + +#ifndef NDEBUG + // Simple tracking of allocated objects. + static base::AtomicRefCount DebugObjCt; // NOLINT(runtime/int) +#endif + + protected: + StructName* struct_; + + private: + CefRefCount ref_count_; + + DISALLOW_COPY_AND_ASSIGN(CefCToCpp); +}; + +#endif // CEF_LIBCEF_DLL_CTOCPP_CTOCPP_H_ diff --git a/vendor/cef3/libcef_dll/ctocpp/dictionary_value_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/dictionary_value_ctocpp.cc new file mode 100644 index 00000000000..25401a289cd --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/dictionary_value_ctocpp.cc @@ -0,0 +1,517 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/binary_value_ctocpp.h" +#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" +#include "libcef_dll/ctocpp/list_value_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefDictionaryValue::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dictionary_value_t* _retval = cef_dictionary_value_create(); + + // Return type: refptr_same + return CefDictionaryValueCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefDictionaryValueCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::IsOwned() { + if (CEF_MEMBER_MISSING(struct_, is_owned)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_owned(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefDictionaryValueCToCpp::Copy( + bool exclude_empty_children) { + if (CEF_MEMBER_MISSING(struct_, copy)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dictionary_value_t* _retval = struct_->copy(struct_, + exclude_empty_children); + + // Return type: refptr_same + return CefDictionaryValueCToCpp::Wrap(_retval); +} + +size_t CefDictionaryValueCToCpp::GetSize() { + if (CEF_MEMBER_MISSING(struct_, get_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_size(struct_); + + // Return type: simple + return _retval; +} + +bool CefDictionaryValueCToCpp::Clear() { + if (CEF_MEMBER_MISSING(struct_, clear)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->clear(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::HasKey(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, has_key)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->has_key(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::GetKeys(KeyList& keys) { + if (CEF_MEMBER_MISSING(struct_, get_keys)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: keys; type: string_vec_byref + cef_string_list_t keysList = cef_string_list_alloc(); + DCHECK(keysList); + if (keysList) + transfer_string_list_contents(keys, keysList); + + // Execute + int _retval = struct_->get_keys(struct_, + keysList); + + // Restore param:keys; type: string_vec_byref + if (keysList) { + keys.clear(); + transfer_string_list_contents(keysList, keys); + cef_string_list_free(keysList); + } + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::Remove(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, remove)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->remove(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +CefValueType CefDictionaryValueCToCpp::GetType(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_type)) + return VTYPE_INVALID; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return VTYPE_INVALID; + + // Execute + cef_value_type_t _retval = struct_->get_type(struct_, + key.GetStruct()); + + // Return type: simple + return _retval; +} + +bool CefDictionaryValueCToCpp::GetBool(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_bool)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->get_bool(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +int CefDictionaryValueCToCpp::GetInt(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_int)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return 0; + + // Execute + int _retval = struct_->get_int(struct_, + key.GetStruct()); + + // Return type: simple + return _retval; +} + +double CefDictionaryValueCToCpp::GetDouble(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_double)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return 0; + + // Execute + double _retval = struct_->get_double(struct_, + key.GetStruct()); + + // Return type: simple + return _retval; +} + +CefString CefDictionaryValueCToCpp::GetString(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_string)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_string(struct_, + key.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefRefPtr CefDictionaryValueCToCpp::GetBinary( + const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_binary)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return NULL; + + // Execute + cef_binary_value_t* _retval = struct_->get_binary(struct_, + key.GetStruct()); + + // Return type: refptr_same + return CefBinaryValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefDictionaryValueCToCpp::GetDictionary( + const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_dictionary)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return NULL; + + // Execute + cef_dictionary_value_t* _retval = struct_->get_dictionary(struct_, + key.GetStruct()); + + // Return type: refptr_same + return CefDictionaryValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefDictionaryValueCToCpp::GetList( + const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_list)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return NULL; + + // Execute + cef_list_value_t* _retval = struct_->get_list(struct_, + key.GetStruct()); + + // Return type: refptr_same + return CefListValueCToCpp::Wrap(_retval); +} + +bool CefDictionaryValueCToCpp::SetNull(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, set_null)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->set_null(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::SetBool(const CefString& key, bool value) { + if (CEF_MEMBER_MISSING(struct_, set_bool)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->set_bool(struct_, + key.GetStruct(), + value); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::SetInt(const CefString& key, int value) { + if (CEF_MEMBER_MISSING(struct_, set_int)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->set_int(struct_, + key.GetStruct(), + value); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::SetDouble(const CefString& key, double value) { + if (CEF_MEMBER_MISSING(struct_, set_double)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + + // Execute + int _retval = struct_->set_double(struct_, + key.GetStruct(), + value); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::SetString(const CefString& key, + const CefString& value) { + if (CEF_MEMBER_MISSING(struct_, set_string)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + // Unverified params: value + + // Execute + int _retval = struct_->set_string(struct_, + key.GetStruct(), + value.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::SetBinary(const CefString& key, + CefRefPtr value) { + if (CEF_MEMBER_MISSING(struct_, set_binary)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set_binary(struct_, + key.GetStruct(), + CefBinaryValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::SetDictionary(const CefString& key, + CefRefPtr value) { + if (CEF_MEMBER_MISSING(struct_, set_dictionary)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set_dictionary(struct_, + key.GetStruct(), + CefDictionaryValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; +} + +bool CefDictionaryValueCToCpp::SetList(const CefString& key, + CefRefPtr value) { + if (CEF_MEMBER_MISSING(struct_, set_list)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: key; type: string_byref_const + DCHECK(!key.empty()); + if (key.empty()) + return false; + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set_list(struct_, + key.GetStruct(), + CefListValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/dictionary_value_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/dictionary_value_ctocpp.h new file mode 100644 index 00000000000..6d7b7e48639 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/dictionary_value_ctocpp.h @@ -0,0 +1,71 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_values.h" +#include "include/capi/cef_values_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefDictionaryValueCToCpp + : public CefCToCpp { + public: + explicit CefDictionaryValueCToCpp(cef_dictionary_value_t* str) + : CefCToCpp(str) {} + virtual ~CefDictionaryValueCToCpp() {} + + // CefDictionaryValue methods + virtual bool IsValid() OVERRIDE; + virtual bool IsOwned() OVERRIDE; + virtual bool IsReadOnly() OVERRIDE; + virtual CefRefPtr Copy( + bool exclude_empty_children) OVERRIDE; + virtual size_t GetSize() OVERRIDE; + virtual bool Clear() OVERRIDE; + virtual bool HasKey(const CefString& key) OVERRIDE; + virtual bool GetKeys(KeyList& keys) OVERRIDE; + virtual bool Remove(const CefString& key) OVERRIDE; + virtual CefValueType GetType(const CefString& key) OVERRIDE; + virtual bool GetBool(const CefString& key) OVERRIDE; + virtual int GetInt(const CefString& key) OVERRIDE; + virtual double GetDouble(const CefString& key) OVERRIDE; + virtual CefString GetString(const CefString& key) OVERRIDE; + virtual CefRefPtr GetBinary(const CefString& key) OVERRIDE; + virtual CefRefPtr GetDictionary( + const CefString& key) OVERRIDE; + virtual CefRefPtr GetList(const CefString& key) OVERRIDE; + virtual bool SetNull(const CefString& key) OVERRIDE; + virtual bool SetBool(const CefString& key, bool value) OVERRIDE; + virtual bool SetInt(const CefString& key, int value) OVERRIDE; + virtual bool SetDouble(const CefString& key, double value) OVERRIDE; + virtual bool SetString(const CefString& key, const CefString& value) OVERRIDE; + virtual bool SetBinary(const CefString& key, + CefRefPtr value) OVERRIDE; + virtual bool SetDictionary(const CefString& key, + CefRefPtr value) OVERRIDE; + virtual bool SetList(const CefString& key, + CefRefPtr value) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DICTIONARY_VALUE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/domdocument_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/domdocument_ctocpp.cc new file mode 100644 index 00000000000..a8755c9c674 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/domdocument_ctocpp.cc @@ -0,0 +1,255 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/domdocument_ctocpp.h" +#include "libcef_dll/ctocpp/domnode_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() { + if (CEF_MEMBER_MISSING(struct_, get_type)) + return DOM_DOCUMENT_TYPE_UNKNOWN; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dom_document_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; +} + +CefRefPtr CefDOMDocumentCToCpp::GetDocument() { + if (CEF_MEMBER_MISSING(struct_, get_document)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_document(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefRefPtr CefDOMDocumentCToCpp::GetBody() { + if (CEF_MEMBER_MISSING(struct_, get_body)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_body(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefRefPtr CefDOMDocumentCToCpp::GetHead() { + if (CEF_MEMBER_MISSING(struct_, get_head)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_head(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefString CefDOMDocumentCToCpp::GetTitle() { + if (CEF_MEMBER_MISSING(struct_, get_title)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_title(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefRefPtr CefDOMDocumentCToCpp::GetElementById( + const CefString& id) { + if (CEF_MEMBER_MISSING(struct_, get_element_by_id)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: id; type: string_byref_const + DCHECK(!id.empty()); + if (id.empty()) + return NULL; + + // Execute + cef_domnode_t* _retval = struct_->get_element_by_id(struct_, + id.GetStruct()); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefRefPtr CefDOMDocumentCToCpp::GetFocusedNode() { + if (CEF_MEMBER_MISSING(struct_, get_focused_node)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_focused_node(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +bool CefDOMDocumentCToCpp::HasSelection() { + if (CEF_MEMBER_MISSING(struct_, has_selection)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_selection(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefDOMDocumentCToCpp::GetSelectionStartNode() { + if (CEF_MEMBER_MISSING(struct_, get_selection_start_node)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_selection_start_node(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +int CefDOMDocumentCToCpp::GetSelectionStartOffset() { + if (CEF_MEMBER_MISSING(struct_, get_selection_start_offset)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_selection_start_offset(struct_); + + // Return type: simple + return _retval; +} + +CefRefPtr CefDOMDocumentCToCpp::GetSelectionEndNode() { + if (CEF_MEMBER_MISSING(struct_, get_selection_end_node)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_selection_end_node(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +int CefDOMDocumentCToCpp::GetSelectionEndOffset() { + if (CEF_MEMBER_MISSING(struct_, get_selection_end_offset)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_selection_end_offset(struct_); + + // Return type: simple + return _retval; +} + +CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() { + if (CEF_MEMBER_MISSING(struct_, get_selection_as_markup)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_selection_as_markup(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDOMDocumentCToCpp::GetSelectionAsText() { + if (CEF_MEMBER_MISSING(struct_, get_selection_as_text)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_selection_as_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDOMDocumentCToCpp::GetBaseURL() { + if (CEF_MEMBER_MISSING(struct_, get_base_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_base_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) { + if (CEF_MEMBER_MISSING(struct_, get_complete_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: partialURL; type: string_byref_const + DCHECK(!partialURL.empty()); + if (partialURL.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_complete_url(struct_, + partialURL.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/domdocument_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/domdocument_ctocpp.h new file mode 100644 index 00000000000..b69afb549d0 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/domdocument_ctocpp.h @@ -0,0 +1,57 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefDOMDocumentCToCpp + : public CefCToCpp { + public: + explicit CefDOMDocumentCToCpp(cef_domdocument_t* str) + : CefCToCpp( + str) {} + virtual ~CefDOMDocumentCToCpp() {} + + // CefDOMDocument methods + virtual Type GetType() OVERRIDE; + virtual CefRefPtr GetDocument() OVERRIDE; + virtual CefRefPtr GetBody() OVERRIDE; + virtual CefRefPtr GetHead() OVERRIDE; + virtual CefString GetTitle() OVERRIDE; + virtual CefRefPtr GetElementById(const CefString& id) OVERRIDE; + virtual CefRefPtr GetFocusedNode() OVERRIDE; + virtual bool HasSelection() OVERRIDE; + virtual CefRefPtr GetSelectionStartNode() OVERRIDE; + virtual int GetSelectionStartOffset() OVERRIDE; + virtual CefRefPtr GetSelectionEndNode() OVERRIDE; + virtual int GetSelectionEndOffset() OVERRIDE; + virtual CefString GetSelectionAsMarkup() OVERRIDE; + virtual CefString GetSelectionAsText() OVERRIDE; + virtual CefString GetBaseURL() OVERRIDE; + virtual CefString GetCompleteURL(const CefString& partialURL) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/domnode_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/domnode_ctocpp.cc new file mode 100644 index 00000000000..79e4fb7a93a --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/domnode_ctocpp.cc @@ -0,0 +1,412 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/domdocument_ctocpp.h" +#include "libcef_dll/ctocpp/domnode_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefDOMNode::Type CefDOMNodeCToCpp::GetType() { + if (CEF_MEMBER_MISSING(struct_, get_type)) + return DOM_NODE_TYPE_UNSUPPORTED; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_dom_node_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; +} + +bool CefDOMNodeCToCpp::IsText() { + if (CEF_MEMBER_MISSING(struct_, is_text)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_text(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDOMNodeCToCpp::IsElement() { + if (CEF_MEMBER_MISSING(struct_, is_element)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_element(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDOMNodeCToCpp::IsEditable() { + if (CEF_MEMBER_MISSING(struct_, is_editable)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_editable(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDOMNodeCToCpp::IsFormControlElement() { + if (CEF_MEMBER_MISSING(struct_, is_form_control_element)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_form_control_element(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefDOMNodeCToCpp::GetFormControlElementType() { + if (CEF_MEMBER_MISSING(struct_, get_form_control_element_type)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_form_control_element_type( + struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefDOMNodeCToCpp::IsSame(CefRefPtr that) { + if (CEF_MEMBER_MISSING(struct_, is_same)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefDOMNodeCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; +} + +CefString CefDOMNodeCToCpp::GetName() { + if (CEF_MEMBER_MISSING(struct_, get_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDOMNodeCToCpp::GetValue() { + if (CEF_MEMBER_MISSING(struct_, get_value)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_value(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefDOMNodeCToCpp::SetValue(const CefString& value) { + if (CEF_MEMBER_MISSING(struct_, set_value)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return false; + + // Execute + int _retval = struct_->set_value(struct_, + value.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +CefString CefDOMNodeCToCpp::GetAsMarkup() { + if (CEF_MEMBER_MISSING(struct_, get_as_markup)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_as_markup(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefRefPtr CefDOMNodeCToCpp::GetDocument() { + if (CEF_MEMBER_MISSING(struct_, get_document)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domdocument_t* _retval = struct_->get_document(struct_); + + // Return type: refptr_same + return CefDOMDocumentCToCpp::Wrap(_retval); +} + +CefRefPtr CefDOMNodeCToCpp::GetParent() { + if (CEF_MEMBER_MISSING(struct_, get_parent)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_parent(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefRefPtr CefDOMNodeCToCpp::GetPreviousSibling() { + if (CEF_MEMBER_MISSING(struct_, get_previous_sibling)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_previous_sibling(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefRefPtr CefDOMNodeCToCpp::GetNextSibling() { + if (CEF_MEMBER_MISSING(struct_, get_next_sibling)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_next_sibling(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +bool CefDOMNodeCToCpp::HasChildren() { + if (CEF_MEMBER_MISSING(struct_, has_children)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_children(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefDOMNodeCToCpp::GetFirstChild() { + if (CEF_MEMBER_MISSING(struct_, get_first_child)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_first_child(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefRefPtr CefDOMNodeCToCpp::GetLastChild() { + if (CEF_MEMBER_MISSING(struct_, get_last_child)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_domnode_t* _retval = struct_->get_last_child(struct_); + + // Return type: refptr_same + return CefDOMNodeCToCpp::Wrap(_retval); +} + +CefString CefDOMNodeCToCpp::GetElementTagName() { + if (CEF_MEMBER_MISSING(struct_, get_element_tag_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_element_tag_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefDOMNodeCToCpp::HasElementAttributes() { + if (CEF_MEMBER_MISSING(struct_, has_element_attributes)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_element_attributes(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) { + if (CEF_MEMBER_MISSING(struct_, has_element_attribute)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: attrName; type: string_byref_const + DCHECK(!attrName.empty()); + if (attrName.empty()) + return false; + + // Execute + int _retval = struct_->has_element_attribute(struct_, + attrName.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) { + if (CEF_MEMBER_MISSING(struct_, get_element_attribute)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: attrName; type: string_byref_const + DCHECK(!attrName.empty()); + if (attrName.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_element_attribute(struct_, + attrName.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) { + if (CEF_MEMBER_MISSING(struct_, get_element_attributes)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: attrMap; type: string_map_single_byref + cef_string_map_t attrMapMap = cef_string_map_alloc(); + DCHECK(attrMapMap); + if (attrMapMap) + transfer_string_map_contents(attrMap, attrMapMap); + + // Execute + struct_->get_element_attributes(struct_, + attrMapMap); + + // Restore param:attrMap; type: string_map_single_byref + if (attrMapMap) { + attrMap.clear(); + transfer_string_map_contents(attrMapMap, attrMap); + cef_string_map_free(attrMapMap); + } +} + +bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName, + const CefString& value) { + if (CEF_MEMBER_MISSING(struct_, set_element_attribute)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: attrName; type: string_byref_const + DCHECK(!attrName.empty()); + if (attrName.empty()) + return false; + // Verify param: value; type: string_byref_const + DCHECK(!value.empty()); + if (value.empty()) + return false; + + // Execute + int _retval = struct_->set_element_attribute(struct_, + attrName.GetStruct(), + value.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +CefString CefDOMNodeCToCpp::GetElementInnerText() { + if (CEF_MEMBER_MISSING(struct_, get_element_inner_text)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_element_inner_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/domnode_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/domnode_ctocpp.h new file mode 100644 index 00000000000..dd0365bd177 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/domnode_ctocpp.h @@ -0,0 +1,65 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_dom.h" +#include "include/capi/cef_dom_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefDOMNodeCToCpp + : public CefCToCpp { + public: + explicit CefDOMNodeCToCpp(cef_domnode_t* str) + : CefCToCpp(str) {} + virtual ~CefDOMNodeCToCpp() {} + + // CefDOMNode methods + virtual Type GetType() OVERRIDE; + virtual bool IsText() OVERRIDE; + virtual bool IsElement() OVERRIDE; + virtual bool IsEditable() OVERRIDE; + virtual bool IsFormControlElement() OVERRIDE; + virtual CefString GetFormControlElementType() OVERRIDE; + virtual bool IsSame(CefRefPtr that) OVERRIDE; + virtual CefString GetName() OVERRIDE; + virtual CefString GetValue() OVERRIDE; + virtual bool SetValue(const CefString& value) OVERRIDE; + virtual CefString GetAsMarkup() OVERRIDE; + virtual CefRefPtr GetDocument() OVERRIDE; + virtual CefRefPtr GetParent() OVERRIDE; + virtual CefRefPtr GetPreviousSibling() OVERRIDE; + virtual CefRefPtr GetNextSibling() OVERRIDE; + virtual bool HasChildren() OVERRIDE; + virtual CefRefPtr GetFirstChild() OVERRIDE; + virtual CefRefPtr GetLastChild() OVERRIDE; + virtual CefString GetElementTagName() OVERRIDE; + virtual bool HasElementAttributes() OVERRIDE; + virtual bool HasElementAttribute(const CefString& attrName) OVERRIDE; + virtual CefString GetElementAttribute(const CefString& attrName) OVERRIDE; + virtual void GetElementAttributes(AttributeMap& attrMap) OVERRIDE; + virtual bool SetElementAttribute(const CefString& attrName, + const CefString& value) OVERRIDE; + virtual CefString GetElementInnerText() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/download_item_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/download_item_callback_ctocpp.cc new file mode 100644 index 00000000000..537b5740dd1 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/download_item_callback_ctocpp.cc @@ -0,0 +1,33 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefDownloadItemCallbackCToCpp::Cancel() { + if (CEF_MEMBER_MISSING(struct_, cancel)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cancel(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/download_item_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/download_item_callback_ctocpp.h new file mode 100644 index 00000000000..706048dba48 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/download_item_callback_ctocpp.h @@ -0,0 +1,42 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_download_handler.h" +#include "include/capi/cef_download_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefDownloadItemCallbackCToCpp + : public CefCToCpp { + public: + explicit CefDownloadItemCallbackCToCpp(cef_download_item_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefDownloadItemCallbackCToCpp() {} + + // CefDownloadItemCallback methods + virtual void Cancel() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/download_item_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/download_item_ctocpp.cc new file mode 100644 index 00000000000..406a0ab43ca --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/download_item_ctocpp.cc @@ -0,0 +1,241 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/download_item_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefDownloadItemCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDownloadItemCToCpp::IsInProgress() { + if (CEF_MEMBER_MISSING(struct_, is_in_progress)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_in_progress(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDownloadItemCToCpp::IsComplete() { + if (CEF_MEMBER_MISSING(struct_, is_complete)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_complete(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDownloadItemCToCpp::IsCanceled() { + if (CEF_MEMBER_MISSING(struct_, is_canceled)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_canceled(struct_); + + // Return type: bool + return _retval?true:false; +} + +int64 CefDownloadItemCToCpp::GetCurrentSpeed() { + if (CEF_MEMBER_MISSING(struct_, get_current_speed)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->get_current_speed(struct_); + + // Return type: simple + return _retval; +} + +int CefDownloadItemCToCpp::GetPercentComplete() { + if (CEF_MEMBER_MISSING(struct_, get_percent_complete)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_percent_complete(struct_); + + // Return type: simple + return _retval; +} + +int64 CefDownloadItemCToCpp::GetTotalBytes() { + if (CEF_MEMBER_MISSING(struct_, get_total_bytes)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->get_total_bytes(struct_); + + // Return type: simple + return _retval; +} + +int64 CefDownloadItemCToCpp::GetReceivedBytes() { + if (CEF_MEMBER_MISSING(struct_, get_received_bytes)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->get_received_bytes(struct_); + + // Return type: simple + return _retval; +} + +CefTime CefDownloadItemCToCpp::GetStartTime() { + if (CEF_MEMBER_MISSING(struct_, get_start_time)) + return CefTime(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_time_t _retval = struct_->get_start_time(struct_); + + // Return type: simple + return _retval; +} + +CefTime CefDownloadItemCToCpp::GetEndTime() { + if (CEF_MEMBER_MISSING(struct_, get_end_time)) + return CefTime(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_time_t _retval = struct_->get_end_time(struct_); + + // Return type: simple + return _retval; +} + +CefString CefDownloadItemCToCpp::GetFullPath() { + if (CEF_MEMBER_MISSING(struct_, get_full_path)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_full_path(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +uint32 CefDownloadItemCToCpp::GetId() { + if (CEF_MEMBER_MISSING(struct_, get_id)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + uint32 _retval = struct_->get_id(struct_); + + // Return type: simple + return _retval; +} + +CefString CefDownloadItemCToCpp::GetURL() { + if (CEF_MEMBER_MISSING(struct_, get_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDownloadItemCToCpp::GetSuggestedFileName() { + if (CEF_MEMBER_MISSING(struct_, get_suggested_file_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_suggested_file_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDownloadItemCToCpp::GetContentDisposition() { + if (CEF_MEMBER_MISSING(struct_, get_content_disposition)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_content_disposition(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDownloadItemCToCpp::GetMimeType() { + if (CEF_MEMBER_MISSING(struct_, get_mime_type)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_mime_type(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/download_item_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/download_item_ctocpp.h new file mode 100644 index 00000000000..77125f19738 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/download_item_ctocpp.h @@ -0,0 +1,57 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_download_item.h" +#include "include/capi/cef_download_item_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefDownloadItemCToCpp + : public CefCToCpp { + public: + explicit CefDownloadItemCToCpp(cef_download_item_t* str) + : CefCToCpp( + str) {} + virtual ~CefDownloadItemCToCpp() {} + + // CefDownloadItem methods + virtual bool IsValid() OVERRIDE; + virtual bool IsInProgress() OVERRIDE; + virtual bool IsComplete() OVERRIDE; + virtual bool IsCanceled() OVERRIDE; + virtual int64 GetCurrentSpeed() OVERRIDE; + virtual int GetPercentComplete() OVERRIDE; + virtual int64 GetTotalBytes() OVERRIDE; + virtual int64 GetReceivedBytes() OVERRIDE; + virtual CefTime GetStartTime() OVERRIDE; + virtual CefTime GetEndTime() OVERRIDE; + virtual CefString GetFullPath() OVERRIDE; + virtual uint32 GetId() OVERRIDE; + virtual CefString GetURL() OVERRIDE; + virtual CefString GetSuggestedFileName() OVERRIDE; + virtual CefString GetContentDisposition() OVERRIDE; + virtual CefString GetMimeType() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DOWNLOAD_ITEM_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/drag_data_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/drag_data_ctocpp.cc new file mode 100644 index 00000000000..a5f56d06a9b --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/drag_data_ctocpp.cc @@ -0,0 +1,358 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/drag_data_ctocpp.h" +#include "libcef_dll/ctocpp/stream_writer_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefDragData::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_drag_data_t* _retval = cef_drag_data_create(); + + // Return type: refptr_same + return CefDragDataCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefRefPtr CefDragDataCToCpp::Clone() { + if (CEF_MEMBER_MISSING(struct_, clone)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_drag_data_t* _retval = struct_->clone(struct_); + + // Return type: refptr_same + return CefDragDataCToCpp::Wrap(_retval); +} + +bool CefDragDataCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDragDataCToCpp::IsLink() { + if (CEF_MEMBER_MISSING(struct_, is_link)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_link(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDragDataCToCpp::IsFragment() { + if (CEF_MEMBER_MISSING(struct_, is_fragment)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_fragment(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefDragDataCToCpp::IsFile() { + if (CEF_MEMBER_MISSING(struct_, is_file)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_file(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefDragDataCToCpp::GetLinkURL() { + if (CEF_MEMBER_MISSING(struct_, get_link_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_link_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDragDataCToCpp::GetLinkTitle() { + if (CEF_MEMBER_MISSING(struct_, get_link_title)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_link_title(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDragDataCToCpp::GetLinkMetadata() { + if (CEF_MEMBER_MISSING(struct_, get_link_metadata)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_link_metadata(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDragDataCToCpp::GetFragmentText() { + if (CEF_MEMBER_MISSING(struct_, get_fragment_text)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_fragment_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDragDataCToCpp::GetFragmentHtml() { + if (CEF_MEMBER_MISSING(struct_, get_fragment_html)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_fragment_html(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDragDataCToCpp::GetFragmentBaseURL() { + if (CEF_MEMBER_MISSING(struct_, get_fragment_base_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_fragment_base_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefDragDataCToCpp::GetFileName() { + if (CEF_MEMBER_MISSING(struct_, get_file_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_file_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +size_t CefDragDataCToCpp::GetFileContents(CefRefPtr writer) { + if (CEF_MEMBER_MISSING(struct_, get_file_contents)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: writer + + // Execute + size_t _retval = struct_->get_file_contents(struct_, + CefStreamWriterCToCpp::Unwrap(writer)); + + // Return type: simple + return _retval; +} + +bool CefDragDataCToCpp::GetFileNames(std::vector& names) { + if (CEF_MEMBER_MISSING(struct_, get_file_names)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: names; type: string_vec_byref + cef_string_list_t namesList = cef_string_list_alloc(); + DCHECK(namesList); + if (namesList) + transfer_string_list_contents(names, namesList); + + // Execute + int _retval = struct_->get_file_names(struct_, + namesList); + + // Restore param:names; type: string_vec_byref + if (namesList) { + names.clear(); + transfer_string_list_contents(namesList, names); + cef_string_list_free(namesList); + } + + // Return type: bool + return _retval?true:false; +} + +void CefDragDataCToCpp::SetLinkURL(const CefString& url) { + if (CEF_MEMBER_MISSING(struct_, set_link_url)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: url + + // Execute + struct_->set_link_url(struct_, + url.GetStruct()); +} + +void CefDragDataCToCpp::SetLinkTitle(const CefString& title) { + if (CEF_MEMBER_MISSING(struct_, set_link_title)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: title + + // Execute + struct_->set_link_title(struct_, + title.GetStruct()); +} + +void CefDragDataCToCpp::SetLinkMetadata(const CefString& data) { + if (CEF_MEMBER_MISSING(struct_, set_link_metadata)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: data + + // Execute + struct_->set_link_metadata(struct_, + data.GetStruct()); +} + +void CefDragDataCToCpp::SetFragmentText(const CefString& text) { + if (CEF_MEMBER_MISSING(struct_, set_fragment_text)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: text + + // Execute + struct_->set_fragment_text(struct_, + text.GetStruct()); +} + +void CefDragDataCToCpp::SetFragmentHtml(const CefString& html) { + if (CEF_MEMBER_MISSING(struct_, set_fragment_html)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: html + + // Execute + struct_->set_fragment_html(struct_, + html.GetStruct()); +} + +void CefDragDataCToCpp::SetFragmentBaseURL(const CefString& base_url) { + if (CEF_MEMBER_MISSING(struct_, set_fragment_base_url)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: base_url + + // Execute + struct_->set_fragment_base_url(struct_, + base_url.GetStruct()); +} + +void CefDragDataCToCpp::ResetFileContents() { + if (CEF_MEMBER_MISSING(struct_, reset_file_contents)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->reset_file_contents(struct_); +} + +void CefDragDataCToCpp::AddFile(const CefString& path, + const CefString& display_name) { + if (CEF_MEMBER_MISSING(struct_, add_file)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: path; type: string_byref_const + DCHECK(!path.empty()); + if (path.empty()) + return; + // Unverified params: display_name + + // Execute + struct_->add_file(struct_, + path.GetStruct(), + display_name.GetStruct()); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/drag_data_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/drag_data_ctocpp.h new file mode 100644 index 00000000000..01be310ca20 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/drag_data_ctocpp.h @@ -0,0 +1,63 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_drag_data.h" +#include "include/capi/cef_drag_data_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefDragDataCToCpp + : public CefCToCpp { + public: + explicit CefDragDataCToCpp(cef_drag_data_t* str) + : CefCToCpp(str) {} + virtual ~CefDragDataCToCpp() {} + + // CefDragData methods + virtual CefRefPtr Clone() OVERRIDE; + virtual bool IsReadOnly() OVERRIDE; + virtual bool IsLink() OVERRIDE; + virtual bool IsFragment() OVERRIDE; + virtual bool IsFile() OVERRIDE; + virtual CefString GetLinkURL() OVERRIDE; + virtual CefString GetLinkTitle() OVERRIDE; + virtual CefString GetLinkMetadata() OVERRIDE; + virtual CefString GetFragmentText() OVERRIDE; + virtual CefString GetFragmentHtml() OVERRIDE; + virtual CefString GetFragmentBaseURL() OVERRIDE; + virtual CefString GetFileName() OVERRIDE; + virtual size_t GetFileContents(CefRefPtr writer) OVERRIDE; + virtual bool GetFileNames(std::vector& names) OVERRIDE; + virtual void SetLinkURL(const CefString& url) OVERRIDE; + virtual void SetLinkTitle(const CefString& title) OVERRIDE; + virtual void SetLinkMetadata(const CefString& data) OVERRIDE; + virtual void SetFragmentText(const CefString& text) OVERRIDE; + virtual void SetFragmentHtml(const CefString& html) OVERRIDE; + virtual void SetFragmentBaseURL(const CefString& base_url) OVERRIDE; + virtual void ResetFileContents() OVERRIDE; + virtual void AddFile(const CefString& path, + const CefString& display_name) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc new file mode 100644 index 00000000000..2b44f811061 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/file_dialog_callback_ctocpp.cc @@ -0,0 +1,56 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefFileDialogCallbackCToCpp::Continue( + const std::vector& file_paths) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: file_paths; type: string_vec_byref_const + cef_string_list_t file_pathsList = cef_string_list_alloc(); + DCHECK(file_pathsList); + if (file_pathsList) + transfer_string_list_contents(file_paths, file_pathsList); + + // Execute + struct_->cont(struct_, + file_pathsList); + + // Restore param:file_paths; type: string_vec_byref_const + if (file_pathsList) + cef_string_list_free(file_pathsList); +} + +void CefFileDialogCallbackCToCpp::Cancel() { + if (CEF_MEMBER_MISSING(struct_, cancel)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cancel(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h new file mode 100644 index 00000000000..b7c8695b634 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/file_dialog_callback_ctocpp.h @@ -0,0 +1,44 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_dialog_handler.h" +#include "include/capi/cef_dialog_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefFileDialogCallbackCToCpp + : public CefCToCpp { + public: + explicit CefFileDialogCallbackCToCpp(cef_file_dialog_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefFileDialogCallbackCToCpp() {} + + // CefFileDialogCallback methods + virtual void Continue(const std::vector& file_paths) OVERRIDE; + virtual void Cancel() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_FILE_DIALOG_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/frame_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/frame_ctocpp.cc new file mode 100644 index 00000000000..5996c119ad2 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/frame_ctocpp.cc @@ -0,0 +1,351 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/domvisitor_cpptoc.h" +#include "libcef_dll/cpptoc/string_visitor_cpptoc.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" +#include "libcef_dll/ctocpp/v8context_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefFrameCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefFrameCToCpp::Undo() { + if (CEF_MEMBER_MISSING(struct_, undo)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->undo(struct_); +} + +void CefFrameCToCpp::Redo() { + if (CEF_MEMBER_MISSING(struct_, redo)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->redo(struct_); +} + +void CefFrameCToCpp::Cut() { + if (CEF_MEMBER_MISSING(struct_, cut)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cut(struct_); +} + +void CefFrameCToCpp::Copy() { + if (CEF_MEMBER_MISSING(struct_, copy)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->copy(struct_); +} + +void CefFrameCToCpp::Paste() { + if (CEF_MEMBER_MISSING(struct_, paste)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->paste(struct_); +} + +void CefFrameCToCpp::Delete() { + if (CEF_MEMBER_MISSING(struct_, del)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->del(struct_); +} + +void CefFrameCToCpp::SelectAll() { + if (CEF_MEMBER_MISSING(struct_, select_all)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->select_all(struct_); +} + +void CefFrameCToCpp::ViewSource() { + if (CEF_MEMBER_MISSING(struct_, view_source)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->view_source(struct_); +} + +void CefFrameCToCpp::GetSource(CefRefPtr visitor) { + if (CEF_MEMBER_MISSING(struct_, get_source)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return; + + // Execute + struct_->get_source(struct_, + CefStringVisitorCppToC::Wrap(visitor)); +} + +void CefFrameCToCpp::GetText(CefRefPtr visitor) { + if (CEF_MEMBER_MISSING(struct_, get_text)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return; + + // Execute + struct_->get_text(struct_, + CefStringVisitorCppToC::Wrap(visitor)); +} + +void CefFrameCToCpp::LoadRequest(CefRefPtr request) { + if (CEF_MEMBER_MISSING(struct_, load_request)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: request; type: refptr_same + DCHECK(request.get()); + if (!request.get()) + return; + + // Execute + struct_->load_request(struct_, + CefRequestCToCpp::Unwrap(request)); +} + +void CefFrameCToCpp::LoadURL(const CefString& url) { + if (CEF_MEMBER_MISSING(struct_, load_url)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->load_url(struct_, + url.GetStruct()); +} + +void CefFrameCToCpp::LoadString(const CefString& string_val, + const CefString& url) { + if (CEF_MEMBER_MISSING(struct_, load_string)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: string_val; type: string_byref_const + DCHECK(!string_val.empty()); + if (string_val.empty()) + return; + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->load_string(struct_, + string_val.GetStruct(), + url.GetStruct()); +} + +void CefFrameCToCpp::ExecuteJavaScript(const CefString& code, + const CefString& script_url, int start_line) { + if (CEF_MEMBER_MISSING(struct_, execute_java_script)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: code; type: string_byref_const + DCHECK(!code.empty()); + if (code.empty()) + return; + // Unverified params: script_url + + // Execute + struct_->execute_java_script(struct_, + code.GetStruct(), + script_url.GetStruct(), + start_line); +} + +bool CefFrameCToCpp::IsMain() { + if (CEF_MEMBER_MISSING(struct_, is_main)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_main(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefFrameCToCpp::IsFocused() { + if (CEF_MEMBER_MISSING(struct_, is_focused)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_focused(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefFrameCToCpp::GetName() { + if (CEF_MEMBER_MISSING(struct_, get_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +int64 CefFrameCToCpp::GetIdentifier() { + if (CEF_MEMBER_MISSING(struct_, get_identifier)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->get_identifier(struct_); + + // Return type: simple + return _retval; +} + +CefRefPtr CefFrameCToCpp::GetParent() { + if (CEF_MEMBER_MISSING(struct_, get_parent)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_frame_t* _retval = struct_->get_parent(struct_); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); +} + +CefString CefFrameCToCpp::GetURL() { + if (CEF_MEMBER_MISSING(struct_, get_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefRefPtr CefFrameCToCpp::GetBrowser() { + if (CEF_MEMBER_MISSING(struct_, get_browser)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_browser_t* _retval = struct_->get_browser(struct_); + + // Return type: refptr_same + return CefBrowserCToCpp::Wrap(_retval); +} + +CefRefPtr CefFrameCToCpp::GetV8Context() { + if (CEF_MEMBER_MISSING(struct_, get_v8context)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8context_t* _retval = struct_->get_v8context(struct_); + + // Return type: refptr_same + return CefV8ContextCToCpp::Wrap(_retval); +} + +void CefFrameCToCpp::VisitDOM(CefRefPtr visitor) { + if (CEF_MEMBER_MISSING(struct_, visit_dom)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return; + + // Execute + struct_->visit_dom(struct_, + CefDOMVisitorCppToC::Wrap(visitor)); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/frame_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/frame_ctocpp.h new file mode 100644 index 00000000000..5285ad3476a --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/frame_ctocpp.h @@ -0,0 +1,69 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_frame.h" +#include "include/capi/cef_frame_capi.h" +#include "include/cef_browser.h" +#include "include/capi/cef_browser_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefFrameCToCpp + : public CefCToCpp { + public: + explicit CefFrameCToCpp(cef_frame_t* str) + : CefCToCpp(str) {} + virtual ~CefFrameCToCpp() {} + + // CefFrame methods + virtual bool IsValid() OVERRIDE; + virtual void Undo() OVERRIDE; + virtual void Redo() OVERRIDE; + virtual void Cut() OVERRIDE; + virtual void Copy() OVERRIDE; + virtual void Paste() OVERRIDE; + virtual void Delete() OVERRIDE; + virtual void SelectAll() OVERRIDE; + virtual void ViewSource() OVERRIDE; + virtual void GetSource(CefRefPtr visitor) OVERRIDE; + virtual void GetText(CefRefPtr visitor) OVERRIDE; + virtual void LoadRequest(CefRefPtr request) OVERRIDE; + virtual void LoadURL(const CefString& url) OVERRIDE; + virtual void LoadString(const CefString& string_val, + const CefString& url) OVERRIDE; + virtual void ExecuteJavaScript(const CefString& code, + const CefString& script_url, int start_line) OVERRIDE; + virtual bool IsMain() OVERRIDE; + virtual bool IsFocused() OVERRIDE; + virtual CefString GetName() OVERRIDE; + virtual int64 GetIdentifier() OVERRIDE; + virtual CefRefPtr GetParent() OVERRIDE; + virtual CefString GetURL() OVERRIDE; + virtual CefRefPtr GetBrowser() OVERRIDE; + virtual CefRefPtr GetV8Context() OVERRIDE; + virtual void VisitDOM(CefRefPtr visitor) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc new file mode 100644 index 00000000000..94218aecf83 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/geolocation_callback_ctocpp.cc @@ -0,0 +1,34 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefGeolocationCallbackCToCpp::Continue(bool allow) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cont(struct_, + allow); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/geolocation_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/geolocation_callback_ctocpp.h new file mode 100644 index 00000000000..42b25d08909 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/geolocation_callback_ctocpp.h @@ -0,0 +1,42 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_geolocation_handler.h" +#include "include/capi/cef_geolocation_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefGeolocationCallbackCToCpp + : public CefCToCpp { + public: + explicit CefGeolocationCallbackCToCpp(cef_geolocation_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefGeolocationCallbackCToCpp() {} + + // CefGeolocationCallback methods + virtual void Continue(bool allow) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_GEOLOCATION_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc new file mode 100644 index 00000000000..c0a6357cfed --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/jsdialog_callback_ctocpp.cc @@ -0,0 +1,38 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefJSDialogCallbackCToCpp::Continue(bool success, + const CefString& user_input) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: user_input + + // Execute + struct_->cont(struct_, + success, + user_input.GetStruct()); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h new file mode 100644 index 00000000000..fda751ad518 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/jsdialog_callback_ctocpp.h @@ -0,0 +1,42 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_jsdialog_handler.h" +#include "include/capi/cef_jsdialog_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefJSDialogCallbackCToCpp + : public CefCToCpp { + public: + explicit CefJSDialogCallbackCToCpp(cef_jsdialog_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefJSDialogCallbackCToCpp() {} + + // CefJSDialogCallback methods + virtual void Continue(bool success, const CefString& user_input) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_JSDIALOG_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/list_value_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/list_value_ctocpp.cc new file mode 100644 index 00000000000..7fe3e652977 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/list_value_ctocpp.cc @@ -0,0 +1,476 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/binary_value_ctocpp.h" +#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" +#include "libcef_dll/ctocpp/list_value_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefListValue::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_list_value_t* _retval = cef_list_value_create(); + + // Return type: refptr_same + return CefListValueCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefListValueCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::IsOwned() { + if (CEF_MEMBER_MISSING(struct_, is_owned)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_owned(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefListValueCToCpp::Copy() { + if (CEF_MEMBER_MISSING(struct_, copy)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_list_value_t* _retval = struct_->copy(struct_); + + // Return type: refptr_same + return CefListValueCToCpp::Wrap(_retval); +} + +bool CefListValueCToCpp::SetSize(size_t size) { + if (CEF_MEMBER_MISSING(struct_, set_size)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_size(struct_, + size); + + // Return type: bool + return _retval?true:false; +} + +size_t CefListValueCToCpp::GetSize() { + if (CEF_MEMBER_MISSING(struct_, get_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_size(struct_); + + // Return type: simple + return _retval; +} + +bool CefListValueCToCpp::Clear() { + if (CEF_MEMBER_MISSING(struct_, clear)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->clear(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::Remove(int index) { + if (CEF_MEMBER_MISSING(struct_, remove)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->remove(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +CefValueType CefListValueCToCpp::GetType(int index) { + if (CEF_MEMBER_MISSING(struct_, get_type)) + return VTYPE_INVALID; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return VTYPE_INVALID; + + // Execute + cef_value_type_t _retval = struct_->get_type(struct_, + index); + + // Return type: simple + return _retval; +} + +bool CefListValueCToCpp::GetBool(int index) { + if (CEF_MEMBER_MISSING(struct_, get_bool)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->get_bool(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +int CefListValueCToCpp::GetInt(int index) { + if (CEF_MEMBER_MISSING(struct_, get_int)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return 0; + + // Execute + int _retval = struct_->get_int(struct_, + index); + + // Return type: simple + return _retval; +} + +double CefListValueCToCpp::GetDouble(int index) { + if (CEF_MEMBER_MISSING(struct_, get_double)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return 0; + + // Execute + double _retval = struct_->get_double(struct_, + index); + + // Return type: simple + return _retval; +} + +CefString CefListValueCToCpp::GetString(int index) { + if (CEF_MEMBER_MISSING(struct_, get_string)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_string(struct_, + index); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefRefPtr CefListValueCToCpp::GetBinary(int index) { + if (CEF_MEMBER_MISSING(struct_, get_binary)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return NULL; + + // Execute + cef_binary_value_t* _retval = struct_->get_binary(struct_, + index); + + // Return type: refptr_same + return CefBinaryValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefListValueCToCpp::GetDictionary(int index) { + if (CEF_MEMBER_MISSING(struct_, get_dictionary)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return NULL; + + // Execute + cef_dictionary_value_t* _retval = struct_->get_dictionary(struct_, + index); + + // Return type: refptr_same + return CefDictionaryValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefListValueCToCpp::GetList(int index) { + if (CEF_MEMBER_MISSING(struct_, get_list)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return NULL; + + // Execute + cef_list_value_t* _retval = struct_->get_list(struct_, + index); + + // Return type: refptr_same + return CefListValueCToCpp::Wrap(_retval); +} + +bool CefListValueCToCpp::SetNull(int index) { + if (CEF_MEMBER_MISSING(struct_, set_null)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->set_null(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::SetBool(int index, bool value) { + if (CEF_MEMBER_MISSING(struct_, set_bool)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->set_bool(struct_, + index, + value); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::SetInt(int index, int value) { + if (CEF_MEMBER_MISSING(struct_, set_int)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->set_int(struct_, + index, + value); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::SetDouble(int index, double value) { + if (CEF_MEMBER_MISSING(struct_, set_double)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->set_double(struct_, + index, + value); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::SetString(int index, const CefString& value) { + if (CEF_MEMBER_MISSING(struct_, set_string)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + // Unverified params: value + + // Execute + int _retval = struct_->set_string(struct_, + index, + value.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::SetBinary(int index, CefRefPtr value) { + if (CEF_MEMBER_MISSING(struct_, set_binary)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set_binary(struct_, + index, + CefBinaryValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::SetDictionary(int index, + CefRefPtr value) { + if (CEF_MEMBER_MISSING(struct_, set_dictionary)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set_dictionary(struct_, + index, + CefDictionaryValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; +} + +bool CefListValueCToCpp::SetList(int index, CefRefPtr value) { + if (CEF_MEMBER_MISSING(struct_, set_list)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set_list(struct_, + index, + CefListValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/list_value_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/list_value_ctocpp.h new file mode 100644 index 00000000000..8967344bbed --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/list_value_ctocpp.h @@ -0,0 +1,64 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_values.h" +#include "include/capi/cef_values_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefListValueCToCpp + : public CefCToCpp { + public: + explicit CefListValueCToCpp(cef_list_value_t* str) + : CefCToCpp(str) {} + virtual ~CefListValueCToCpp() {} + + // CefListValue methods + virtual bool IsValid() OVERRIDE; + virtual bool IsOwned() OVERRIDE; + virtual bool IsReadOnly() OVERRIDE; + virtual CefRefPtr Copy() OVERRIDE; + virtual bool SetSize(size_t size) OVERRIDE; + virtual size_t GetSize() OVERRIDE; + virtual bool Clear() OVERRIDE; + virtual bool Remove(int index) OVERRIDE; + virtual CefValueType GetType(int index) OVERRIDE; + virtual bool GetBool(int index) OVERRIDE; + virtual int GetInt(int index) OVERRIDE; + virtual double GetDouble(int index) OVERRIDE; + virtual CefString GetString(int index) OVERRIDE; + virtual CefRefPtr GetBinary(int index) OVERRIDE; + virtual CefRefPtr GetDictionary(int index) OVERRIDE; + virtual CefRefPtr GetList(int index) OVERRIDE; + virtual bool SetNull(int index) OVERRIDE; + virtual bool SetBool(int index, bool value) OVERRIDE; + virtual bool SetInt(int index, int value) OVERRIDE; + virtual bool SetDouble(int index, double value) OVERRIDE; + virtual bool SetString(int index, const CefString& value) OVERRIDE; + virtual bool SetBinary(int index, CefRefPtr value) OVERRIDE; + virtual bool SetDictionary(int index, + CefRefPtr value) OVERRIDE; + virtual bool SetList(int index, CefRefPtr value) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_LIST_VALUE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/menu_model_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/menu_model_ctocpp.cc new file mode 100644 index 00000000000..3b7b0d042df --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/menu_model_ctocpp.cc @@ -0,0 +1,839 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/menu_model_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefMenuModelCToCpp::Clear() { + if (CEF_MEMBER_MISSING(struct_, clear)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->clear(struct_); + + // Return type: bool + return _retval?true:false; +} + +int CefMenuModelCToCpp::GetCount() { + if (CEF_MEMBER_MISSING(struct_, get_count)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_count(struct_); + + // Return type: simple + return _retval; +} + +bool CefMenuModelCToCpp::AddSeparator() { + if (CEF_MEMBER_MISSING(struct_, add_separator)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->add_separator(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::AddItem(int command_id, const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, add_item)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->add_item(struct_, + command_id, + label.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::AddCheckItem(int command_id, const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, add_check_item)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->add_check_item(struct_, + command_id, + label.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::AddRadioItem(int command_id, const CefString& label, + int group_id) { + if (CEF_MEMBER_MISSING(struct_, add_radio_item)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->add_radio_item(struct_, + command_id, + label.GetStruct(), + group_id); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefMenuModelCToCpp::AddSubMenu(int command_id, + const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, add_sub_menu)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return NULL; + + // Execute + cef_menu_model_t* _retval = struct_->add_sub_menu(struct_, + command_id, + label.GetStruct()); + + // Return type: refptr_same + return CefMenuModelCToCpp::Wrap(_retval); +} + +bool CefMenuModelCToCpp::InsertSeparatorAt(int index) { + if (CEF_MEMBER_MISSING(struct_, insert_separator_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->insert_separator_at(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::InsertItemAt(int index, int command_id, + const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, insert_item_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->insert_item_at(struct_, + index, + command_id, + label.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::InsertCheckItemAt(int index, int command_id, + const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, insert_check_item_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->insert_check_item_at(struct_, + index, + command_id, + label.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::InsertRadioItemAt(int index, int command_id, + const CefString& label, int group_id) { + if (CEF_MEMBER_MISSING(struct_, insert_radio_item_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->insert_radio_item_at(struct_, + index, + command_id, + label.GetStruct(), + group_id); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefMenuModelCToCpp::InsertSubMenuAt(int index, + int command_id, const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, insert_sub_menu_at)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return NULL; + + // Execute + cef_menu_model_t* _retval = struct_->insert_sub_menu_at(struct_, + index, + command_id, + label.GetStruct()); + + // Return type: refptr_same + return CefMenuModelCToCpp::Wrap(_retval); +} + +bool CefMenuModelCToCpp::Remove(int command_id) { + if (CEF_MEMBER_MISSING(struct_, remove)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->remove(struct_, + command_id); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::RemoveAt(int index) { + if (CEF_MEMBER_MISSING(struct_, remove_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->remove_at(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +int CefMenuModelCToCpp::GetIndexOf(int command_id) { + if (CEF_MEMBER_MISSING(struct_, get_index_of)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_index_of(struct_, + command_id); + + // Return type: simple + return _retval; +} + +int CefMenuModelCToCpp::GetCommandIdAt(int index) { + if (CEF_MEMBER_MISSING(struct_, get_command_id_at)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_command_id_at(struct_, + index); + + // Return type: simple + return _retval; +} + +bool CefMenuModelCToCpp::SetCommandIdAt(int index, int command_id) { + if (CEF_MEMBER_MISSING(struct_, set_command_id_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_command_id_at(struct_, + index, + command_id); + + // Return type: bool + return _retval?true:false; +} + +CefString CefMenuModelCToCpp::GetLabel(int command_id) { + if (CEF_MEMBER_MISSING(struct_, get_label)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_label(struct_, + command_id); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefMenuModelCToCpp::GetLabelAt(int index) { + if (CEF_MEMBER_MISSING(struct_, get_label_at)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_label_at(struct_, + index); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefMenuModelCToCpp::SetLabel(int command_id, const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, set_label)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->set_label(struct_, + command_id, + label.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetLabelAt(int index, const CefString& label) { + if (CEF_MEMBER_MISSING(struct_, set_label_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: label; type: string_byref_const + DCHECK(!label.empty()); + if (label.empty()) + return false; + + // Execute + int _retval = struct_->set_label_at(struct_, + index, + label.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +CefMenuModel::MenuItemType CefMenuModelCToCpp::GetType(int command_id) { + if (CEF_MEMBER_MISSING(struct_, get_type)) + return MENUITEMTYPE_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_menu_item_type_t _retval = struct_->get_type(struct_, + command_id); + + // Return type: simple + return _retval; +} + +CefMenuModel::MenuItemType CefMenuModelCToCpp::GetTypeAt(int index) { + if (CEF_MEMBER_MISSING(struct_, get_type_at)) + return MENUITEMTYPE_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_menu_item_type_t _retval = struct_->get_type_at(struct_, + index); + + // Return type: simple + return _retval; +} + +int CefMenuModelCToCpp::GetGroupId(int command_id) { + if (CEF_MEMBER_MISSING(struct_, get_group_id)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_group_id(struct_, + command_id); + + // Return type: simple + return _retval; +} + +int CefMenuModelCToCpp::GetGroupIdAt(int index) { + if (CEF_MEMBER_MISSING(struct_, get_group_id_at)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_group_id_at(struct_, + index); + + // Return type: simple + return _retval; +} + +bool CefMenuModelCToCpp::SetGroupId(int command_id, int group_id) { + if (CEF_MEMBER_MISSING(struct_, set_group_id)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_group_id(struct_, + command_id, + group_id); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetGroupIdAt(int index, int group_id) { + if (CEF_MEMBER_MISSING(struct_, set_group_id_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_group_id_at(struct_, + index, + group_id); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefMenuModelCToCpp::GetSubMenu(int command_id) { + if (CEF_MEMBER_MISSING(struct_, get_sub_menu)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_menu_model_t* _retval = struct_->get_sub_menu(struct_, + command_id); + + // Return type: refptr_same + return CefMenuModelCToCpp::Wrap(_retval); +} + +CefRefPtr CefMenuModelCToCpp::GetSubMenuAt(int index) { + if (CEF_MEMBER_MISSING(struct_, get_sub_menu_at)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_menu_model_t* _retval = struct_->get_sub_menu_at(struct_, + index); + + // Return type: refptr_same + return CefMenuModelCToCpp::Wrap(_retval); +} + +bool CefMenuModelCToCpp::IsVisible(int command_id) { + if (CEF_MEMBER_MISSING(struct_, is_visible)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_visible(struct_, + command_id); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::IsVisibleAt(int index) { + if (CEF_MEMBER_MISSING(struct_, is_visible_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_visible_at(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetVisible(int command_id, bool visible) { + if (CEF_MEMBER_MISSING(struct_, set_visible)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_visible(struct_, + command_id, + visible); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetVisibleAt(int index, bool visible) { + if (CEF_MEMBER_MISSING(struct_, set_visible_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_visible_at(struct_, + index, + visible); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::IsEnabled(int command_id) { + if (CEF_MEMBER_MISSING(struct_, is_enabled)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_enabled(struct_, + command_id); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::IsEnabledAt(int index) { + if (CEF_MEMBER_MISSING(struct_, is_enabled_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_enabled_at(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetEnabled(int command_id, bool enabled) { + if (CEF_MEMBER_MISSING(struct_, set_enabled)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_enabled(struct_, + command_id, + enabled); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetEnabledAt(int index, bool enabled) { + if (CEF_MEMBER_MISSING(struct_, set_enabled_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_enabled_at(struct_, + index, + enabled); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::IsChecked(int command_id) { + if (CEF_MEMBER_MISSING(struct_, is_checked)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_checked(struct_, + command_id); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::IsCheckedAt(int index) { + if (CEF_MEMBER_MISSING(struct_, is_checked_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_checked_at(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetChecked(int command_id, bool checked) { + if (CEF_MEMBER_MISSING(struct_, set_checked)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_checked(struct_, + command_id, + checked); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetCheckedAt(int index, bool checked) { + if (CEF_MEMBER_MISSING(struct_, set_checked_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_checked_at(struct_, + index, + checked); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::HasAccelerator(int command_id) { + if (CEF_MEMBER_MISSING(struct_, has_accelerator)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_accelerator(struct_, + command_id); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::HasAcceleratorAt(int index) { + if (CEF_MEMBER_MISSING(struct_, has_accelerator_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_accelerator_at(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetAccelerator(int command_id, int key_code, + bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { + if (CEF_MEMBER_MISSING(struct_, set_accelerator)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_accelerator(struct_, + command_id, + key_code, + shift_pressed, + ctrl_pressed, + alt_pressed); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::SetAcceleratorAt(int index, int key_code, + bool shift_pressed, bool ctrl_pressed, bool alt_pressed) { + if (CEF_MEMBER_MISSING(struct_, set_accelerator_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_accelerator_at(struct_, + index, + key_code, + shift_pressed, + ctrl_pressed, + alt_pressed); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::RemoveAccelerator(int command_id) { + if (CEF_MEMBER_MISSING(struct_, remove_accelerator)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->remove_accelerator(struct_, + command_id); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::RemoveAcceleratorAt(int index) { + if (CEF_MEMBER_MISSING(struct_, remove_accelerator_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->remove_accelerator_at(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::GetAccelerator(int command_id, int& key_code, + bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) { + if (CEF_MEMBER_MISSING(struct_, get_accelerator)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: shift_pressed; type: bool_byref + int shift_pressedInt = shift_pressed; + // Translate param: ctrl_pressed; type: bool_byref + int ctrl_pressedInt = ctrl_pressed; + // Translate param: alt_pressed; type: bool_byref + int alt_pressedInt = alt_pressed; + + // Execute + int _retval = struct_->get_accelerator(struct_, + command_id, + &key_code, + &shift_pressedInt, + &ctrl_pressedInt, + &alt_pressedInt); + + // Restore param:shift_pressed; type: bool_byref + shift_pressed = shift_pressedInt?true:false; + // Restore param:ctrl_pressed; type: bool_byref + ctrl_pressed = ctrl_pressedInt?true:false; + // Restore param:alt_pressed; type: bool_byref + alt_pressed = alt_pressedInt?true:false; + + // Return type: bool + return _retval?true:false; +} + +bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code, + bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) { + if (CEF_MEMBER_MISSING(struct_, get_accelerator_at)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: shift_pressed; type: bool_byref + int shift_pressedInt = shift_pressed; + // Translate param: ctrl_pressed; type: bool_byref + int ctrl_pressedInt = ctrl_pressed; + // Translate param: alt_pressed; type: bool_byref + int alt_pressedInt = alt_pressed; + + // Execute + int _retval = struct_->get_accelerator_at(struct_, + index, + &key_code, + &shift_pressedInt, + &ctrl_pressedInt, + &alt_pressedInt); + + // Restore param:shift_pressed; type: bool_byref + shift_pressed = shift_pressedInt?true:false; + // Restore param:ctrl_pressed; type: bool_byref + ctrl_pressed = ctrl_pressedInt?true:false; + // Restore param:alt_pressed; type: bool_byref + alt_pressed = alt_pressedInt?true:false; + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/menu_model_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/menu_model_ctocpp.h new file mode 100644 index 00000000000..ba8c369a246 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/menu_model_ctocpp.h @@ -0,0 +1,98 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_menu_model.h" +#include "include/capi/cef_menu_model_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefMenuModelCToCpp + : public CefCToCpp { + public: + explicit CefMenuModelCToCpp(cef_menu_model_t* str) + : CefCToCpp(str) {} + virtual ~CefMenuModelCToCpp() {} + + // CefMenuModel methods + virtual bool Clear() OVERRIDE; + virtual int GetCount() OVERRIDE; + virtual bool AddSeparator() OVERRIDE; + virtual bool AddItem(int command_id, const CefString& label) OVERRIDE; + virtual bool AddCheckItem(int command_id, const CefString& label) OVERRIDE; + virtual bool AddRadioItem(int command_id, const CefString& label, + int group_id) OVERRIDE; + virtual CefRefPtr AddSubMenu(int command_id, + const CefString& label) OVERRIDE; + virtual bool InsertSeparatorAt(int index) OVERRIDE; + virtual bool InsertItemAt(int index, int command_id, + const CefString& label) OVERRIDE; + virtual bool InsertCheckItemAt(int index, int command_id, + const CefString& label) OVERRIDE; + virtual bool InsertRadioItemAt(int index, int command_id, + const CefString& label, int group_id) OVERRIDE; + virtual CefRefPtr InsertSubMenuAt(int index, int command_id, + const CefString& label) OVERRIDE; + virtual bool Remove(int command_id) OVERRIDE; + virtual bool RemoveAt(int index) OVERRIDE; + virtual int GetIndexOf(int command_id) OVERRIDE; + virtual int GetCommandIdAt(int index) OVERRIDE; + virtual bool SetCommandIdAt(int index, int command_id) OVERRIDE; + virtual CefString GetLabel(int command_id) OVERRIDE; + virtual CefString GetLabelAt(int index) OVERRIDE; + virtual bool SetLabel(int command_id, const CefString& label) OVERRIDE; + virtual bool SetLabelAt(int index, const CefString& label) OVERRIDE; + virtual MenuItemType GetType(int command_id) OVERRIDE; + virtual MenuItemType GetTypeAt(int index) OVERRIDE; + virtual int GetGroupId(int command_id) OVERRIDE; + virtual int GetGroupIdAt(int index) OVERRIDE; + virtual bool SetGroupId(int command_id, int group_id) OVERRIDE; + virtual bool SetGroupIdAt(int index, int group_id) OVERRIDE; + virtual CefRefPtr GetSubMenu(int command_id) OVERRIDE; + virtual CefRefPtr GetSubMenuAt(int index) OVERRIDE; + virtual bool IsVisible(int command_id) OVERRIDE; + virtual bool IsVisibleAt(int index) OVERRIDE; + virtual bool SetVisible(int command_id, bool visible) OVERRIDE; + virtual bool SetVisibleAt(int index, bool visible) OVERRIDE; + virtual bool IsEnabled(int command_id) OVERRIDE; + virtual bool IsEnabledAt(int index) OVERRIDE; + virtual bool SetEnabled(int command_id, bool enabled) OVERRIDE; + virtual bool SetEnabledAt(int index, bool enabled) OVERRIDE; + virtual bool IsChecked(int command_id) OVERRIDE; + virtual bool IsCheckedAt(int index) OVERRIDE; + virtual bool SetChecked(int command_id, bool checked) OVERRIDE; + virtual bool SetCheckedAt(int index, bool checked) OVERRIDE; + virtual bool HasAccelerator(int command_id) OVERRIDE; + virtual bool HasAcceleratorAt(int index) OVERRIDE; + virtual bool SetAccelerator(int command_id, int key_code, bool shift_pressed, + bool ctrl_pressed, bool alt_pressed) OVERRIDE; + virtual bool SetAcceleratorAt(int index, int key_code, bool shift_pressed, + bool ctrl_pressed, bool alt_pressed) OVERRIDE; + virtual bool RemoveAccelerator(int command_id) OVERRIDE; + virtual bool RemoveAcceleratorAt(int index) OVERRIDE; + virtual bool GetAccelerator(int command_id, int& key_code, + bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) OVERRIDE; + virtual bool GetAcceleratorAt(int index, int& key_code, bool& shift_pressed, + bool& ctrl_pressed, bool& alt_pressed) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/navigation_entry_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/navigation_entry_ctocpp.cc new file mode 100644 index 00000000000..c46d10ab606 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/navigation_entry_ctocpp.cc @@ -0,0 +1,164 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefNavigationEntryCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefNavigationEntryCToCpp::GetURL() { + if (CEF_MEMBER_MISSING(struct_, get_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefNavigationEntryCToCpp::GetDisplayURL() { + if (CEF_MEMBER_MISSING(struct_, get_display_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_display_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefNavigationEntryCToCpp::GetOriginalURL() { + if (CEF_MEMBER_MISSING(struct_, get_original_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_original_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefNavigationEntryCToCpp::GetTitle() { + if (CEF_MEMBER_MISSING(struct_, get_title)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_title(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefNavigationEntry::TransitionType CefNavigationEntryCToCpp::GetTransitionType( + ) { + if (CEF_MEMBER_MISSING(struct_, get_transition_type)) + return TT_EXPLICIT; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_transition_type_t _retval = struct_->get_transition_type(struct_); + + // Return type: simple + return _retval; +} + +bool CefNavigationEntryCToCpp::HasPostData() { + if (CEF_MEMBER_MISSING(struct_, has_post_data)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_post_data(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefNavigationEntryCToCpp::GetFrameName() { + if (CEF_MEMBER_MISSING(struct_, get_frame_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_frame_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefTime CefNavigationEntryCToCpp::GetCompletionTime() { + if (CEF_MEMBER_MISSING(struct_, get_completion_time)) + return CefTime(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_time_t _retval = struct_->get_completion_time(struct_); + + // Return type: simple + return _retval; +} + +int CefNavigationEntryCToCpp::GetHttpStatusCode() { + if (CEF_MEMBER_MISSING(struct_, get_http_status_code)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_http_status_code(struct_); + + // Return type: simple + return _retval; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/navigation_entry_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/navigation_entry_ctocpp.h new file mode 100644 index 00000000000..4021500a87b --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/navigation_entry_ctocpp.h @@ -0,0 +1,51 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_navigation_entry.h" +#include "include/capi/cef_navigation_entry_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefNavigationEntryCToCpp + : public CefCToCpp { + public: + explicit CefNavigationEntryCToCpp(cef_navigation_entry_t* str) + : CefCToCpp(str) {} + virtual ~CefNavigationEntryCToCpp() {} + + // CefNavigationEntry methods + virtual bool IsValid() OVERRIDE; + virtual CefString GetURL() OVERRIDE; + virtual CefString GetDisplayURL() OVERRIDE; + virtual CefString GetOriginalURL() OVERRIDE; + virtual CefString GetTitle() OVERRIDE; + virtual TransitionType GetTransitionType() OVERRIDE; + virtual bool HasPostData() OVERRIDE; + virtual CefString GetFrameName() OVERRIDE; + virtual CefTime GetCompletionTime() OVERRIDE; + virtual int GetHttpStatusCode() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_NAVIGATION_ENTRY_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/post_data_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/post_data_ctocpp.cc new file mode 100644 index 00000000000..2c74a91fac3 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/post_data_ctocpp.cc @@ -0,0 +1,150 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include +#include "libcef_dll/ctocpp/post_data_ctocpp.h" +#include "libcef_dll/ctocpp/post_data_element_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefPostData::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_post_data_t* _retval = cef_post_data_create(); + + // Return type: refptr_same + return CefPostDataCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefPostDataCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +size_t CefPostDataCToCpp::GetElementCount() { + if (CEF_MEMBER_MISSING(struct_, get_element_count)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_element_count(struct_); + + // Return type: simple + return _retval; +} + +void CefPostDataCToCpp::GetElements(ElementVector& elements) { + if (CEF_MEMBER_MISSING(struct_, get_elements)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: elements; type: refptr_vec_same_byref + size_t elementsSize = elements.size(); + size_t elementsCount = std::max(GetElementCount(), elementsSize); + cef_post_data_element_t** elementsList = NULL; + if (elementsCount > 0) { + elementsList = new cef_post_data_element_t*[elementsCount]; + DCHECK(elementsList); + if (elementsList) { + memset(elementsList, 0, sizeof(cef_post_data_element_t*)*elementsCount); + } + if (elementsList && elementsSize > 0) { + for (size_t i = 0; i < elementsSize; ++i) { + elementsList[i] = CefPostDataElementCToCpp::Unwrap(elements[i]); + } + } + } + + // Execute + struct_->get_elements(struct_, + &elementsCount, + elementsList); + + // Restore param:elements; type: refptr_vec_same_byref + elements.clear(); + if (elementsCount > 0 && elementsList) { + for (size_t i = 0; i < elementsCount; ++i) { + elements.push_back(CefPostDataElementCToCpp::Wrap(elementsList[i])); + } + delete [] elementsList; + } +} + +bool CefPostDataCToCpp::RemoveElement(CefRefPtr element) { + if (CEF_MEMBER_MISSING(struct_, remove_element)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: element; type: refptr_same + DCHECK(element.get()); + if (!element.get()) + return false; + + // Execute + int _retval = struct_->remove_element(struct_, + CefPostDataElementCToCpp::Unwrap(element)); + + // Return type: bool + return _retval?true:false; +} + +bool CefPostDataCToCpp::AddElement(CefRefPtr element) { + if (CEF_MEMBER_MISSING(struct_, add_element)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: element; type: refptr_same + DCHECK(element.get()); + if (!element.get()) + return false; + + // Execute + int _retval = struct_->add_element(struct_, + CefPostDataElementCToCpp::Unwrap(element)); + + // Return type: bool + return _retval?true:false; +} + +void CefPostDataCToCpp::RemoveElements() { + if (CEF_MEMBER_MISSING(struct_, remove_elements)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->remove_elements(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/post_data_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/post_data_ctocpp.h new file mode 100644 index 00000000000..7622a382d04 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/post_data_ctocpp.h @@ -0,0 +1,45 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefPostDataCToCpp + : public CefCToCpp { + public: + explicit CefPostDataCToCpp(cef_post_data_t* str) + : CefCToCpp(str) {} + virtual ~CefPostDataCToCpp() {} + + // CefPostData methods + virtual bool IsReadOnly() OVERRIDE; + virtual size_t GetElementCount() OVERRIDE; + virtual void GetElements(ElementVector& elements) OVERRIDE; + virtual bool RemoveElement(CefRefPtr element) OVERRIDE; + virtual bool AddElement(CefRefPtr element) OVERRIDE; + virtual void RemoveElements() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_POST_DATA_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/post_data_element_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/post_data_element_ctocpp.cc new file mode 100644 index 00000000000..f84ab499599 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/post_data_element_ctocpp.cc @@ -0,0 +1,153 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/post_data_element_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefPostDataElement::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_post_data_element_t* _retval = cef_post_data_element_create(); + + // Return type: refptr_same + return CefPostDataElementCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefPostDataElementCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefPostDataElementCToCpp::SetToEmpty() { + if (CEF_MEMBER_MISSING(struct_, set_to_empty)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_to_empty(struct_); +} + +void CefPostDataElementCToCpp::SetToFile(const CefString& fileName) { + if (CEF_MEMBER_MISSING(struct_, set_to_file)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return; + + // Execute + struct_->set_to_file(struct_, + fileName.GetStruct()); +} + +void CefPostDataElementCToCpp::SetToBytes(size_t size, const void* bytes) { + if (CEF_MEMBER_MISSING(struct_, set_to_bytes)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: bytes; type: simple_byaddr + DCHECK(bytes); + if (!bytes) + return; + + // Execute + struct_->set_to_bytes(struct_, + size, + bytes); +} + +CefPostDataElement::Type CefPostDataElementCToCpp::GetType() { + if (CEF_MEMBER_MISSING(struct_, get_type)) + return PDE_TYPE_EMPTY; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_postdataelement_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; +} + +CefString CefPostDataElementCToCpp::GetFile() { + if (CEF_MEMBER_MISSING(struct_, get_file)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_file(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +size_t CefPostDataElementCToCpp::GetBytesCount() { + if (CEF_MEMBER_MISSING(struct_, get_bytes_count)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_bytes_count(struct_); + + // Return type: simple + return _retval; +} + +size_t CefPostDataElementCToCpp::GetBytes(size_t size, void* bytes) { + if (CEF_MEMBER_MISSING(struct_, get_bytes)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: bytes; type: simple_byaddr + DCHECK(bytes); + if (!bytes) + return 0; + + // Execute + size_t _retval = struct_->get_bytes(struct_, + size, + bytes); + + // Return type: simple + return _retval; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/post_data_element_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/post_data_element_ctocpp.h new file mode 100644 index 00000000000..ccc6e2b1b3d --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/post_data_element_ctocpp.h @@ -0,0 +1,49 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefPostDataElementCToCpp + : public CefCToCpp { + public: + explicit CefPostDataElementCToCpp(cef_post_data_element_t* str) + : CefCToCpp(str) {} + virtual ~CefPostDataElementCToCpp() {} + + // CefPostDataElement methods + virtual bool IsReadOnly() OVERRIDE; + virtual void SetToEmpty() OVERRIDE; + virtual void SetToFile(const CefString& fileName) OVERRIDE; + virtual void SetToBytes(size_t size, const void* bytes) OVERRIDE; + virtual Type GetType() OVERRIDE; + virtual CefString GetFile() OVERRIDE; + virtual size_t GetBytesCount() OVERRIDE; + virtual size_t GetBytes(size_t size, void* bytes) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_POST_DATA_ELEMENT_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc new file mode 100644 index 00000000000..409e5450b9c --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/print_dialog_callback_ctocpp.cc @@ -0,0 +1,51 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h" +#include "libcef_dll/ctocpp/print_settings_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefPrintDialogCallbackCToCpp::Continue( + CefRefPtr settings) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: settings; type: refptr_same + DCHECK(settings.get()); + if (!settings.get()) + return; + + // Execute + struct_->cont(struct_, + CefPrintSettingsCToCpp::Unwrap(settings)); +} + +void CefPrintDialogCallbackCToCpp::Cancel() { + if (CEF_MEMBER_MISSING(struct_, cancel)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cancel(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h new file mode 100644 index 00000000000..11797393bf3 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/print_dialog_callback_ctocpp.h @@ -0,0 +1,43 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_print_handler.h" +#include "include/capi/cef_print_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefPrintDialogCallbackCToCpp + : public CefCToCpp { + public: + explicit CefPrintDialogCallbackCToCpp(cef_print_dialog_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefPrintDialogCallbackCToCpp() {} + + // CefPrintDialogCallback methods + virtual void Continue(CefRefPtr settings) OVERRIDE; + virtual void Cancel() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_DIALOG_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/print_job_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/print_job_callback_ctocpp.cc new file mode 100644 index 00000000000..78470b5cb20 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/print_job_callback_ctocpp.cc @@ -0,0 +1,33 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/print_job_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefPrintJobCallbackCToCpp::Continue() { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cont(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/print_job_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/print_job_callback_ctocpp.h new file mode 100644 index 00000000000..4cb4f68ce24 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/print_job_callback_ctocpp.h @@ -0,0 +1,42 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_print_handler.h" +#include "include/capi/cef_print_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefPrintJobCallbackCToCpp + : public CefCToCpp { + public: + explicit CefPrintJobCallbackCToCpp(cef_print_job_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefPrintJobCallbackCToCpp() {} + + // CefPrintJobCallback methods + virtual void Continue() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_JOB_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/print_settings_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/print_settings_ctocpp.cc new file mode 100644 index 00000000000..5b9baba24d9 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/print_settings_ctocpp.cc @@ -0,0 +1,367 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include +#include "libcef_dll/ctocpp/print_settings_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefPrintSettings::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_print_settings_t* _retval = cef_print_settings_create(); + + // Return type: refptr_same + return CefPrintSettingsCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefPrintSettingsCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefPrintSettingsCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefPrintSettingsCToCpp::Copy() { + if (CEF_MEMBER_MISSING(struct_, copy)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_print_settings_t* _retval = struct_->copy(struct_); + + // Return type: refptr_same + return CefPrintSettingsCToCpp::Wrap(_retval); +} + +void CefPrintSettingsCToCpp::SetOrientation(bool landscape) { + if (CEF_MEMBER_MISSING(struct_, set_orientation)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_orientation(struct_, + landscape); +} + +bool CefPrintSettingsCToCpp::IsLandscape() { + if (CEF_MEMBER_MISSING(struct_, is_landscape)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_landscape(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefPrintSettingsCToCpp::SetPrinterPrintableArea( + const CefSize& physical_size_device_units, + const CefRect& printable_area_device_units, bool landscape_needs_flip) { + if (CEF_MEMBER_MISSING(struct_, set_printer_printable_area)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_printer_printable_area(struct_, + &physical_size_device_units, + &printable_area_device_units, + landscape_needs_flip); +} + +void CefPrintSettingsCToCpp::SetDeviceName(const CefString& name) { + if (CEF_MEMBER_MISSING(struct_, set_device_name)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: name + + // Execute + struct_->set_device_name(struct_, + name.GetStruct()); +} + +CefString CefPrintSettingsCToCpp::GetDeviceName() { + if (CEF_MEMBER_MISSING(struct_, get_device_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_device_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefPrintSettingsCToCpp::SetDPI(int dpi) { + if (CEF_MEMBER_MISSING(struct_, set_dpi)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_dpi(struct_, + dpi); +} + +int CefPrintSettingsCToCpp::GetDPI() { + if (CEF_MEMBER_MISSING(struct_, get_dpi)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_dpi(struct_); + + // Return type: simple + return _retval; +} + +void CefPrintSettingsCToCpp::SetPageRanges(const PageRangeList& ranges) { + if (CEF_MEMBER_MISSING(struct_, set_page_ranges)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: ranges; type: simple_vec_byref_const + const size_t rangesCount = ranges.size(); + cef_page_range_t* rangesList = NULL; + if (rangesCount > 0) { + rangesList = new cef_page_range_t[rangesCount]; + DCHECK(rangesList); + if (rangesList) { + for (size_t i = 0; i < rangesCount; ++i) { + rangesList[i] = ranges[i]; + } + } + } + + // Execute + struct_->set_page_ranges(struct_, + rangesCount, + rangesList); + + // Restore param:ranges; type: simple_vec_byref_const + if (rangesList) + delete [] rangesList; +} + +size_t CefPrintSettingsCToCpp::GetPageRangesCount() { + if (CEF_MEMBER_MISSING(struct_, get_page_ranges_count)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_page_ranges_count(struct_); + + // Return type: simple + return _retval; +} + +void CefPrintSettingsCToCpp::GetPageRanges(PageRangeList& ranges) { + if (CEF_MEMBER_MISSING(struct_, get_page_ranges)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: ranges; type: simple_vec_byref + size_t rangesSize = ranges.size(); + size_t rangesCount = std::max(GetPageRangesCount(), rangesSize); + cef_page_range_t* rangesList = NULL; + if (rangesCount > 0) { + rangesList = new cef_page_range_t[rangesCount]; + DCHECK(rangesList); + if (rangesList) { + memset(rangesList, 0, sizeof(cef_page_range_t)*rangesCount); + } + if (rangesList && rangesSize > 0) { + for (size_t i = 0; i < rangesSize; ++i) { + rangesList[i] = ranges[i]; + } + } + } + + // Execute + struct_->get_page_ranges(struct_, + &rangesCount, + rangesList); + + // Restore param:ranges; type: simple_vec_byref + ranges.clear(); + if (rangesCount > 0 && rangesList) { + for (size_t i = 0; i < rangesCount; ++i) { + ranges.push_back(rangesList[i]); + } + delete [] rangesList; + } +} + +void CefPrintSettingsCToCpp::SetSelectionOnly(bool selection_only) { + if (CEF_MEMBER_MISSING(struct_, set_selection_only)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_selection_only(struct_, + selection_only); +} + +bool CefPrintSettingsCToCpp::IsSelectionOnly() { + if (CEF_MEMBER_MISSING(struct_, is_selection_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_selection_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefPrintSettingsCToCpp::SetCollate(bool collate) { + if (CEF_MEMBER_MISSING(struct_, set_collate)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_collate(struct_, + collate); +} + +bool CefPrintSettingsCToCpp::WillCollate() { + if (CEF_MEMBER_MISSING(struct_, will_collate)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->will_collate(struct_); + + // Return type: bool + return _retval?true:false; +} + +void CefPrintSettingsCToCpp::SetColorModel(ColorModel model) { + if (CEF_MEMBER_MISSING(struct_, set_color_model)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_color_model(struct_, + model); +} + +CefPrintSettings::ColorModel CefPrintSettingsCToCpp::GetColorModel() { + if (CEF_MEMBER_MISSING(struct_, get_color_model)) + return COLOR_MODEL_UNKNOWN; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_color_model_t _retval = struct_->get_color_model(struct_); + + // Return type: simple + return _retval; +} + +void CefPrintSettingsCToCpp::SetCopies(int copies) { + if (CEF_MEMBER_MISSING(struct_, set_copies)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_copies(struct_, + copies); +} + +int CefPrintSettingsCToCpp::GetCopies() { + if (CEF_MEMBER_MISSING(struct_, get_copies)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_copies(struct_); + + // Return type: simple + return _retval; +} + +void CefPrintSettingsCToCpp::SetDuplexMode(DuplexMode mode) { + if (CEF_MEMBER_MISSING(struct_, set_duplex_mode)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_duplex_mode(struct_, + mode); +} + +CefPrintSettings::DuplexMode CefPrintSettingsCToCpp::GetDuplexMode() { + if (CEF_MEMBER_MISSING(struct_, get_duplex_mode)) + return DUPLEX_MODE_UNKNOWN; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_duplex_mode_t _retval = struct_->get_duplex_mode(struct_); + + // Return type: simple + return _retval; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/print_settings_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/print_settings_ctocpp.h new file mode 100644 index 00000000000..8299b7ffd12 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/print_settings_ctocpp.h @@ -0,0 +1,67 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_print_settings.h" +#include "include/capi/cef_print_settings_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefPrintSettingsCToCpp + : public CefCToCpp { + public: + explicit CefPrintSettingsCToCpp(cef_print_settings_t* str) + : CefCToCpp(str) {} + virtual ~CefPrintSettingsCToCpp() {} + + // CefPrintSettings methods + virtual bool IsValid() OVERRIDE; + virtual bool IsReadOnly() OVERRIDE; + virtual CefRefPtr Copy() OVERRIDE; + virtual void SetOrientation(bool landscape) OVERRIDE; + virtual bool IsLandscape() OVERRIDE; + virtual void SetPrinterPrintableArea( + const CefSize& physical_size_device_units, + const CefRect& printable_area_device_units, + bool landscape_needs_flip) OVERRIDE; + virtual void SetDeviceName(const CefString& name) OVERRIDE; + virtual CefString GetDeviceName() OVERRIDE; + virtual void SetDPI(int dpi) OVERRIDE; + virtual int GetDPI() OVERRIDE; + virtual void SetPageRanges(const PageRangeList& ranges) OVERRIDE; + virtual size_t GetPageRangesCount() OVERRIDE; + virtual void GetPageRanges(PageRangeList& ranges) OVERRIDE; + virtual void SetSelectionOnly(bool selection_only) OVERRIDE; + virtual bool IsSelectionOnly() OVERRIDE; + virtual void SetCollate(bool collate) OVERRIDE; + virtual bool WillCollate() OVERRIDE; + virtual void SetColorModel(ColorModel model) OVERRIDE; + virtual ColorModel GetColorModel() OVERRIDE; + virtual void SetCopies(int copies) OVERRIDE; + virtual int GetCopies() OVERRIDE; + virtual void SetDuplexMode(DuplexMode mode) OVERRIDE; + virtual DuplexMode GetDuplexMode() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_PRINT_SETTINGS_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/process_message_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/process_message_ctocpp.cc new file mode 100644 index 00000000000..77983aba046 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/process_message_ctocpp.cc @@ -0,0 +1,110 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/list_value_ctocpp.h" +#include "libcef_dll/ctocpp/process_message_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefProcessMessage::Create(const CefString& name) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return NULL; + + // Execute + cef_process_message_t* _retval = cef_process_message_create( + name.GetStruct()); + + // Return type: refptr_same + return CefProcessMessageCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefProcessMessageCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefProcessMessageCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefProcessMessageCToCpp::Copy() { + if (CEF_MEMBER_MISSING(struct_, copy)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_process_message_t* _retval = struct_->copy(struct_); + + // Return type: refptr_same + return CefProcessMessageCToCpp::Wrap(_retval); +} + +CefString CefProcessMessageCToCpp::GetName() { + if (CEF_MEMBER_MISSING(struct_, get_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefRefPtr CefProcessMessageCToCpp::GetArgumentList() { + if (CEF_MEMBER_MISSING(struct_, get_argument_list)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_list_value_t* _retval = struct_->get_argument_list(struct_); + + // Return type: refptr_same + return CefListValueCToCpp::Wrap(_retval); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/process_message_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/process_message_ctocpp.h new file mode 100644 index 00000000000..242681a136b --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/process_message_ctocpp.h @@ -0,0 +1,46 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_process_message.h" +#include "include/capi/cef_process_message_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefProcessMessageCToCpp + : public CefCToCpp { + public: + explicit CefProcessMessageCToCpp(cef_process_message_t* str) + : CefCToCpp(str) {} + virtual ~CefProcessMessageCToCpp() {} + + // CefProcessMessage methods + virtual bool IsValid() OVERRIDE; + virtual bool IsReadOnly() OVERRIDE; + virtual CefRefPtr Copy() OVERRIDE; + virtual CefString GetName() OVERRIDE; + virtual CefRefPtr GetArgumentList() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_PROCESS_MESSAGE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/quota_callback_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/quota_callback_ctocpp.cc new file mode 100644 index 00000000000..c782ffb5100 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/quota_callback_ctocpp.cc @@ -0,0 +1,44 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/quota_callback_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +void CefQuotaCallbackCToCpp::Continue(bool allow) { + if (CEF_MEMBER_MISSING(struct_, cont)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cont(struct_, + allow); +} + +void CefQuotaCallbackCToCpp::Cancel() { + if (CEF_MEMBER_MISSING(struct_, cancel)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cancel(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/quota_callback_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/quota_callback_ctocpp.h new file mode 100644 index 00000000000..76ca72f24c4 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/quota_callback_ctocpp.h @@ -0,0 +1,43 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_QUOTA_CALLBACK_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_QUOTA_CALLBACK_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request_handler.h" +#include "include/capi/cef_request_handler_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefQuotaCallbackCToCpp + : public CefCToCpp { + public: + explicit CefQuotaCallbackCToCpp(cef_quota_callback_t* str) + : CefCToCpp(str) {} + virtual ~CefQuotaCallbackCToCpp() {} + + // CefQuotaCallback methods + virtual void Continue(bool allow) OVERRIDE; + virtual void Cancel() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_QUOTA_CALLBACK_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/request_context_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/request_context_ctocpp.cc new file mode 100644 index 00000000000..a7bd7de0194 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/request_context_ctocpp.cc @@ -0,0 +1,96 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/request_context_handler_cpptoc.h" +#include "libcef_dll/ctocpp/request_context_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefRequestContext::GetGlobalContext() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_request_context_t* _retval = cef_request_context_get_global_context(); + + // Return type: refptr_same + return CefRequestContextCToCpp::Wrap(_retval); +} + +CefRefPtr CefRequestContext::CreateContext( + CefRefPtr handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: handler + + // Execute + cef_request_context_t* _retval = cef_request_context_create_context( + CefRequestContextHandlerCppToC::Wrap(handler)); + + // Return type: refptr_same + return CefRequestContextCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefRequestContextCToCpp::IsSame(CefRefPtr other) { + if (CEF_MEMBER_MISSING(struct_, is_same)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: other; type: refptr_same + DCHECK(other.get()); + if (!other.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefRequestContextCToCpp::Unwrap(other)); + + // Return type: bool + return _retval?true:false; +} + +bool CefRequestContextCToCpp::IsGlobal() { + if (CEF_MEMBER_MISSING(struct_, is_global)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_global(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefRequestContextCToCpp::GetHandler() { + if (CEF_MEMBER_MISSING(struct_, get_handler)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_request_context_handler_t* _retval = struct_->get_handler(struct_); + + // Return type: refptr_diff + return CefRequestContextHandlerCppToC::Unwrap(_retval); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/request_context_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/request_context_ctocpp.h new file mode 100644 index 00000000000..961150aa33e --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/request_context_ctocpp.h @@ -0,0 +1,44 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request_context.h" +#include "include/capi/cef_request_context_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefRequestContextCToCpp + : public CefCToCpp { + public: + explicit CefRequestContextCToCpp(cef_request_context_t* str) + : CefCToCpp(str) {} + virtual ~CefRequestContextCToCpp() {} + + // CefRequestContext methods + virtual bool IsSame(CefRefPtr other) OVERRIDE; + virtual bool IsGlobal() OVERRIDE; + virtual CefRefPtr GetHandler() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CONTEXT_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/request_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/request_ctocpp.cc new file mode 100644 index 00000000000..9e280c57a62 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/request_ctocpp.cc @@ -0,0 +1,303 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/post_data_ctocpp.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefRequest::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_request_t* _retval = cef_request_create(); + + // Return type: refptr_same + return CefRequestCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefRequestCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefRequestCToCpp::GetURL() { + if (CEF_MEMBER_MISSING(struct_, get_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_url(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefRequestCToCpp::SetURL(const CefString& url) { + if (CEF_MEMBER_MISSING(struct_, set_url)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->set_url(struct_, + url.GetStruct()); +} + +CefString CefRequestCToCpp::GetMethod() { + if (CEF_MEMBER_MISSING(struct_, get_method)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_method(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefRequestCToCpp::SetMethod(const CefString& method) { + if (CEF_MEMBER_MISSING(struct_, set_method)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: method; type: string_byref_const + DCHECK(!method.empty()); + if (method.empty()) + return; + + // Execute + struct_->set_method(struct_, + method.GetStruct()); +} + +CefRefPtr CefRequestCToCpp::GetPostData() { + if (CEF_MEMBER_MISSING(struct_, get_post_data)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_post_data_t* _retval = struct_->get_post_data(struct_); + + // Return type: refptr_same + return CefPostDataCToCpp::Wrap(_retval); +} + +void CefRequestCToCpp::SetPostData(CefRefPtr postData) { + if (CEF_MEMBER_MISSING(struct_, set_post_data)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: postData; type: refptr_same + DCHECK(postData.get()); + if (!postData.get()) + return; + + // Execute + struct_->set_post_data(struct_, + CefPostDataCToCpp::Unwrap(postData)); +} + +void CefRequestCToCpp::GetHeaderMap(HeaderMap& headerMap) { + if (CEF_MEMBER_MISSING(struct_, get_header_map)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: headerMap; type: string_map_multi_byref + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->get_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref + if (headerMapMultimap) { + headerMap.clear(); + transfer_string_multimap_contents(headerMapMultimap, headerMap); + cef_string_multimap_free(headerMapMultimap); + } +} + +void CefRequestCToCpp::SetHeaderMap(const HeaderMap& headerMap) { + if (CEF_MEMBER_MISSING(struct_, set_header_map)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: headerMap; type: string_map_multi_byref_const + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->set_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref_const + if (headerMapMultimap) + cef_string_multimap_free(headerMapMultimap); +} + +void CefRequestCToCpp::Set(const CefString& url, const CefString& method, + CefRefPtr postData, const HeaderMap& headerMap) { + if (CEF_MEMBER_MISSING(struct_, set)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + // Verify param: method; type: string_byref_const + DCHECK(!method.empty()); + if (method.empty()) + return; + // Unverified params: postData + + // Translate param: headerMap; type: string_map_multi_byref_const + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->set(struct_, + url.GetStruct(), + method.GetStruct(), + CefPostDataCToCpp::Unwrap(postData), + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref_const + if (headerMapMultimap) + cef_string_multimap_free(headerMapMultimap); +} + +int CefRequestCToCpp::GetFlags() { + if (CEF_MEMBER_MISSING(struct_, get_flags)) + return UR_FLAG_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_flags(struct_); + + // Return type: simple + return _retval; +} + +void CefRequestCToCpp::SetFlags(int flags) { + if (CEF_MEMBER_MISSING(struct_, set_flags)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_flags(struct_, + flags); +} + +CefString CefRequestCToCpp::GetFirstPartyForCookies() { + if (CEF_MEMBER_MISSING(struct_, get_first_party_for_cookies)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_first_party_for_cookies(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefRequestCToCpp::SetFirstPartyForCookies(const CefString& url) { + if (CEF_MEMBER_MISSING(struct_, set_first_party_for_cookies)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return; + + // Execute + struct_->set_first_party_for_cookies(struct_, + url.GetStruct()); +} + +CefRequest::ResourceType CefRequestCToCpp::GetResourceType() { + if (CEF_MEMBER_MISSING(struct_, get_resource_type)) + return RT_SUB_RESOURCE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_resource_type_t _retval = struct_->get_resource_type(struct_); + + // Return type: simple + return _retval; +} + +CefRequest::TransitionType CefRequestCToCpp::GetTransitionType() { + if (CEF_MEMBER_MISSING(struct_, get_transition_type)) + return TT_EXPLICIT; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_transition_type_t _retval = struct_->get_transition_type(struct_); + + // Return type: simple + return _retval; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/request_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/request_ctocpp.h new file mode 100644 index 00000000000..574ac7f4cf5 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/request_ctocpp.h @@ -0,0 +1,56 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_request.h" +#include "include/capi/cef_request_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefRequestCToCpp + : public CefCToCpp { + public: + explicit CefRequestCToCpp(cef_request_t* str) + : CefCToCpp(str) {} + virtual ~CefRequestCToCpp() {} + + // CefRequest methods + virtual bool IsReadOnly() OVERRIDE; + virtual CefString GetURL() OVERRIDE; + virtual void SetURL(const CefString& url) OVERRIDE; + virtual CefString GetMethod() OVERRIDE; + virtual void SetMethod(const CefString& method) OVERRIDE; + virtual CefRefPtr GetPostData() OVERRIDE; + virtual void SetPostData(CefRefPtr postData) OVERRIDE; + virtual void GetHeaderMap(HeaderMap& headerMap) OVERRIDE; + virtual void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; + virtual void Set(const CefString& url, const CefString& method, + CefRefPtr postData, const HeaderMap& headerMap) OVERRIDE; + virtual int GetFlags() OVERRIDE; + virtual void SetFlags(int flags) OVERRIDE; + virtual CefString GetFirstPartyForCookies() OVERRIDE; + virtual void SetFirstPartyForCookies(const CefString& url) OVERRIDE; + virtual ResourceType GetResourceType() OVERRIDE; + virtual TransitionType GetTransitionType() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_REQUEST_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/response_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/response_ctocpp.cc new file mode 100644 index 00000000000..6a89c192921 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/response_ctocpp.cc @@ -0,0 +1,202 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/response_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefResponse::Create() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_response_t* _retval = cef_response_create(); + + // Return type: refptr_same + return CefResponseCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefResponseCToCpp::IsReadOnly() { + if (CEF_MEMBER_MISSING(struct_, is_read_only)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_read_only(struct_); + + // Return type: bool + return _retval?true:false; +} + +int CefResponseCToCpp::GetStatus() { + if (CEF_MEMBER_MISSING(struct_, get_status)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_status(struct_); + + // Return type: simple + return _retval; +} + +void CefResponseCToCpp::SetStatus(int status) { + if (CEF_MEMBER_MISSING(struct_, set_status)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->set_status(struct_, + status); +} + +CefString CefResponseCToCpp::GetStatusText() { + if (CEF_MEMBER_MISSING(struct_, get_status_text)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_status_text(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefResponseCToCpp::SetStatusText(const CefString& statusText) { + if (CEF_MEMBER_MISSING(struct_, set_status_text)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: statusText; type: string_byref_const + DCHECK(!statusText.empty()); + if (statusText.empty()) + return; + + // Execute + struct_->set_status_text(struct_, + statusText.GetStruct()); +} + +CefString CefResponseCToCpp::GetMimeType() { + if (CEF_MEMBER_MISSING(struct_, get_mime_type)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_mime_type(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefResponseCToCpp::SetMimeType(const CefString& mimeType) { + if (CEF_MEMBER_MISSING(struct_, set_mime_type)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: mimeType; type: string_byref_const + DCHECK(!mimeType.empty()); + if (mimeType.empty()) + return; + + // Execute + struct_->set_mime_type(struct_, + mimeType.GetStruct()); +} + +CefString CefResponseCToCpp::GetHeader(const CefString& name) { + if (CEF_MEMBER_MISSING(struct_, get_header)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_header(struct_, + name.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +void CefResponseCToCpp::GetHeaderMap(HeaderMap& headerMap) { + if (CEF_MEMBER_MISSING(struct_, get_header_map)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: headerMap; type: string_map_multi_byref + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->get_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref + if (headerMapMultimap) { + headerMap.clear(); + transfer_string_multimap_contents(headerMapMultimap, headerMap); + cef_string_multimap_free(headerMapMultimap); + } +} + +void CefResponseCToCpp::SetHeaderMap(const HeaderMap& headerMap) { + if (CEF_MEMBER_MISSING(struct_, set_header_map)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: headerMap; type: string_map_multi_byref_const + cef_string_multimap_t headerMapMultimap = cef_string_multimap_alloc(); + DCHECK(headerMapMultimap); + if (headerMapMultimap) + transfer_string_multimap_contents(headerMap, headerMapMultimap); + + // Execute + struct_->set_header_map(struct_, + headerMapMultimap); + + // Restore param:headerMap; type: string_map_multi_byref_const + if (headerMapMultimap) + cef_string_multimap_free(headerMapMultimap); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/response_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/response_ctocpp.h new file mode 100644 index 00000000000..8dd92d51964 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/response_ctocpp.h @@ -0,0 +1,49 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_response.h" +#include "include/capi/cef_response_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefResponseCToCpp + : public CefCToCpp { + public: + explicit CefResponseCToCpp(cef_response_t* str) + : CefCToCpp(str) {} + virtual ~CefResponseCToCpp() {} + + // CefResponse methods + virtual bool IsReadOnly() OVERRIDE; + virtual int GetStatus() OVERRIDE; + virtual void SetStatus(int status) OVERRIDE; + virtual CefString GetStatusText() OVERRIDE; + virtual void SetStatusText(const CefString& statusText) OVERRIDE; + virtual CefString GetMimeType() OVERRIDE; + virtual void SetMimeType(const CefString& mimeType) OVERRIDE; + virtual CefString GetHeader(const CefString& name) OVERRIDE; + virtual void GetHeaderMap(HeaderMap& headerMap) OVERRIDE; + virtual void SetHeaderMap(const HeaderMap& headerMap) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_RESPONSE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc new file mode 100644 index 00000000000..6416cadf417 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/scheme_registrar_ctocpp.cc @@ -0,0 +1,46 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefSchemeRegistrarCToCpp::AddCustomScheme(const CefString& scheme_name, + bool is_standard, bool is_local, bool is_display_isolated) { + if (CEF_MEMBER_MISSING(struct_, add_custom_scheme)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const + DCHECK(!scheme_name.empty()); + if (scheme_name.empty()) + return false; + + // Execute + int _retval = struct_->add_custom_scheme(struct_, + scheme_name.GetStruct(), + is_standard, + is_local, + is_display_isolated); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/scheme_registrar_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/scheme_registrar_ctocpp.h new file mode 100644 index 00000000000..14658e13572 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/scheme_registrar_ctocpp.h @@ -0,0 +1,43 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefSchemeRegistrarCToCpp + : public CefCToCpp { + public: + explicit CefSchemeRegistrarCToCpp(cef_scheme_registrar_t* str) + : CefCToCpp(str) {} + virtual ~CefSchemeRegistrarCToCpp() {} + + // CefSchemeRegistrar methods + virtual bool AddCustomScheme(const CefString& scheme_name, bool is_standard, + bool is_local, bool is_display_isolated) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_SCHEME_REGISTRAR_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/stream_reader_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/stream_reader_ctocpp.cc new file mode 100644 index 00000000000..62553adbc3b --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/stream_reader_ctocpp.cc @@ -0,0 +1,154 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/read_handler_cpptoc.h" +#include "libcef_dll/ctocpp/stream_reader_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefStreamReader::CreateForFile( + const CefString& fileName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return NULL; + + // Execute + cef_stream_reader_t* _retval = cef_stream_reader_create_for_file( + fileName.GetStruct()); + + // Return type: refptr_same + return CefStreamReaderCToCpp::Wrap(_retval); +} + +CefRefPtr CefStreamReader::CreateForData(void* data, + size_t size) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: data; type: simple_byaddr + DCHECK(data); + if (!data) + return NULL; + + // Execute + cef_stream_reader_t* _retval = cef_stream_reader_create_for_data( + data, + size); + + // Return type: refptr_same + return CefStreamReaderCToCpp::Wrap(_retval); +} + +CefRefPtr CefStreamReader::CreateForHandler( + CefRefPtr handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: handler; type: refptr_diff + DCHECK(handler.get()); + if (!handler.get()) + return NULL; + + // Execute + cef_stream_reader_t* _retval = cef_stream_reader_create_for_handler( + CefReadHandlerCppToC::Wrap(handler)); + + // Return type: refptr_same + return CefStreamReaderCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +size_t CefStreamReaderCToCpp::Read(void* ptr, size_t size, size_t n) { + if (CEF_MEMBER_MISSING(struct_, read)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = struct_->read(struct_, + ptr, + size, + n); + + // Return type: simple + return _retval; +} + +int CefStreamReaderCToCpp::Seek(int64 offset, int whence) { + if (CEF_MEMBER_MISSING(struct_, seek)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->seek(struct_, + offset, + whence); + + // Return type: simple + return _retval; +} + +int64 CefStreamReaderCToCpp::Tell() { + if (CEF_MEMBER_MISSING(struct_, tell)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; +} + +int CefStreamReaderCToCpp::Eof() { + if (CEF_MEMBER_MISSING(struct_, eof)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->eof(struct_); + + // Return type: simple + return _retval; +} + +bool CefStreamReaderCToCpp::MayBlock() { + if (CEF_MEMBER_MISSING(struct_, may_block)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->may_block(struct_); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/stream_reader_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/stream_reader_ctocpp.h new file mode 100644 index 00000000000..7b3f0b790dc --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/stream_reader_ctocpp.h @@ -0,0 +1,46 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefStreamReaderCToCpp + : public CefCToCpp { + public: + explicit CefStreamReaderCToCpp(cef_stream_reader_t* str) + : CefCToCpp( + str) {} + virtual ~CefStreamReaderCToCpp() {} + + // CefStreamReader methods + virtual size_t Read(void* ptr, size_t size, size_t n) OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; + virtual int Eof() OVERRIDE; + virtual bool MayBlock() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_STREAM_READER_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/stream_writer_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/stream_writer_ctocpp.cc new file mode 100644 index 00000000000..0ae76e394bf --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/stream_writer_ctocpp.cc @@ -0,0 +1,136 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/write_handler_cpptoc.h" +#include "libcef_dll/ctocpp/stream_writer_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefStreamWriter::CreateForFile( + const CefString& fileName) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return NULL; + + // Execute + cef_stream_writer_t* _retval = cef_stream_writer_create_for_file( + fileName.GetStruct()); + + // Return type: refptr_same + return CefStreamWriterCToCpp::Wrap(_retval); +} + +CefRefPtr CefStreamWriter::CreateForHandler( + CefRefPtr handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: handler; type: refptr_diff + DCHECK(handler.get()); + if (!handler.get()) + return NULL; + + // Execute + cef_stream_writer_t* _retval = cef_stream_writer_create_for_handler( + CefWriteHandlerCppToC::Wrap(handler)); + + // Return type: refptr_same + return CefStreamWriterCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +size_t CefStreamWriterCToCpp::Write(const void* ptr, size_t size, size_t n) { + if (CEF_MEMBER_MISSING(struct_, write)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: ptr; type: simple_byaddr + DCHECK(ptr); + if (!ptr) + return 0; + + // Execute + size_t _retval = struct_->write(struct_, + ptr, + size, + n); + + // Return type: simple + return _retval; +} + +int CefStreamWriterCToCpp::Seek(int64 offset, int whence) { + if (CEF_MEMBER_MISSING(struct_, seek)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->seek(struct_, + offset, + whence); + + // Return type: simple + return _retval; +} + +int64 CefStreamWriterCToCpp::Tell() { + if (CEF_MEMBER_MISSING(struct_, tell)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; +} + +int CefStreamWriterCToCpp::Flush() { + if (CEF_MEMBER_MISSING(struct_, flush)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->flush(struct_); + + // Return type: simple + return _retval; +} + +bool CefStreamWriterCToCpp::MayBlock() { + if (CEF_MEMBER_MISSING(struct_, may_block)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->may_block(struct_); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/stream_writer_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/stream_writer_ctocpp.h new file mode 100644 index 00000000000..6e1b5d77945 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/stream_writer_ctocpp.h @@ -0,0 +1,46 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_stream.h" +#include "include/capi/cef_stream_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefStreamWriterCToCpp + : public CefCToCpp { + public: + explicit CefStreamWriterCToCpp(cef_stream_writer_t* str) + : CefCToCpp( + str) {} + virtual ~CefStreamWriterCToCpp() {} + + // CefStreamWriter methods + virtual size_t Write(const void* ptr, size_t size, size_t n) OVERRIDE; + virtual int Seek(int64 offset, int whence) OVERRIDE; + virtual int64 Tell() OVERRIDE; + virtual int Flush() OVERRIDE; + virtual bool MayBlock() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_STREAM_WRITER_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/task_runner_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/task_runner_ctocpp.cc new file mode 100644 index 00000000000..f7288f914bb --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/task_runner_ctocpp.cc @@ -0,0 +1,134 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/task_cpptoc.h" +#include "libcef_dll/ctocpp/task_runner_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefTaskRunner::GetForCurrentThread() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_task_runner_t* _retval = cef_task_runner_get_for_current_thread(); + + // Return type: refptr_same + return CefTaskRunnerCToCpp::Wrap(_retval); +} + +CefRefPtr CefTaskRunner::GetForThread(CefThreadId threadId) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_task_runner_t* _retval = cef_task_runner_get_for_thread( + threadId); + + // Return type: refptr_same + return CefTaskRunnerCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefTaskRunnerCToCpp::IsSame(CefRefPtr that) { + if (CEF_MEMBER_MISSING(struct_, is_same)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefTaskRunnerCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; +} + +bool CefTaskRunnerCToCpp::BelongsToCurrentThread() { + if (CEF_MEMBER_MISSING(struct_, belongs_to_current_thread)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->belongs_to_current_thread(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefTaskRunnerCToCpp::BelongsToThread(CefThreadId threadId) { + if (CEF_MEMBER_MISSING(struct_, belongs_to_thread)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->belongs_to_thread(struct_, + threadId); + + // Return type: bool + return _retval?true:false; +} + +bool CefTaskRunnerCToCpp::PostTask(CefRefPtr task) { + if (CEF_MEMBER_MISSING(struct_, post_task)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = struct_->post_task(struct_, + CefTaskCppToC::Wrap(task)); + + // Return type: bool + return _retval?true:false; +} + +bool CefTaskRunnerCToCpp::PostDelayedTask(CefRefPtr task, + int64 delay_ms) { + if (CEF_MEMBER_MISSING(struct_, post_delayed_task)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = struct_->post_delayed_task(struct_, + CefTaskCppToC::Wrap(task), + delay_ms); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/task_runner_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/task_runner_ctocpp.h new file mode 100644 index 00000000000..39672c41217 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/task_runner_ctocpp.h @@ -0,0 +1,45 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_task.h" +#include "include/capi/cef_task_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefTaskRunnerCToCpp + : public CefCToCpp { + public: + explicit CefTaskRunnerCToCpp(cef_task_runner_t* str) + : CefCToCpp(str) {} + virtual ~CefTaskRunnerCToCpp() {} + + // CefTaskRunner methods + virtual bool IsSame(CefRefPtr that) OVERRIDE; + virtual bool BelongsToCurrentThread() OVERRIDE; + virtual bool BelongsToThread(CefThreadId threadId) OVERRIDE; + virtual bool PostTask(CefRefPtr task) OVERRIDE; + virtual bool PostDelayedTask(CefRefPtr task, + int64 delay_ms) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_TASK_RUNNER_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/urlrequest_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/urlrequest_ctocpp.cc new file mode 100644 index 00000000000..7099968470e --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/urlrequest_ctocpp.cc @@ -0,0 +1,126 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" +#include "libcef_dll/ctocpp/request_ctocpp.h" +#include "libcef_dll/ctocpp/response_ctocpp.h" +#include "libcef_dll/ctocpp/urlrequest_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefURLRequest::Create(CefRefPtr request, + CefRefPtr client) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: request; type: refptr_same + DCHECK(request.get()); + if (!request.get()) + return NULL; + // Verify param: client; type: refptr_diff + DCHECK(client.get()); + if (!client.get()) + return NULL; + + // Execute + cef_urlrequest_t* _retval = cef_urlrequest_create( + CefRequestCToCpp::Unwrap(request), + CefURLRequestClientCppToC::Wrap(client)); + + // Return type: refptr_same + return CefURLRequestCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefRefPtr CefURLRequestCToCpp::GetRequest() { + if (CEF_MEMBER_MISSING(struct_, get_request)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_request_t* _retval = struct_->get_request(struct_); + + // Return type: refptr_same + return CefRequestCToCpp::Wrap(_retval); +} + +CefRefPtr CefURLRequestCToCpp::GetClient() { + if (CEF_MEMBER_MISSING(struct_, get_client)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_urlrequest_client_t* _retval = struct_->get_client(struct_); + + // Return type: refptr_diff + return CefURLRequestClientCppToC::Unwrap(_retval); +} + +CefURLRequest::Status CefURLRequestCToCpp::GetRequestStatus() { + if (CEF_MEMBER_MISSING(struct_, get_request_status)) + return UR_UNKNOWN; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_urlrequest_status_t _retval = struct_->get_request_status(struct_); + + // Return type: simple + return _retval; +} + +CefURLRequest::ErrorCode CefURLRequestCToCpp::GetRequestError() { + if (CEF_MEMBER_MISSING(struct_, get_request_error)) + return ERR_NONE; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_errorcode_t _retval = struct_->get_request_error(struct_); + + // Return type: simple + return _retval; +} + +CefRefPtr CefURLRequestCToCpp::GetResponse() { + if (CEF_MEMBER_MISSING(struct_, get_response)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_response_t* _retval = struct_->get_response(struct_); + + // Return type: refptr_same + return CefResponseCToCpp::Wrap(_retval); +} + +void CefURLRequestCToCpp::Cancel() { + if (CEF_MEMBER_MISSING(struct_, cancel)) + return; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + struct_->cancel(struct_); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/urlrequest_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/urlrequest_ctocpp.h new file mode 100644 index 00000000000..b383d967ab8 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/urlrequest_ctocpp.h @@ -0,0 +1,45 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_urlrequest.h" +#include "include/capi/cef_urlrequest_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefURLRequestCToCpp + : public CefCToCpp { + public: + explicit CefURLRequestCToCpp(cef_urlrequest_t* str) + : CefCToCpp(str) {} + virtual ~CefURLRequestCToCpp() {} + + // CefURLRequest methods + virtual CefRefPtr GetRequest() OVERRIDE; + virtual CefRefPtr GetClient() OVERRIDE; + virtual Status GetRequestStatus() OVERRIDE; + virtual ErrorCode GetRequestError() OVERRIDE; + virtual CefRefPtr GetResponse() OVERRIDE; + virtual void Cancel() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_URLREQUEST_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8context_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/v8context_ctocpp.cc new file mode 100644 index 00000000000..8eaf6aac2c6 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8context_ctocpp.cc @@ -0,0 +1,221 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/task_runner_ctocpp.h" +#include "libcef_dll/ctocpp/v8context_ctocpp.h" +#include "libcef_dll/ctocpp/v8exception_ctocpp.h" +#include "libcef_dll/ctocpp/v8value_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefV8Context::GetCurrentContext() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8context_t* _retval = cef_v8context_get_current_context(); + + // Return type: refptr_same + return CefV8ContextCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Context::GetEnteredContext() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8context_t* _retval = cef_v8context_get_entered_context(); + + // Return type: refptr_same + return CefV8ContextCToCpp::Wrap(_retval); +} + +bool CefV8Context::InContext() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_v8context_in_context(); + + // Return type: bool + return _retval?true:false; +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefRefPtr CefV8ContextCToCpp::GetTaskRunner() { + if (CEF_MEMBER_MISSING(struct_, get_task_runner)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_task_runner_t* _retval = struct_->get_task_runner(struct_); + + // Return type: refptr_same + return CefTaskRunnerCToCpp::Wrap(_retval); +} + +bool CefV8ContextCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefV8ContextCToCpp::GetBrowser() { + if (CEF_MEMBER_MISSING(struct_, get_browser)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_browser_t* _retval = struct_->get_browser(struct_); + + // Return type: refptr_same + return CefBrowserCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8ContextCToCpp::GetFrame() { + if (CEF_MEMBER_MISSING(struct_, get_frame)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_frame_t* _retval = struct_->get_frame(struct_); + + // Return type: refptr_same + return CefFrameCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8ContextCToCpp::GetGlobal() { + if (CEF_MEMBER_MISSING(struct_, get_global)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = struct_->get_global(struct_); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +bool CefV8ContextCToCpp::Enter() { + if (CEF_MEMBER_MISSING(struct_, enter)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->enter(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ContextCToCpp::Exit() { + if (CEF_MEMBER_MISSING(struct_, exit)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->exit(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ContextCToCpp::IsSame(CefRefPtr that) { + if (CEF_MEMBER_MISSING(struct_, is_same)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefV8ContextCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ContextCToCpp::Eval(const CefString& code, + CefRefPtr& retval, CefRefPtr& exception) { + if (CEF_MEMBER_MISSING(struct_, eval)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: code; type: string_byref_const + DCHECK(!code.empty()); + if (code.empty()) + return false; + + // Translate param: retval; type: refptr_same_byref + cef_v8value_t* retvalStruct = NULL; + if (retval.get()) + retvalStruct = CefV8ValueCToCpp::Unwrap(retval); + cef_v8value_t* retvalOrig = retvalStruct; + // Translate param: exception; type: refptr_same_byref + cef_v8exception_t* exceptionStruct = NULL; + if (exception.get()) + exceptionStruct = CefV8ExceptionCToCpp::Unwrap(exception); + cef_v8exception_t* exceptionOrig = exceptionStruct; + + // Execute + int _retval = struct_->eval(struct_, + code.GetStruct(), + &retvalStruct, + &exceptionStruct); + + // Restore param:retval; type: refptr_same_byref + if (retvalStruct) { + if (retvalStruct != retvalOrig) { + retval = CefV8ValueCToCpp::Wrap(retvalStruct); + } + } else { + retval = NULL; + } + // Restore param:exception; type: refptr_same_byref + if (exceptionStruct) { + if (exceptionStruct != exceptionOrig) { + exception = CefV8ExceptionCToCpp::Wrap(exceptionStruct); + } + } else { + exception = NULL; + } + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8context_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/v8context_ctocpp.h new file mode 100644 index 00000000000..bc87bdad99c --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8context_ctocpp.h @@ -0,0 +1,49 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefV8ContextCToCpp + : public CefCToCpp { + public: + explicit CefV8ContextCToCpp(cef_v8context_t* str) + : CefCToCpp(str) {} + virtual ~CefV8ContextCToCpp() {} + + // CefV8Context methods + virtual CefRefPtr GetTaskRunner() OVERRIDE; + virtual bool IsValid() OVERRIDE; + virtual CefRefPtr GetBrowser() OVERRIDE; + virtual CefRefPtr GetFrame() OVERRIDE; + virtual CefRefPtr GetGlobal() OVERRIDE; + virtual bool Enter() OVERRIDE; + virtual bool Exit() OVERRIDE; + virtual bool IsSame(CefRefPtr that) OVERRIDE; + virtual bool Eval(const CefString& code, CefRefPtr& retval, + CefRefPtr& exception) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8CONTEXT_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8exception_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/v8exception_ctocpp.cc new file mode 100644 index 00000000000..2629704c94f --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8exception_ctocpp.cc @@ -0,0 +1,133 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/v8exception_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefString CefV8ExceptionCToCpp::GetMessage() { + if (CEF_MEMBER_MISSING(struct_, get_message)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_message(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefV8ExceptionCToCpp::GetSourceLine() { + if (CEF_MEMBER_MISSING(struct_, get_source_line)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_source_line(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefV8ExceptionCToCpp::GetScriptResourceName() { + if (CEF_MEMBER_MISSING(struct_, get_script_resource_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_script_resource_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +int CefV8ExceptionCToCpp::GetLineNumber() { + if (CEF_MEMBER_MISSING(struct_, get_line_number)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_line_number(struct_); + + // Return type: simple + return _retval; +} + +int CefV8ExceptionCToCpp::GetStartPosition() { + if (CEF_MEMBER_MISSING(struct_, get_start_position)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_start_position(struct_); + + // Return type: simple + return _retval; +} + +int CefV8ExceptionCToCpp::GetEndPosition() { + if (CEF_MEMBER_MISSING(struct_, get_end_position)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_end_position(struct_); + + // Return type: simple + return _retval; +} + +int CefV8ExceptionCToCpp::GetStartColumn() { + if (CEF_MEMBER_MISSING(struct_, get_start_column)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_start_column(struct_); + + // Return type: simple + return _retval; +} + +int CefV8ExceptionCToCpp::GetEndColumn() { + if (CEF_MEMBER_MISSING(struct_, get_end_column)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_end_column(struct_); + + // Return type: simple + return _retval; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8exception_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/v8exception_ctocpp.h new file mode 100644 index 00000000000..7ca626e55e6 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8exception_ctocpp.h @@ -0,0 +1,49 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefV8ExceptionCToCpp + : public CefCToCpp { + public: + explicit CefV8ExceptionCToCpp(cef_v8exception_t* str) + : CefCToCpp( + str) {} + virtual ~CefV8ExceptionCToCpp() {} + + // CefV8Exception methods + virtual CefString GetMessage() OVERRIDE; + virtual CefString GetSourceLine() OVERRIDE; + virtual CefString GetScriptResourceName() OVERRIDE; + virtual int GetLineNumber() OVERRIDE; + virtual int GetStartPosition() OVERRIDE; + virtual int GetEndPosition() OVERRIDE; + virtual int GetStartColumn() OVERRIDE; + virtual int GetEndColumn() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8EXCEPTION_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc new file mode 100644 index 00000000000..959460314e6 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8stack_frame_ctocpp.cc @@ -0,0 +1,134 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/v8stack_frame_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefV8StackFrameCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefV8StackFrameCToCpp::GetScriptName() { + if (CEF_MEMBER_MISSING(struct_, get_script_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_script_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefV8StackFrameCToCpp::GetScriptNameOrSourceURL() { + if (CEF_MEMBER_MISSING(struct_, get_script_name_or_source_url)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_script_name_or_source_url( + struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefV8StackFrameCToCpp::GetFunctionName() { + if (CEF_MEMBER_MISSING(struct_, get_function_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_function_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +int CefV8StackFrameCToCpp::GetLineNumber() { + if (CEF_MEMBER_MISSING(struct_, get_line_number)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_line_number(struct_); + + // Return type: simple + return _retval; +} + +int CefV8StackFrameCToCpp::GetColumn() { + if (CEF_MEMBER_MISSING(struct_, get_column)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_column(struct_); + + // Return type: simple + return _retval; +} + +bool CefV8StackFrameCToCpp::IsEval() { + if (CEF_MEMBER_MISSING(struct_, is_eval)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_eval(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8StackFrameCToCpp::IsConstructor() { + if (CEF_MEMBER_MISSING(struct_, is_constructor)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_constructor(struct_); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8stack_frame_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/v8stack_frame_ctocpp.h new file mode 100644 index 00000000000..a6c1fa51ad0 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8stack_frame_ctocpp.h @@ -0,0 +1,49 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefV8StackFrameCToCpp + : public CefCToCpp { + public: + explicit CefV8StackFrameCToCpp(cef_v8stack_frame_t* str) + : CefCToCpp( + str) {} + virtual ~CefV8StackFrameCToCpp() {} + + // CefV8StackFrame methods + virtual bool IsValid() OVERRIDE; + virtual CefString GetScriptName() OVERRIDE; + virtual CefString GetScriptNameOrSourceURL() OVERRIDE; + virtual CefString GetFunctionName() OVERRIDE; + virtual int GetLineNumber() OVERRIDE; + virtual int GetColumn() OVERRIDE; + virtual bool IsEval() OVERRIDE; + virtual bool IsConstructor() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8STACK_FRAME_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc new file mode 100644 index 00000000000..661aa337f26 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8stack_trace_ctocpp.cc @@ -0,0 +1,78 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/v8stack_frame_ctocpp.h" +#include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefV8StackTrace::GetCurrent(int frame_limit) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8stack_trace_t* _retval = cef_v8stack_trace_get_current( + frame_limit); + + // Return type: refptr_same + return CefV8StackTraceCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefV8StackTraceCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +int CefV8StackTraceCToCpp::GetFrameCount() { + if (CEF_MEMBER_MISSING(struct_, get_frame_count)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_frame_count(struct_); + + // Return type: simple + return _retval; +} + +CefRefPtr CefV8StackTraceCToCpp::GetFrame(int index) { + if (CEF_MEMBER_MISSING(struct_, get_frame)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8stack_frame_t* _retval = struct_->get_frame(struct_, + index); + + // Return type: refptr_same + return CefV8StackFrameCToCpp::Wrap(_retval); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8stack_trace_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/v8stack_trace_ctocpp.h new file mode 100644 index 00000000000..e94e2ec77aa --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8stack_trace_ctocpp.h @@ -0,0 +1,44 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefV8StackTraceCToCpp + : public CefCToCpp { + public: + explicit CefV8StackTraceCToCpp(cef_v8stack_trace_t* str) + : CefCToCpp( + str) {} + virtual ~CefV8StackTraceCToCpp() {} + + // CefV8StackTrace methods + virtual bool IsValid() OVERRIDE; + virtual int GetFrameCount() OVERRIDE; + virtual CefRefPtr GetFrame(int index) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8STACK_TRACE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8value_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/v8value_ctocpp.cc new file mode 100644 index 00000000000..1fd71bab021 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8value_ctocpp.cc @@ -0,0 +1,874 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/cpptoc/base_cpptoc.h" +#include "libcef_dll/cpptoc/v8accessor_cpptoc.h" +#include "libcef_dll/cpptoc/v8handler_cpptoc.h" +#include "libcef_dll/ctocpp/v8context_ctocpp.h" +#include "libcef_dll/ctocpp/v8exception_ctocpp.h" +#include "libcef_dll/ctocpp/v8value_ctocpp.h" +#include "libcef_dll/transfer_util.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefV8Value::CreateUndefined() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_undefined(); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateNull() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_null(); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateBool(bool value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_bool( + value); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateInt(int32 value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_int( + value); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateUInt(uint32 value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_uint( + value); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateDouble(double value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_double( + value); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateDate(const CefTime& date) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_date( + &date); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateString(const CefString& value) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: value + + // Execute + cef_v8value_t* _retval = cef_v8value_create_string( + value.GetStruct()); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateObject( + CefRefPtr accessor) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: accessor + + // Execute + cef_v8value_t* _retval = cef_v8value_create_object( + CefV8AccessorCppToC::Wrap(accessor)); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateArray(int length) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8value_t* _retval = cef_v8value_create_array( + length); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8Value::CreateFunction(const CefString& name, + CefRefPtr handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: name; type: string_byref_const + DCHECK(!name.empty()); + if (name.empty()) + return NULL; + // Verify param: handler; type: refptr_diff + DCHECK(handler.get()); + if (!handler.get()) + return NULL; + + // Execute + cef_v8value_t* _retval = cef_v8value_create_function( + name.GetStruct(), + CefV8HandlerCppToC::Wrap(handler)); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefV8ValueCToCpp::IsValid() { + if (CEF_MEMBER_MISSING(struct_, is_valid)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_valid(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsUndefined() { + if (CEF_MEMBER_MISSING(struct_, is_undefined)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_undefined(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsNull() { + if (CEF_MEMBER_MISSING(struct_, is_null)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_null(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsBool() { + if (CEF_MEMBER_MISSING(struct_, is_bool)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_bool(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsInt() { + if (CEF_MEMBER_MISSING(struct_, is_int)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_int(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsUInt() { + if (CEF_MEMBER_MISSING(struct_, is_uint)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_uint(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsDouble() { + if (CEF_MEMBER_MISSING(struct_, is_double)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_double(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsDate() { + if (CEF_MEMBER_MISSING(struct_, is_date)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_date(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsString() { + if (CEF_MEMBER_MISSING(struct_, is_string)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_string(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsObject() { + if (CEF_MEMBER_MISSING(struct_, is_object)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_object(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsArray() { + if (CEF_MEMBER_MISSING(struct_, is_array)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_array(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsFunction() { + if (CEF_MEMBER_MISSING(struct_, is_function)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_function(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::IsSame(CefRefPtr that) { + if (CEF_MEMBER_MISSING(struct_, is_same)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: that; type: refptr_same + DCHECK(that.get()); + if (!that.get()) + return false; + + // Execute + int _retval = struct_->is_same(struct_, + CefV8ValueCToCpp::Unwrap(that)); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::GetBoolValue() { + if (CEF_MEMBER_MISSING(struct_, get_bool_value)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_bool_value(struct_); + + // Return type: bool + return _retval?true:false; +} + +int32 CefV8ValueCToCpp::GetIntValue() { + if (CEF_MEMBER_MISSING(struct_, get_int_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int32 _retval = struct_->get_int_value(struct_); + + // Return type: simple + return _retval; +} + +uint32 CefV8ValueCToCpp::GetUIntValue() { + if (CEF_MEMBER_MISSING(struct_, get_uint_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + uint32 _retval = struct_->get_uint_value(struct_); + + // Return type: simple + return _retval; +} + +double CefV8ValueCToCpp::GetDoubleValue() { + if (CEF_MEMBER_MISSING(struct_, get_double_value)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + double _retval = struct_->get_double_value(struct_); + + // Return type: simple + return _retval; +} + +CefTime CefV8ValueCToCpp::GetDateValue() { + if (CEF_MEMBER_MISSING(struct_, get_date_value)) + return CefTime(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_time_t _retval = struct_->get_date_value(struct_); + + // Return type: simple + return _retval; +} + +CefString CefV8ValueCToCpp::GetStringValue() { + if (CEF_MEMBER_MISSING(struct_, get_string_value)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_string_value(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefV8ValueCToCpp::IsUserCreated() { + if (CEF_MEMBER_MISSING(struct_, is_user_created)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_user_created(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::HasException() { + if (CEF_MEMBER_MISSING(struct_, has_exception)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_exception(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefV8ValueCToCpp::GetException() { + if (CEF_MEMBER_MISSING(struct_, get_exception)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8exception_t* _retval = struct_->get_exception(struct_); + + // Return type: refptr_same + return CefV8ExceptionCToCpp::Wrap(_retval); +} + +bool CefV8ValueCToCpp::ClearException() { + if (CEF_MEMBER_MISSING(struct_, clear_exception)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->clear_exception(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::WillRethrowExceptions() { + if (CEF_MEMBER_MISSING(struct_, will_rethrow_exceptions)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->will_rethrow_exceptions(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::SetRethrowExceptions(bool rethrow) { + if (CEF_MEMBER_MISSING(struct_, set_rethrow_exceptions)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->set_rethrow_exceptions(struct_, + rethrow); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::HasValue(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, has_value_bykey)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: key + + // Execute + int _retval = struct_->has_value_bykey(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::HasValue(int index) { + if (CEF_MEMBER_MISSING(struct_, has_value_byindex)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->has_value_byindex(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::DeleteValue(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, delete_value_bykey)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: key + + // Execute + int _retval = struct_->delete_value_bykey(struct_, + key.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::DeleteValue(int index) { + if (CEF_MEMBER_MISSING(struct_, delete_value_byindex)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->delete_value_byindex(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefV8ValueCToCpp::GetValue(const CefString& key) { + if (CEF_MEMBER_MISSING(struct_, get_value_bykey)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: key + + // Execute + cef_v8value_t* _retval = struct_->get_value_bykey(struct_, + key.GetStruct()); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8ValueCToCpp::GetValue(int index) { + if (CEF_MEMBER_MISSING(struct_, get_value_byindex)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return NULL; + + // Execute + cef_v8value_t* _retval = struct_->get_value_byindex(struct_, + index); + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +bool CefV8ValueCToCpp::SetValue(const CefString& key, + CefRefPtr value, PropertyAttribute attribute) { + if (CEF_MEMBER_MISSING(struct_, set_value_bykey)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + // Unverified params: key + + // Execute + int _retval = struct_->set_value_bykey(struct_, + key.GetStruct(), + CefV8ValueCToCpp::Unwrap(value), + attribute); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::SetValue(int index, CefRefPtr value) { + if (CEF_MEMBER_MISSING(struct_, set_value_byindex)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + // Verify param: value; type: refptr_same + DCHECK(value.get()); + if (!value.get()) + return false; + + // Execute + int _retval = struct_->set_value_byindex(struct_, + index, + CefV8ValueCToCpp::Unwrap(value)); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::SetValue(const CefString& key, AccessControl settings, + PropertyAttribute attribute) { + if (CEF_MEMBER_MISSING(struct_, set_value_byaccessor)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: key + + // Execute + int _retval = struct_->set_value_byaccessor(struct_, + key.GetStruct(), + settings, + attribute); + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::GetKeys(std::vector& keys) { + if (CEF_MEMBER_MISSING(struct_, get_keys)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Translate param: keys; type: string_vec_byref + cef_string_list_t keysList = cef_string_list_alloc(); + DCHECK(keysList); + if (keysList) + transfer_string_list_contents(keys, keysList); + + // Execute + int _retval = struct_->get_keys(struct_, + keysList); + + // Restore param:keys; type: string_vec_byref + if (keysList) { + keys.clear(); + transfer_string_list_contents(keysList, keys); + cef_string_list_free(keysList); + } + + // Return type: bool + return _retval?true:false; +} + +bool CefV8ValueCToCpp::SetUserData(CefRefPtr user_data) { + if (CEF_MEMBER_MISSING(struct_, set_user_data)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: user_data + + // Execute + int _retval = struct_->set_user_data(struct_, + CefBaseCppToC::Wrap(user_data)); + + // Return type: bool + return _retval?true:false; +} + +CefRefPtr CefV8ValueCToCpp::GetUserData() { + if (CEF_MEMBER_MISSING(struct_, get_user_data)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_base_t* _retval = struct_->get_user_data(struct_); + + // Return type: refptr_diff + return CefBaseCppToC::Unwrap(_retval); +} + +int CefV8ValueCToCpp::GetExternallyAllocatedMemory() { + if (CEF_MEMBER_MISSING(struct_, get_externally_allocated_memory)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_externally_allocated_memory(struct_); + + // Return type: simple + return _retval; +} + +int CefV8ValueCToCpp::AdjustExternallyAllocatedMemory(int change_in_bytes) { + if (CEF_MEMBER_MISSING(struct_, adjust_externally_allocated_memory)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->adjust_externally_allocated_memory(struct_, + change_in_bytes); + + // Return type: simple + return _retval; +} + +int CefV8ValueCToCpp::GetArrayLength() { + if (CEF_MEMBER_MISSING(struct_, get_array_length)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_array_length(struct_); + + // Return type: simple + return _retval; +} + +CefString CefV8ValueCToCpp::GetFunctionName() { + if (CEF_MEMBER_MISSING(struct_, get_function_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_function_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefRefPtr CefV8ValueCToCpp::GetFunctionHandler() { + if (CEF_MEMBER_MISSING(struct_, get_function_handler)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_v8handler_t* _retval = struct_->get_function_handler(struct_); + + // Return type: refptr_diff + return CefV8HandlerCppToC::Unwrap(_retval); +} + +CefRefPtr CefV8ValueCToCpp::ExecuteFunction( + CefRefPtr object, const CefV8ValueList& arguments) { + if (CEF_MEMBER_MISSING(struct_, execute_function)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: object + + // Translate param: arguments; type: refptr_vec_same_byref_const + const size_t argumentsCount = arguments.size(); + cef_v8value_t** argumentsList = NULL; + if (argumentsCount > 0) { + argumentsList = new cef_v8value_t*[argumentsCount]; + DCHECK(argumentsList); + if (argumentsList) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList[i] = CefV8ValueCToCpp::Unwrap(arguments[i]); + } + } + } + + // Execute + cef_v8value_t* _retval = struct_->execute_function(struct_, + CefV8ValueCToCpp::Unwrap(object), + argumentsCount, + argumentsList); + + // Restore param:arguments; type: refptr_vec_same_byref_const + if (argumentsList) + delete [] argumentsList; + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + +CefRefPtr CefV8ValueCToCpp::ExecuteFunctionWithContext( + CefRefPtr context, CefRefPtr object, + const CefV8ValueList& arguments) { + if (CEF_MEMBER_MISSING(struct_, execute_function_with_context)) + return NULL; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: context; type: refptr_same + DCHECK(context.get()); + if (!context.get()) + return NULL; + // Unverified params: object + + // Translate param: arguments; type: refptr_vec_same_byref_const + const size_t argumentsCount = arguments.size(); + cef_v8value_t** argumentsList = NULL; + if (argumentsCount > 0) { + argumentsList = new cef_v8value_t*[argumentsCount]; + DCHECK(argumentsList); + if (argumentsList) { + for (size_t i = 0; i < argumentsCount; ++i) { + argumentsList[i] = CefV8ValueCToCpp::Unwrap(arguments[i]); + } + } + } + + // Execute + cef_v8value_t* _retval = struct_->execute_function_with_context(struct_, + CefV8ContextCToCpp::Unwrap(context), + CefV8ValueCToCpp::Unwrap(object), + argumentsCount, + argumentsList); + + // Restore param:arguments; type: refptr_vec_same_byref_const + if (argumentsList) + delete [] argumentsList; + + // Return type: refptr_same + return CefV8ValueCToCpp::Wrap(_retval); +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/v8value_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/v8value_ctocpp.h new file mode 100644 index 00000000000..fb3b168c700 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/v8value_ctocpp.h @@ -0,0 +1,89 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefV8ValueCToCpp + : public CefCToCpp { + public: + explicit CefV8ValueCToCpp(cef_v8value_t* str) + : CefCToCpp(str) {} + virtual ~CefV8ValueCToCpp() {} + + // CefV8Value methods + virtual bool IsValid() OVERRIDE; + virtual bool IsUndefined() OVERRIDE; + virtual bool IsNull() OVERRIDE; + virtual bool IsBool() OVERRIDE; + virtual bool IsInt() OVERRIDE; + virtual bool IsUInt() OVERRIDE; + virtual bool IsDouble() OVERRIDE; + virtual bool IsDate() OVERRIDE; + virtual bool IsString() OVERRIDE; + virtual bool IsObject() OVERRIDE; + virtual bool IsArray() OVERRIDE; + virtual bool IsFunction() OVERRIDE; + virtual bool IsSame(CefRefPtr that) OVERRIDE; + virtual bool GetBoolValue() OVERRIDE; + virtual int32 GetIntValue() OVERRIDE; + virtual uint32 GetUIntValue() OVERRIDE; + virtual double GetDoubleValue() OVERRIDE; + virtual CefTime GetDateValue() OVERRIDE; + virtual CefString GetStringValue() OVERRIDE; + virtual bool IsUserCreated() OVERRIDE; + virtual bool HasException() OVERRIDE; + virtual CefRefPtr GetException() OVERRIDE; + virtual bool ClearException() OVERRIDE; + virtual bool WillRethrowExceptions() OVERRIDE; + virtual bool SetRethrowExceptions(bool rethrow) OVERRIDE; + virtual bool HasValue(const CefString& key) OVERRIDE; + virtual bool HasValue(int index) OVERRIDE; + virtual bool DeleteValue(const CefString& key) OVERRIDE; + virtual bool DeleteValue(int index) OVERRIDE; + virtual CefRefPtr GetValue(const CefString& key) OVERRIDE; + virtual CefRefPtr GetValue(int index) OVERRIDE; + virtual bool SetValue(const CefString& key, CefRefPtr value, + PropertyAttribute attribute) OVERRIDE; + virtual bool SetValue(int index, CefRefPtr value) OVERRIDE; + virtual bool SetValue(const CefString& key, AccessControl settings, + PropertyAttribute attribute) OVERRIDE; + virtual bool GetKeys(std::vector& keys) OVERRIDE; + virtual bool SetUserData(CefRefPtr user_data) OVERRIDE; + virtual CefRefPtr GetUserData() OVERRIDE; + virtual int GetExternallyAllocatedMemory() OVERRIDE; + virtual int AdjustExternallyAllocatedMemory(int change_in_bytes) OVERRIDE; + virtual int GetArrayLength() OVERRIDE; + virtual CefString GetFunctionName() OVERRIDE; + virtual CefRefPtr GetFunctionHandler() OVERRIDE; + virtual CefRefPtr ExecuteFunction(CefRefPtr object, + const CefV8ValueList& arguments) OVERRIDE; + virtual CefRefPtr ExecuteFunctionWithContext( + CefRefPtr context, CefRefPtr object, + const CefV8ValueList& arguments) OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_V8VALUE_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc new file mode 100644 index 00000000000..196b14912f8 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/web_plugin_info_ctocpp.cc @@ -0,0 +1,83 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" + + +// VIRTUAL METHODS - Body may be edited by hand. + +CefString CefWebPluginInfoCToCpp::GetName() { + if (CEF_MEMBER_MISSING(struct_, get_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefWebPluginInfoCToCpp::GetPath() { + if (CEF_MEMBER_MISSING(struct_, get_path)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_path(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefWebPluginInfoCToCpp::GetVersion() { + if (CEF_MEMBER_MISSING(struct_, get_version)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_version(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefWebPluginInfoCToCpp::GetDescription() { + if (CEF_MEMBER_MISSING(struct_, get_description)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_description(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/web_plugin_info_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/web_plugin_info_ctocpp.h new file mode 100644 index 00000000000..b241d877aee --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/web_plugin_info_ctocpp.h @@ -0,0 +1,45 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_web_plugin.h" +#include "include/capi/cef_web_plugin_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefWebPluginInfoCToCpp + : public CefCToCpp { + public: + explicit CefWebPluginInfoCToCpp(cef_web_plugin_info_t* str) + : CefCToCpp(str) {} + virtual ~CefWebPluginInfoCToCpp() {} + + // CefWebPluginInfo methods + virtual CefString GetName() OVERRIDE; + virtual CefString GetPath() OVERRIDE; + virtual CefString GetVersion() OVERRIDE; + virtual CefString GetDescription() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_WEB_PLUGIN_INFO_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/xml_reader_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/xml_reader_ctocpp.cc new file mode 100644 index 00000000000..4c4667b0deb --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/xml_reader_ctocpp.cc @@ -0,0 +1,501 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/stream_reader_ctocpp.h" +#include "libcef_dll/ctocpp/xml_reader_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefXmlReader::Create(CefRefPtr stream, + EncodingType encodingType, const CefString& URI) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: stream; type: refptr_same + DCHECK(stream.get()); + if (!stream.get()) + return NULL; + // Verify param: URI; type: string_byref_const + DCHECK(!URI.empty()); + if (URI.empty()) + return NULL; + + // Execute + cef_xml_reader_t* _retval = cef_xml_reader_create( + CefStreamReaderCToCpp::Unwrap(stream), + encodingType, + URI.GetStruct()); + + // Return type: refptr_same + return CefXmlReaderCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefXmlReaderCToCpp::MoveToNextNode() { + if (CEF_MEMBER_MISSING(struct_, move_to_next_node)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_next_node(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::Close() { + if (CEF_MEMBER_MISSING(struct_, close)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->close(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::HasError() { + if (CEF_MEMBER_MISSING(struct_, has_error)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_error(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefXmlReaderCToCpp::GetError() { + if (CEF_MEMBER_MISSING(struct_, get_error)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_error(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefXmlReader::NodeType CefXmlReaderCToCpp::GetType() { + if (CEF_MEMBER_MISSING(struct_, get_type)) + return XML_NODE_UNSUPPORTED; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_xml_node_type_t _retval = struct_->get_type(struct_); + + // Return type: simple + return _retval; +} + +int CefXmlReaderCToCpp::GetDepth() { + if (CEF_MEMBER_MISSING(struct_, get_depth)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_depth(struct_); + + // Return type: simple + return _retval; +} + +CefString CefXmlReaderCToCpp::GetLocalName() { + if (CEF_MEMBER_MISSING(struct_, get_local_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_local_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetPrefix() { + if (CEF_MEMBER_MISSING(struct_, get_prefix)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_prefix(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetQualifiedName() { + if (CEF_MEMBER_MISSING(struct_, get_qualified_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_qualified_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetNamespaceURI() { + if (CEF_MEMBER_MISSING(struct_, get_namespace_uri)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_namespace_uri(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetBaseURI() { + if (CEF_MEMBER_MISSING(struct_, get_base_uri)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_base_uri(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetXmlLang() { + if (CEF_MEMBER_MISSING(struct_, get_xml_lang)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_xml_lang(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefXmlReaderCToCpp::IsEmptyElement() { + if (CEF_MEMBER_MISSING(struct_, is_empty_element)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->is_empty_element(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::HasValue() { + if (CEF_MEMBER_MISSING(struct_, has_value)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_value(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefXmlReaderCToCpp::GetValue() { + if (CEF_MEMBER_MISSING(struct_, get_value)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_value(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +bool CefXmlReaderCToCpp::HasAttributes() { + if (CEF_MEMBER_MISSING(struct_, has_attributes)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->has_attributes(struct_); + + // Return type: bool + return _retval?true:false; +} + +size_t CefXmlReaderCToCpp::GetAttributeCount() { + if (CEF_MEMBER_MISSING(struct_, get_attribute_count)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + size_t _retval = struct_->get_attribute_count(struct_); + + // Return type: simple + return _retval; +} + +CefString CefXmlReaderCToCpp::GetAttribute(int index) { + if (CEF_MEMBER_MISSING(struct_, get_attribute_byindex)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_attribute_byindex(struct_, + index); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetAttribute(const CefString& qualifiedName) { + if (CEF_MEMBER_MISSING(struct_, get_attribute_byqname)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: qualifiedName; type: string_byref_const + DCHECK(!qualifiedName.empty()); + if (qualifiedName.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_attribute_byqname(struct_, + qualifiedName.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetAttribute(const CefString& localName, + const CefString& namespaceURI) { + if (CEF_MEMBER_MISSING(struct_, get_attribute_bylname)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: localName; type: string_byref_const + DCHECK(!localName.empty()); + if (localName.empty()) + return CefString(); + // Verify param: namespaceURI; type: string_byref_const + DCHECK(!namespaceURI.empty()); + if (namespaceURI.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = struct_->get_attribute_bylname(struct_, + localName.GetStruct(), + namespaceURI.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetInnerXml() { + if (CEF_MEMBER_MISSING(struct_, get_inner_xml)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_inner_xml(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CefString CefXmlReaderCToCpp::GetOuterXml() { + if (CEF_MEMBER_MISSING(struct_, get_outer_xml)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_outer_xml(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +int CefXmlReaderCToCpp::GetLineNumber() { + if (CEF_MEMBER_MISSING(struct_, get_line_number)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->get_line_number(struct_); + + // Return type: simple + return _retval; +} + +bool CefXmlReaderCToCpp::MoveToAttribute(int index) { + if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byindex)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: index; type: simple_byval + DCHECK_GE(index, 0); + if (index < 0) + return false; + + // Execute + int _retval = struct_->move_to_attribute_byindex(struct_, + index); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& qualifiedName) { + if (CEF_MEMBER_MISSING(struct_, move_to_attribute_byqname)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: qualifiedName; type: string_byref_const + DCHECK(!qualifiedName.empty()); + if (qualifiedName.empty()) + return false; + + // Execute + int _retval = struct_->move_to_attribute_byqname(struct_, + qualifiedName.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::MoveToAttribute(const CefString& localName, + const CefString& namespaceURI) { + if (CEF_MEMBER_MISSING(struct_, move_to_attribute_bylname)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: localName; type: string_byref_const + DCHECK(!localName.empty()); + if (localName.empty()) + return false; + // Verify param: namespaceURI; type: string_byref_const + DCHECK(!namespaceURI.empty()); + if (namespaceURI.empty()) + return false; + + // Execute + int _retval = struct_->move_to_attribute_bylname(struct_, + localName.GetStruct(), + namespaceURI.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::MoveToFirstAttribute() { + if (CEF_MEMBER_MISSING(struct_, move_to_first_attribute)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_first_attribute(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::MoveToNextAttribute() { + if (CEF_MEMBER_MISSING(struct_, move_to_next_attribute)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_next_attribute(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefXmlReaderCToCpp::MoveToCarryingElement() { + if (CEF_MEMBER_MISSING(struct_, move_to_carrying_element)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_carrying_element(struct_); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/xml_reader_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/xml_reader_ctocpp.h new file mode 100644 index 00000000000..a997b8807c7 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/xml_reader_ctocpp.h @@ -0,0 +1,70 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_xml_reader.h" +#include "include/capi/cef_xml_reader_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefXmlReaderCToCpp + : public CefCToCpp { + public: + explicit CefXmlReaderCToCpp(cef_xml_reader_t* str) + : CefCToCpp(str) {} + virtual ~CefXmlReaderCToCpp() {} + + // CefXmlReader methods + virtual bool MoveToNextNode() OVERRIDE; + virtual bool Close() OVERRIDE; + virtual bool HasError() OVERRIDE; + virtual CefString GetError() OVERRIDE; + virtual NodeType GetType() OVERRIDE; + virtual int GetDepth() OVERRIDE; + virtual CefString GetLocalName() OVERRIDE; + virtual CefString GetPrefix() OVERRIDE; + virtual CefString GetQualifiedName() OVERRIDE; + virtual CefString GetNamespaceURI() OVERRIDE; + virtual CefString GetBaseURI() OVERRIDE; + virtual CefString GetXmlLang() OVERRIDE; + virtual bool IsEmptyElement() OVERRIDE; + virtual bool HasValue() OVERRIDE; + virtual CefString GetValue() OVERRIDE; + virtual bool HasAttributes() OVERRIDE; + virtual size_t GetAttributeCount() OVERRIDE; + virtual CefString GetAttribute(int index) OVERRIDE; + virtual CefString GetAttribute(const CefString& qualifiedName) OVERRIDE; + virtual CefString GetAttribute(const CefString& localName, + const CefString& namespaceURI) OVERRIDE; + virtual CefString GetInnerXml() OVERRIDE; + virtual CefString GetOuterXml() OVERRIDE; + virtual int GetLineNumber() OVERRIDE; + virtual bool MoveToAttribute(int index) OVERRIDE; + virtual bool MoveToAttribute(const CefString& qualifiedName) OVERRIDE; + virtual bool MoveToAttribute(const CefString& localName, + const CefString& namespaceURI) OVERRIDE; + virtual bool MoveToFirstAttribute() OVERRIDE; + virtual bool MoveToNextAttribute() OVERRIDE; + virtual bool MoveToCarryingElement() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_XML_READER_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/ctocpp/zip_reader_ctocpp.cc b/vendor/cef3/libcef_dll/ctocpp/zip_reader_ctocpp.cc new file mode 100644 index 00000000000..576247bdb3a --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/zip_reader_ctocpp.cc @@ -0,0 +1,220 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "libcef_dll/ctocpp/stream_reader_ctocpp.h" +#include "libcef_dll/ctocpp/zip_reader_ctocpp.h" + + +// STATIC METHODS - Body may be edited by hand. + +CefRefPtr CefZipReader::Create( + CefRefPtr stream) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: stream; type: refptr_same + DCHECK(stream.get()); + if (!stream.get()) + return NULL; + + // Execute + cef_zip_reader_t* _retval = cef_zip_reader_create( + CefStreamReaderCToCpp::Unwrap(stream)); + + // Return type: refptr_same + return CefZipReaderCToCpp::Wrap(_retval); +} + + +// VIRTUAL METHODS - Body may be edited by hand. + +bool CefZipReaderCToCpp::MoveToFirstFile() { + if (CEF_MEMBER_MISSING(struct_, move_to_first_file)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_first_file(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefZipReaderCToCpp::MoveToNextFile() { + if (CEF_MEMBER_MISSING(struct_, move_to_next_file)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->move_to_next_file(struct_); + + // Return type: bool + return _retval?true:false; +} + +bool CefZipReaderCToCpp::MoveToFile(const CefString& fileName, + bool caseSensitive) { + if (CEF_MEMBER_MISSING(struct_, move_to_file)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: fileName; type: string_byref_const + DCHECK(!fileName.empty()); + if (fileName.empty()) + return false; + + // Execute + int _retval = struct_->move_to_file(struct_, + fileName.GetStruct(), + caseSensitive); + + // Return type: bool + return _retval?true:false; +} + +bool CefZipReaderCToCpp::Close() { + if (CEF_MEMBER_MISSING(struct_, close)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->close(struct_); + + // Return type: bool + return _retval?true:false; +} + +CefString CefZipReaderCToCpp::GetFileName() { + if (CEF_MEMBER_MISSING(struct_, get_file_name)) + return CefString(); + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_string_userfree_t _retval = struct_->get_file_name(struct_); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +int64 CefZipReaderCToCpp::GetFileSize() { + if (CEF_MEMBER_MISSING(struct_, get_file_size)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->get_file_size(struct_); + + // Return type: simple + return _retval; +} + +time_t CefZipReaderCToCpp::GetFileLastModified() { + if (CEF_MEMBER_MISSING(struct_, get_file_last_modified)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + time_t _retval = struct_->get_file_last_modified(struct_); + + // Return type: simple + return _retval; +} + +bool CefZipReaderCToCpp::OpenFile(const CefString& password) { + if (CEF_MEMBER_MISSING(struct_, open_file)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: password + + // Execute + int _retval = struct_->open_file(struct_, + password.GetStruct()); + + // Return type: bool + return _retval?true:false; +} + +bool CefZipReaderCToCpp::CloseFile() { + if (CEF_MEMBER_MISSING(struct_, close_file)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->close_file(struct_); + + // Return type: bool + return _retval?true:false; +} + +int CefZipReaderCToCpp::ReadFile(void* buffer, size_t bufferSize) { + if (CEF_MEMBER_MISSING(struct_, read_file)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: buffer; type: simple_byaddr + DCHECK(buffer); + if (!buffer) + return 0; + + // Execute + int _retval = struct_->read_file(struct_, + buffer, + bufferSize); + + // Return type: simple + return _retval; +} + +int64 CefZipReaderCToCpp::Tell() { + if (CEF_MEMBER_MISSING(struct_, tell)) + return 0; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = struct_->tell(struct_); + + // Return type: simple + return _retval; +} + +bool CefZipReaderCToCpp::Eof() { + if (CEF_MEMBER_MISSING(struct_, eof)) + return false; + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = struct_->eof(struct_); + + // Return type: bool + return _retval?true:false; +} + + +#ifndef NDEBUG +template<> base::AtomicRefCount CefCToCpp::DebugObjCt = 0; +#endif + diff --git a/vendor/cef3/libcef_dll/ctocpp/zip_reader_ctocpp.h b/vendor/cef3/libcef_dll/ctocpp/zip_reader_ctocpp.h new file mode 100644 index 00000000000..4bf24604a30 --- /dev/null +++ b/vendor/cef3/libcef_dll/ctocpp/zip_reader_ctocpp.h @@ -0,0 +1,52 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#ifndef CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ +#define CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ +#pragma once + +#ifndef USING_CEF_SHARED +#pragma message("Warning: "__FILE__" may be accessed wrapper-side only") +#else // USING_CEF_SHARED + +#include "include/cef_zip_reader.h" +#include "include/capi/cef_zip_reader_capi.h" +#include "libcef_dll/ctocpp/ctocpp.h" + +// Wrap a C structure with a C++ class. +// This class may be instantiated and accessed wrapper-side only. +class CefZipReaderCToCpp + : public CefCToCpp { + public: + explicit CefZipReaderCToCpp(cef_zip_reader_t* str) + : CefCToCpp(str) {} + virtual ~CefZipReaderCToCpp() {} + + // CefZipReader methods + virtual bool MoveToFirstFile() OVERRIDE; + virtual bool MoveToNextFile() OVERRIDE; + virtual bool MoveToFile(const CefString& fileName, + bool caseSensitive) OVERRIDE; + virtual bool Close() OVERRIDE; + virtual CefString GetFileName() OVERRIDE; + virtual int64 GetFileSize() OVERRIDE; + virtual time_t GetFileLastModified() OVERRIDE; + virtual bool OpenFile(const CefString& password) OVERRIDE; + virtual bool CloseFile() OVERRIDE; + virtual int ReadFile(void* buffer, size_t bufferSize) OVERRIDE; + virtual int64 Tell() OVERRIDE; + virtual bool Eof() OVERRIDE; +}; + +#endif // USING_CEF_SHARED +#endif // CEF_LIBCEF_DLL_CTOCPP_ZIP_READER_CTOCPP_H_ + diff --git a/vendor/cef3/libcef_dll/transfer_util.cpp b/vendor/cef3/libcef_dll/transfer_util.cpp new file mode 100644 index 00000000000..e9d8d4e2206 --- /dev/null +++ b/vendor/cef3/libcef_dll/transfer_util.cpp @@ -0,0 +1,72 @@ +// Copyright (c) 2009 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. + +#include "transfer_util.h" + +void transfer_string_list_contents(cef_string_list_t fromList, + StringList& toList) +{ + int size = cef_string_list_size(fromList); + CefString value; + + for(int i = 0; i < size; i++) { + cef_string_list_value(fromList, i, value.GetWritableStruct()); + toList.push_back(value); + } +} + +void transfer_string_list_contents(const StringList& fromList, + cef_string_list_t toList) +{ + size_t size = fromList.size(); + for(size_t i = 0; i < size; ++i) + cef_string_list_append(toList, fromList[i].GetStruct()); +} + +void transfer_string_map_contents(cef_string_map_t fromMap, + StringMap& toMap) +{ + int size = cef_string_map_size(fromMap); + CefString key, value; + + for(int i = 0; i < size; ++i) { + cef_string_map_key(fromMap, i, key.GetWritableStruct()); + cef_string_map_value(fromMap, i, value.GetWritableStruct()); + + toMap.insert(std::make_pair(key, value)); + } +} + +void transfer_string_map_contents(const StringMap& fromMap, + cef_string_map_t toMap) +{ + StringMap::const_iterator it = fromMap.begin(); + for(; it != fromMap.end(); ++it) + cef_string_map_append(toMap, it->first.GetStruct(), it->second.GetStruct()); +} + +void transfer_string_multimap_contents(cef_string_multimap_t fromMap, + StringMultimap& toMap) +{ + int size = cef_string_multimap_size(fromMap); + CefString key, value; + + for(int i = 0; i < size; ++i) { + cef_string_multimap_key(fromMap, i, key.GetWritableStruct()); + cef_string_multimap_value(fromMap, i, value.GetWritableStruct()); + + toMap.insert(std::make_pair(key, value)); + } +} + +void transfer_string_multimap_contents(const StringMultimap& fromMap, + cef_string_multimap_t toMap) +{ + StringMultimap::const_iterator it = fromMap.begin(); + for(; it != fromMap.end(); ++it) { + cef_string_multimap_append(toMap, + it->first.GetStruct(), + it->second.GetStruct()); + } +} diff --git a/vendor/cef3/libcef_dll/transfer_util.h b/vendor/cef3/libcef_dll/transfer_util.h new file mode 100644 index 00000000000..88dff1a38dd --- /dev/null +++ b/vendor/cef3/libcef_dll/transfer_util.h @@ -0,0 +1,37 @@ +// Copyright (c) 2009 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. + +#ifndef CEF_LIBCEF_DLL_TRANSFER_UTIL_H_ +#define CEF_LIBCEF_DLL_TRANSFER_UTIL_H_ +#pragma once + +#include +#include + +#include "include/internal/cef_string_list.h" +#include "include/internal/cef_string_map.h" +#include "include/internal/cef_string_multimap.h" + +// Copy contents from one list type to another. +typedef std::vector StringList; +void transfer_string_list_contents(cef_string_list_t fromList, + StringList& toList); +void transfer_string_list_contents(const StringList& fromList, + cef_string_list_t toList); + +// Copy contents from one map type to another. +typedef std::map StringMap; +void transfer_string_map_contents(cef_string_map_t fromMap, + StringMap& toMap); +void transfer_string_map_contents(const StringMap& fromMap, + cef_string_map_t toMap); + +// Copy contents from one map type to another. +typedef std::multimap StringMultimap; +void transfer_string_multimap_contents(cef_string_multimap_t fromMap, + StringMultimap& toMap); +void transfer_string_multimap_contents(const StringMultimap& fromMap, + cef_string_multimap_t toMap); + +#endif // CEF_LIBCEF_DLL_TRANSFER_UTIL_H_ diff --git a/vendor/cef3/libcef_dll/wrapper/cef_browser_info_map.h b/vendor/cef3/libcef_dll/wrapper/cef_browser_info_map.h new file mode 100644 index 00000000000..9cf1ab48686 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/cef_browser_info_map.h @@ -0,0 +1,265 @@ +// Copyright (c) 2014 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. + +#ifndef CEF_LIBCEF_DLL_WRAPPER_CEF_BROWSER_INFO_MAP_H_ +#define CEF_LIBCEF_DLL_WRAPPER_CEF_BROWSER_INFO_MAP_H_ +#pragma once + +#include + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" + +// Default traits for CefBrowserInfoMap. Override to provide different object +// destruction behavior. +template +struct DefaultCefBrowserInfoMapTraits { + static void Destruct(ObjectType info) { + delete info; + } +}; + +// Maps an arbitrary IdType to an arbitrary ObjectType on a per-browser basis. +template > +class CefBrowserInfoMap { + public: + // Implement this interface to visit and optionally delete objects in the map. + class Visitor { + public: + typedef IdType InfoIdType; + typedef ObjectType InfoObjectType; + + // Called once for each info object. Set |remove| to true to remove the + // object from the map. It is safe to destruct removed objects in this + // callback. Return true to continue iterating or false to stop iterating. + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) =0; + + protected: + virtual ~Visitor() {} + }; + + CefBrowserInfoMap() {} + + ~CefBrowserInfoMap() { + clear(); + } + + // Add an object associated with the specified ID values. + void Add(int browser_id, IdType info_id, ObjectType info) { + InfoMap* info_map = NULL; + typename BrowserInfoMap::const_iterator it_browser = + browser_info_map_.find(browser_id); + if (it_browser == browser_info_map_.end()) { + // No InfoMap exists for the browser ID so create it. + info_map = new InfoMap; + browser_info_map_.insert(std::make_pair(browser_id, info_map)); + } else { + info_map = it_browser->second; + // The specified ID should not already exist in the map. + DCHECK(info_map->find(info_id) == info_map->end()); + } + + info_map->insert(std::make_pair(info_id, info)); + } + + // Find the object with the specified ID values. |visitor| can optionally be + // used to evaluate or remove the object at the same time. If the object is + // removed using the Visitor the caller is responsible for destroying it. + ObjectType Find(int browser_id, IdType info_id, Visitor* vistor) { + if (browser_info_map_.empty()) + return ObjectType(); + + typename BrowserInfoMap::iterator it_browser = + browser_info_map_.find(browser_id); + if (it_browser == browser_info_map_.end()) + return ObjectType(); + + InfoMap* info_map = it_browser->second; + typename InfoMap::iterator it_info = info_map->find(info_id); + if (it_info == info_map->end()) + return ObjectType(); + + ObjectType info = it_info->second; + + bool remove = false; + if (vistor) + vistor->OnNextInfo(browser_id, it_info->first, info, &remove); + if (remove) { + info_map->erase(it_info); + + if (info_map->empty()) { + // No more entries in the InfoMap so remove it. + browser_info_map_.erase(it_browser); + delete info_map; + } + } + + return info; + } + + // Find all objects. If any objects are removed using the Visitor the caller + // is responsible for destroying them. + void FindAll(Visitor* visitor) { + DCHECK(visitor); + + if (browser_info_map_.empty()) + return; + + bool remove, keepgoing = true; + + typename BrowserInfoMap::iterator it_browser = browser_info_map_.begin(); + while (it_browser != browser_info_map_.end()) { + InfoMap* info_map = it_browser->second; + + typename InfoMap::iterator it_info = info_map->begin(); + while (it_info != info_map->end()) { + remove = false; + keepgoing = visitor->OnNextInfo(it_browser->first, it_info->first, + it_info->second, &remove); + + if (remove) + info_map->erase(it_info++); + else + ++it_info; + + if (!keepgoing) + break; + } + + if (info_map->empty()) { + // No more entries in the InfoMap so remove it. + browser_info_map_.erase(it_browser++); + delete info_map; + } else { + ++it_browser; + } + + if (!keepgoing) + break; + } + } + + // Find all objects associated with the specified browser. If any objects are + // removed using the Visitor the caller is responsible for destroying them. + void FindAll(int browser_id, Visitor* visitor) { + DCHECK(visitor); + + if (browser_info_map_.empty()) + return; + + typename BrowserInfoMap::iterator it_browser = + browser_info_map_.find(browser_id); + if (it_browser == browser_info_map_.end()) + return; + + InfoMap* info_map = it_browser->second; + bool remove, keepgoing; + + typename InfoMap::iterator it_info = info_map->begin(); + while (it_info != info_map->end()) { + remove = false; + keepgoing = visitor->OnNextInfo(browser_id, it_info->first, + it_info->second, &remove); + + if (remove) + info_map->erase(it_info++); + else + ++it_info; + + if (!keepgoing) + break; + } + + if (info_map->empty()) { + // No more entries in the InfoMap so remove it. + browser_info_map_.erase(it_browser); + delete info_map; + } + } + + // Returns true if the map is empty. + bool empty() const { return browser_info_map_.empty(); } + + // Returns the number of objects in the map. + size_t size() const { + if (browser_info_map_.empty()) + return 0; + + size_t size = 0; + typename BrowserInfoMap::const_iterator it_browser = + browser_info_map_.begin(); + for (; it_browser != browser_info_map_.end(); ++it_browser) + size += it_browser->second->size(); + return size; + } + + // Returns the number of objects in the map that are associated with the + // specified browser. + size_t size(int browser_id) const { + if (browser_info_map_.empty()) + return 0; + + typename BrowserInfoMap::const_iterator it_browser = + browser_info_map_.find(browser_id); + if (it_browser != browser_info_map_.end()) + return it_browser->second->size(); + + return 0; + } + + // Remove all objects from the map. The objects will be destructed. + void clear() { + if (browser_info_map_.empty()) + return; + + typename BrowserInfoMap::const_iterator it_browser = + browser_info_map_.begin(); + for (; it_browser != browser_info_map_.end(); ++it_browser) { + InfoMap* info_map = it_browser->second; + typename InfoMap::const_iterator it_info = info_map->begin(); + for (; it_info != info_map->end(); ++it_info) + Traits::Destruct(it_info->second); + delete info_map; + } + browser_info_map_.clear(); + } + + // Remove all objects from the map that are associated with the specified + // browser. The objects will be destructed. + void clear(int browser_id) { + if (browser_info_map_.empty()) + return; + + typename BrowserInfoMap::iterator it_browser = + browser_info_map_.find(browser_id); + if (it_browser == browser_info_map_.end()) + return; + + InfoMap* info_map = it_browser->second; + typename InfoMap::const_iterator it_info = info_map->begin(); + for (; it_info != info_map->end(); ++it_info) + Traits::Destruct(it_info->second); + + browser_info_map_.erase(it_browser); + delete info_map; + } + + private: + // Map IdType to ObjectType instance. + typedef std::map InfoMap; + // Map browser ID to InfoMap instance. + typedef std::map BrowserInfoMap; + + BrowserInfoMap browser_info_map_; + + DISALLOW_COPY_AND_ASSIGN(CefBrowserInfoMap); +}; + + +#endif // CEF_LIBCEF_DLL_WRAPPER_CEF_BROWSER_INFO_MAP_H_ diff --git a/vendor/cef3/libcef_dll/wrapper/cef_byte_read_handler.cc b/vendor/cef3/libcef_dll/wrapper/cef_byte_read_handler.cc new file mode 100644 index 00000000000..3d29feebf03 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/cef_byte_read_handler.cc @@ -0,0 +1,66 @@ +// Copyright (c) 2010 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. + +#include "include/wrapper/cef_byte_read_handler.h" + +#include +#include +#include + +CefByteReadHandler::CefByteReadHandler(const unsigned char* bytes, size_t size, + CefRefPtr source) + : bytes_(bytes), size_(size), offset_(0), source_(source) { +} + +size_t CefByteReadHandler::Read(void* ptr, size_t size, size_t n) { + base::AutoLock lock_scope(lock_); + size_t s = static_cast(size_ - offset_) / size; + size_t ret = std::min(n, s); + memcpy(ptr, bytes_ + offset_, ret * size); + offset_ += ret * size; + return ret; +} + +int CefByteReadHandler::Seek(int64 offset, int whence) { + int rv = -1L; + base::AutoLock lock_scope(lock_); + switch (whence) { + case SEEK_CUR: + if (offset_ + offset > size_ || offset_ + offset < 0) + break; + offset_ += offset; + rv = 0; + break; + case SEEK_END: { +#if defined(OS_WIN) + int64 offset_abs = _abs64(offset); +#else + int64 offset_abs = std::abs(offset); +#endif + if (offset_abs > size_) + break; + offset_ = size_ - offset_abs; + rv = 0; + break; + } + case SEEK_SET: + if (offset > size_ || offset < 0) + break; + offset_ = offset; + rv = 0; + break; + } + + return rv; +} + +int64 CefByteReadHandler::Tell() { + base::AutoLock lock_scope(lock_); + return offset_; +} + +int CefByteReadHandler::Eof() { + base::AutoLock lock_scope(lock_); + return (offset_ >= size_); +} diff --git a/vendor/cef3/libcef_dll/wrapper/cef_closure_task.cc b/vendor/cef3/libcef_dll/wrapper/cef_closure_task.cc new file mode 100644 index 00000000000..0b49390534d --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/cef_closure_task.cc @@ -0,0 +1,42 @@ +// Copyright (c) 2014 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. + +#include "include/wrapper/cef_closure_task.h" +#include "include/base/cef_callback.h" + +namespace { + +class CefClosureTask : public CefTask { + public: + explicit CefClosureTask(const base::Closure& closure) + : closure_(closure) { + } + + // CefTask method + virtual void Execute() OVERRIDE { + closure_.Run(); + closure_.Reset(); + } + + private: + base::Closure closure_; + + IMPLEMENT_REFCOUNTING(CefClosureTask); + DISALLOW_COPY_AND_ASSIGN(CefClosureTask); +}; + +} // namespace + +CefRefPtr CefCreateClosureTask(const base::Closure& closure) { + return new CefClosureTask(closure); +} + +bool CefPostTask(CefThreadId threadId, const base::Closure& closure) { + return CefPostTask(threadId, new CefClosureTask(closure)); +} + +bool CefPostDelayedTask(CefThreadId threadId, const base::Closure& closure, + int64 delay_ms) { + return CefPostDelayedTask(threadId, new CefClosureTask(closure), delay_ms); +} diff --git a/vendor/cef3/libcef_dll/wrapper/cef_message_router.cc b/vendor/cef3/libcef_dll/wrapper/cef_message_router.cc new file mode 100644 index 00000000000..8966ffa5244 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/cef_message_router.cc @@ -0,0 +1,1149 @@ +// Copyright (c) 2014 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. + +#include "include/wrapper/cef_message_router.h" + +#include +#include + +#include "include/base/cef_bind.h" +#include "include/base/cef_macros.h" +#include "include/cef_task.h" +#include "include/wrapper/cef_closure_task.h" +#include "include/wrapper/cef_helpers.h" +#include "libcef_dll/wrapper/cef_browser_info_map.h" + +namespace { + +// ID value reserved for internal use. +const int kReservedId = 0; + +// Appended to the JS function name for related IPC messages. +const char kMessageSuffix[] = "Msg"; + +// JS object member argument names for cefQuery. +const char kMemberRequest[] = "request"; +const char kMemberOnSuccess[] = "onSuccess"; +const char kMemberOnFailure[] = "onFailure"; +const char kMemberPersistent[] = "persistent"; + +// Default error information when a query is canceled. +const int kCanceledErrorCode = -1; +const char kCanceledErrorMessage[] = "The query has been canceled"; + +// Validate configuration settings. +bool ValidateConfig(CefMessageRouterConfig& config) { + // Must specify function names. + if (config.js_cancel_function.empty() || + config.js_query_function.empty()) { + return false; + } + + return true; +} + +// Helper template for generated ID values. +template +class IdGenerator { + public: + IdGenerator() : next_id_(kReservedId) {} + + T GetNextId() { + T id = ++next_id_; + if (id == kReservedId) // In case the integer value wraps. + id = ++next_id_; + return id; + } + + private: + T next_id_; + + DISALLOW_COPY_AND_ASSIGN(IdGenerator); +}; + +// Browser-side router implementation. +class CefMessageRouterBrowserSideImpl : public CefMessageRouterBrowserSide { + public: + // Implementation of the Callback interface. + class CallbackImpl : public CefMessageRouterBrowserSide::Callback { + public: + CallbackImpl(CefRefPtr router, + int browser_id, + int64 query_id, + bool persistent) + : router_(router), + browser_id_(browser_id), + query_id_(query_id), + persistent_(persistent) { + } + virtual ~CallbackImpl() { + // Hitting this DCHECK means that you didn't call Success or Failure + // on the Callback after returning true from Handler::OnQuery. You must + // call Failure to terminate persistent queries. + DCHECK(!router_); + } + + virtual void Success(const CefString& response) OVERRIDE { + if (!CefCurrentlyOn(TID_UI)) { + // Must execute on the UI thread to access member variables. + CefPostTask(TID_UI, + base::Bind(&CallbackImpl::Success, this, response)); + return; + } + + if (router_) { + CefPostTask(TID_UI, + base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackSuccess, + router_, browser_id_, query_id_, response)); + + if (!persistent_) { + // Non-persistent callbacks are only good for a single use. + router_ = NULL; + } + } + } + + virtual void Failure(int error_code, + const CefString& error_message) OVERRIDE { + if (!CefCurrentlyOn(TID_UI)) { + // Must execute on the UI thread to access member variables. + CefPostTask(TID_UI, + base::Bind(&CallbackImpl::Failure, this, + error_code, error_message)); + return; + } + + if (router_) { + CefPostTask(TID_UI, + base::Bind(&CefMessageRouterBrowserSideImpl::OnCallbackFailure, + router_, browser_id_, query_id_, error_code, + error_message)); + + // Failure always invalidates the callback. + router_ = NULL; + } + } + + void Detach() { + CEF_REQUIRE_UI_THREAD(); + router_ = NULL; + } + + private: + CefRefPtr router_; + const int browser_id_; + const int64 query_id_; + const bool persistent_; + + IMPLEMENT_REFCOUNTING(CallbackImpl); + }; + + explicit CefMessageRouterBrowserSideImpl(const CefMessageRouterConfig& config) + : config_(config), + query_message_name_( + config.js_query_function.ToString() + kMessageSuffix), + cancel_message_name_( + config.js_cancel_function.ToString() + kMessageSuffix) { + } + + virtual ~CefMessageRouterBrowserSideImpl() { + // There should be no pending queries when the router is deleted. + DCHECK(browser_query_info_map_.empty()); + } + + virtual bool AddHandler(Handler* handler, bool first) OVERRIDE { + CEF_REQUIRE_UI_THREAD(); + if (handler_set_.find(handler) == handler_set_.end()) { + handler_set_.insert( + first ? handler_set_.begin() : handler_set_.end(), handler); + return true; + } + return false; + } + + virtual bool RemoveHandler(Handler* handler) OVERRIDE { + CEF_REQUIRE_UI_THREAD(); + if (handler_set_.erase(handler) > 0) { + CancelPendingFor(NULL, handler, true); + return true; + } + return false; + } + + virtual void CancelPending(CefRefPtr browser, + Handler* handler) OVERRIDE { + CancelPendingFor(browser, handler, true); + } + + virtual int GetPendingCount(CefRefPtr browser, + Handler* handler) OVERRIDE { + CEF_REQUIRE_UI_THREAD(); + + if (browser_query_info_map_.empty()) + return 0; + + if (handler) { + // Need to iterate over each QueryInfo object to test the handler. + class Visitor : public BrowserQueryInfoMap::Visitor { + public: + explicit Visitor(Handler* handler) + : handler_(handler), + count_(0) {} + + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) OVERRIDE { + if (info->handler == handler_) + count_++; + return true; + } + + int count() const { return count_; } + + private: + Handler* handler_; + int count_; + }; + + Visitor visitor(handler); + + if (browser.get()) { + // Count queries associated with the specified browser. + browser_query_info_map_.FindAll( + browser->GetIdentifier(), &visitor); + } else { + // Count all queries for all browsers. + browser_query_info_map_.FindAll(&visitor); + } + + return visitor.count(); + } else if (browser.get()) { + return static_cast( + browser_query_info_map_.size(browser->GetIdentifier())); + } else { + return static_cast(browser_query_info_map_.size()); + } + + return 0; + } + + virtual void OnBeforeClose(CefRefPtr browser) OVERRIDE { + CancelPendingFor(browser, NULL, false); + } + + virtual void OnRenderProcessTerminated( + CefRefPtr browser) OVERRIDE { + CancelPendingFor(browser, NULL, false); + } + + virtual void OnBeforeBrowse(CefRefPtr browser, + CefRefPtr frame) OVERRIDE { + if (frame->IsMain()) + CancelPendingFor(browser, NULL, false); + } + + virtual bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) OVERRIDE { + CEF_REQUIRE_UI_THREAD(); + + const std::string& message_name = message->GetName(); + if (message_name == query_message_name_) { + CefRefPtr args = message->GetArgumentList(); + DCHECK_EQ(args->GetSize(), 6U); + + const int64 frame_id = CefInt64Set(args->GetInt(0), args->GetInt(1)); + const int context_id = args->GetInt(2); + const int request_id = args->GetInt(3); + const CefString& request = args->GetString(4); + const bool persistent = args->GetBool(5); + + if (handler_set_.empty()) { + // No handlers so cancel the query. + CancelUnhandledQuery(browser, context_id, request_id); + return true; + } + + const int browser_id = browser->GetIdentifier(); + const int64 query_id = query_id_generator_.GetNextId(); + + CefRefPtr frame = browser->GetFrame(frame_id); + CefRefPtr callback( + new CallbackImpl(this, browser_id, query_id, persistent)); + + // Make a copy of the handler list in case the user adds or removes a + // handler while we're iterating. + HandlerSet handler_set = handler_set_; + + bool handled = false; + HandlerSet::const_iterator it_handler = handler_set.begin(); + for (; it_handler != handler_set.end(); ++it_handler) { + handled = (*it_handler)->OnQuery(browser, frame, query_id, request, + persistent, callback.get()); + if (handled) + break; + } + + // If the query isn't handled nothing should be keeping a reference to + // the callback. + DCHECK(handled || callback->HasOneRef()); + + if (handled) { + // Persist the query information until the callback executes. + // It's safe to do this here because the callback will execute + // asynchronously. + QueryInfo* info = new QueryInfo; + info->browser = browser; + info->frame_id = frame_id; + info->context_id = context_id; + info->request_id = request_id; + info->persistent = persistent; + info->callback = callback; + info->handler = *(it_handler); + browser_query_info_map_.Add(browser_id, query_id, info); + } else { + // Invalidate the callback. + callback->Detach(); + + // No one chose to handle the query so cancel it. + CancelUnhandledQuery(browser, context_id, request_id); + } + + return true; + } else if (message_name == cancel_message_name_) { + CefRefPtr args = message->GetArgumentList(); + DCHECK_EQ(args->GetSize(), 2U); + + const int browser_id = browser->GetIdentifier(); + const int context_id = args->GetInt(0); + const int request_id = args->GetInt(1); + + CancelPendingRequest(browser_id, context_id, request_id); + return true; + } + + return false; + } + + private: + // Structure representing a pending query. + struct QueryInfo { + // Browser and frame originated the query. + CefRefPtr browser; + int64 frame_id; + + // IDs that uniquely identify the query in the renderer process. These + // values are opaque to the browser process but must be returned with the + // response. + int context_id; + int request_id; + + // True if the query is persistent. + bool persistent; + + // Callback associated with the query that must be detached when the query + // is canceled. + CefRefPtr callback; + + // Handler that should be notified if the query is automatically canceled. + Handler* handler; + }; + + // Retrieve a QueryInfo object from the map based on the browser-side query + // ID. If |always_remove| is true then the QueryInfo object will always be + // removed from the map. Othewise, the QueryInfo object will only be removed + // if the query is non-persistent. If |removed| is true the caller is + // responsible for deleting the returned QueryInfo object. + QueryInfo* GetQueryInfo(int browser_id, + int64 query_id, + bool always_remove, + bool* removed) { + class Visitor : public BrowserQueryInfoMap::Visitor { + public: + explicit Visitor(bool always_remove) + : always_remove_(always_remove), + removed_(false) {} + + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) OVERRIDE { + *remove = removed_ = (always_remove_ || !info->persistent); + return true; + } + + bool removed() const { return removed_; } + + private: + const bool always_remove_; + bool removed_; + }; + + Visitor visitor(always_remove); + QueryInfo* info = + browser_query_info_map_.Find(browser_id, query_id, &visitor); + if (info) + *removed = visitor.removed(); + return info; + } + + // Called by CallbackImpl on success. + void OnCallbackSuccess(int browser_id, + int64 query_id, + const CefString& response) { + CEF_REQUIRE_UI_THREAD(); + + bool removed; + QueryInfo* info = GetQueryInfo(browser_id, query_id, false, &removed); + if (info) { + SendQuerySuccess(info, response); + if (removed) + delete info; + } + } + + // Called by CallbackImpl on failure. + void OnCallbackFailure(int browser_id, + int64 query_id, + int error_code, + const CefString& error_message) { + CEF_REQUIRE_UI_THREAD(); + + bool removed; + QueryInfo* info = GetQueryInfo(browser_id, query_id, true, &removed); + if (info) { + SendQueryFailure(info, error_code, error_message); + DCHECK(removed); + delete info; + } + } + + void SendQuerySuccess(QueryInfo* info, + const CefString& response) { + SendQuerySuccess(info->browser, info->context_id, info->request_id, + response); + } + + void SendQuerySuccess(CefRefPtr browser, + int context_id, + int request_id, + const CefString& response) { + CefRefPtr message = + CefProcessMessage::Create(query_message_name_); + CefRefPtr args = message->GetArgumentList(); + args->SetInt(0, context_id); + args->SetInt(1, request_id); + args->SetBool(2, true); // Indicates a success result. + args->SetString(3, response); + browser->SendProcessMessage(PID_RENDERER, message); + } + + void SendQueryFailure(QueryInfo* info, + int error_code, + const CefString& error_message) { + SendQueryFailure(info->browser, info->context_id, info->request_id, + error_code, error_message); + } + + void SendQueryFailure(CefRefPtr browser, + int context_id, + int request_id, + int error_code, + const CefString& error_message) { + CefRefPtr message = + CefProcessMessage::Create(query_message_name_); + CefRefPtr args = message->GetArgumentList(); + args->SetInt(0, context_id); + args->SetInt(1, request_id); + args->SetBool(2, false); // Indicates a failure result. + args->SetInt(3, error_code); + args->SetString(4, error_message); + browser->SendProcessMessage(PID_RENDERER, message); + } + + // Cancel a query that has not been sent to a handler. + void CancelUnhandledQuery(CefRefPtr browser, int context_id, + int request_id) { + SendQueryFailure(browser, context_id, request_id, kCanceledErrorCode, + kCanceledErrorMessage); + } + + // Cancel a query that has already been sent to a handler. + void CancelQuery(int64 query_id, QueryInfo* info, bool notify_renderer) { + if (notify_renderer) + SendQueryFailure(info, kCanceledErrorCode, kCanceledErrorMessage); + + CefRefPtr frame = info->browser->GetFrame(info->frame_id); + info->handler->OnQueryCanceled(info->browser, frame, query_id); + + // Invalidate the callback. + info->callback->Detach(); + } + + // Cancel all pending queries associated with either |browser| or |handler|. + // If both |browser| and |handler| are NULL all pending queries will be + // canceled. Set |notify_renderer| to true if the renderer should be notified. + void CancelPendingFor(CefRefPtr browser, + Handler* handler, + bool notify_renderer) { + if (!CefCurrentlyOn(TID_UI)) { + // Must execute on the UI thread. + CefPostTask(TID_UI, + base::Bind(&CefMessageRouterBrowserSideImpl::CancelPendingFor, this, + browser, handler, notify_renderer)); + return; + } + + if (browser_query_info_map_.empty()) + return; + + class Visitor : public BrowserQueryInfoMap::Visitor { + public: + Visitor(CefMessageRouterBrowserSideImpl* router, + Handler* handler, + bool notify_renderer) + : router_(router), + handler_(handler), + notify_renderer_(notify_renderer) {} + + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) OVERRIDE { + if (!handler_ || info->handler == handler_) { + *remove = true; + router_->CancelQuery(info_id, info, notify_renderer_); + delete info; + } + return true; + } + + private: + CefMessageRouterBrowserSideImpl* router_; + Handler* handler_; + const bool notify_renderer_; + }; + + Visitor visitor(this, handler, notify_renderer); + + if (browser.get()) { + // Cancel all queries associated with the specified browser. + browser_query_info_map_.FindAll( + browser->GetIdentifier(), &visitor); + } else { + // Cancel all queries for all browsers. + browser_query_info_map_.FindAll(&visitor); + } + } + + // Cancel a query based on the renderer-side IDs. If |request_id| is + // kReservedId all requests associated with |context_id| will be canceled. + void CancelPendingRequest(int browser_id, int context_id, int request_id) { + class Visitor : public BrowserQueryInfoMap::Visitor { + public: + Visitor(CefMessageRouterBrowserSideImpl* router, + int context_id, + int request_id) + : router_(router), + context_id_(context_id), + request_id_(request_id) {} + + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) OVERRIDE { + if (info->context_id == context_id_ && + (request_id_ == kReservedId || info->request_id == request_id_)) { + *remove = true; + router_->CancelQuery(info_id, info, false); + delete info; + + // Stop iterating if only canceling a single request. + return (request_id_ == kReservedId); + } + return true; + } + + private: + CefMessageRouterBrowserSideImpl* router_; + const int context_id_; + const int request_id_; + }; + + Visitor visitor(this, context_id, request_id); + browser_query_info_map_.FindAll(browser_id, &visitor); + } + + const CefMessageRouterConfig config_; + const std::string query_message_name_; + const std::string cancel_message_name_; + + IdGenerator query_id_generator_; + + // Set of currently registered handlers. An entry is added when a handler is + // registered and removed when a handler is unregistered. + typedef std::set HandlerSet; + HandlerSet handler_set_; + + // Map of query ID to QueryInfo instance. An entry is added when a Handler + // indicates that it will handle the query and removed when either the query + // is completed via the Callback, the query is explicitly canceled from the + // renderer process, or the associated context is (or will be) released. + typedef CefBrowserInfoMap BrowserQueryInfoMap; + BrowserQueryInfoMap browser_query_info_map_; + + DISALLOW_COPY_AND_ASSIGN(CefMessageRouterBrowserSideImpl); +}; + +// Renderer-side router implementation. +class CefMessageRouterRendererSideImpl : public CefMessageRouterRendererSide { + public: + class V8HandlerImpl : public CefV8Handler { + public: + V8HandlerImpl( + CefRefPtr router, + const CefMessageRouterConfig& config) + : router_(router), + config_(config), + context_id_(kReservedId) { + } + + virtual bool Execute(const CefString& name, + CefRefPtr object, + const CefV8ValueList& arguments, + CefRefPtr& retval, + CefString& exception) OVERRIDE { + if (name == config_.js_query_function) { + if (arguments.size() != 1 || !arguments[0]->IsObject()) { + exception = "Invalid arguments; expecting a single object"; + return true; + } + + CefRefPtr arg = arguments[0]; + + CefRefPtr requestVal = arg->GetValue(kMemberRequest); + if (!requestVal.get() || !requestVal->IsString()) { + exception = "Invalid arguments; object member '"+ + std::string(kMemberRequest) +"' is required and must " + "have type string"; + return true; + } + + CefRefPtr successVal = NULL; + if (arg->HasValue(kMemberOnSuccess)) { + successVal = arg->GetValue(kMemberOnSuccess); + if (!successVal->IsFunction()) { + exception = "Invalid arguments; object member '"+ + std::string(kMemberOnSuccess) +"' must have type " + "function"; + return true; + } + } + + CefRefPtr failureVal = NULL; + if (arg->HasValue(kMemberOnFailure)) { + failureVal = arg->GetValue(kMemberOnFailure); + if (!failureVal->IsFunction()) { + exception = "Invalid arguments; object member '"+ + std::string(kMemberOnFailure) +"' must have type " + "function"; + return true; + } + } + + CefRefPtr persistentVal = NULL; + if (arg->HasValue(kMemberPersistent)) { + persistentVal = arg->GetValue(kMemberPersistent); + if (!persistentVal->IsBool()) { + exception = "Invalid arguments; object member '"+ + std::string(kMemberPersistent) +"' must have type " + "boolean"; + return true; + } + } + + CefRefPtr context = CefV8Context::GetCurrentContext(); + const int context_id = GetIDForContext(context); + const int64 frame_id = context->GetFrame()->GetIdentifier(); + const bool persistent = + (persistentVal.get() && persistentVal->GetBoolValue()); + + const int request_id = router_->SendQuery( + context->GetBrowser(), frame_id, context_id, + requestVal->GetStringValue(), persistent, successVal, failureVal); + retval = CefV8Value::CreateInt(request_id); + return true; + } else if (name == config_.js_cancel_function) { + if (arguments.size() != 1 || !arguments[0]->IsInt()) { + exception = "Invalid arguments; expecting a single integer"; + return true; + } + + bool result = false; + const int request_id = arguments[0]->GetIntValue(); + if (request_id != kReservedId) { + CefRefPtr context = CefV8Context::GetCurrentContext(); + const int context_id = GetIDForContext(context); + const int64 frame_id = context->GetFrame()->GetIdentifier(); + + result = router_->SendCancel(context->GetBrowser(), frame_id, + context_id, request_id); + } + retval = CefV8Value::CreateBool(result); + return true; + } + + return false; + } + + private: + // Don't create the context ID until it's actually needed. + int GetIDForContext(CefRefPtr context) { + if (context_id_ == kReservedId) + context_id_ = router_->CreateIDForContext(context); + return context_id_; + } + + CefRefPtr router_; + const CefMessageRouterConfig config_; + int context_id_; + + IMPLEMENT_REFCOUNTING(V8HandlerImpl); + }; + + explicit CefMessageRouterRendererSideImpl(const CefMessageRouterConfig& config) + : config_(config), + query_message_name_( + config.js_query_function.ToString() + kMessageSuffix), + cancel_message_name_( + config.js_cancel_function.ToString() + kMessageSuffix) { + } + + virtual ~CefMessageRouterRendererSideImpl() { + } + + virtual int GetPendingCount(CefRefPtr browser, + CefRefPtr context) OVERRIDE { + CEF_REQUIRE_RENDERER_THREAD(); + + if (browser_request_info_map_.empty()) + return 0; + + if (context.get()) { + const int context_id = GetIDForContext(context, false); + if (context_id == kReservedId) + return 0; // Nothing associated with the specified context. + + // Need to iterate over each RequestInfo object to test the context. + class Visitor : public BrowserRequestInfoMap::Visitor { + public: + explicit Visitor(int context_id) + : context_id_(context_id), + count_(0) {} + + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) OVERRIDE { + if (info_id.first == context_id_) + count_++; + return true; + } + + int count() const { return count_; } + + private: + int context_id_; + int count_; + }; + + Visitor visitor(context_id); + + if (browser.get()) { + // Count requests associated with the specified browser. + browser_request_info_map_.FindAll( + browser->GetIdentifier(), &visitor); + } else { + // Count all requests for all browsers. + browser_request_info_map_.FindAll(&visitor); + } + + return visitor.count(); + } else if (browser.get()) { + return static_cast( + browser_request_info_map_.size(browser->GetIdentifier())); + } else { + return static_cast(browser_request_info_map_.size()); + } + + return 0; + } + + virtual void OnContextCreated(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) OVERRIDE { + CEF_REQUIRE_RENDERER_THREAD(); + + // Register function handlers with the 'window' object. + CefRefPtr window = context->GetGlobal(); + + CefRefPtr handler = new V8HandlerImpl(this, config_); + CefV8Value::PropertyAttribute attributes = + static_cast( + V8_PROPERTY_ATTRIBUTE_READONLY | + V8_PROPERTY_ATTRIBUTE_DONTENUM | + V8_PROPERTY_ATTRIBUTE_DONTDELETE); + + // Add the query function. + CefRefPtr query_func = + CefV8Value::CreateFunction(config_.js_query_function, handler.get()); + window->SetValue(config_.js_query_function, query_func, attributes); + + // Add the cancel function. + CefRefPtr cancel_func = + CefV8Value::CreateFunction(config_.js_cancel_function, handler.get()); + window->SetValue(config_.js_cancel_function, cancel_func, attributes); + } + + virtual void OnContextReleased(CefRefPtr browser, + CefRefPtr frame, + CefRefPtr context) OVERRIDE { + CEF_REQUIRE_RENDERER_THREAD(); + + // Get the context ID and remove the context from the map. + const int context_id = GetIDForContext(context, true); + if (context_id != kReservedId) { + // Cancel all pending requests for the context. + SendCancel(browser, frame->GetIdentifier(), context_id, kReservedId); + } + } + + virtual bool OnProcessMessageReceived( + CefRefPtr browser, + CefProcessId source_process, + CefRefPtr message) OVERRIDE { + CEF_REQUIRE_RENDERER_THREAD(); + + const std::string& message_name = message->GetName(); + if (message_name == query_message_name_) { + CefRefPtr args = message->GetArgumentList(); + DCHECK_GT(args->GetSize(), 3U); + + const int context_id = args->GetInt(0); + const int request_id = args->GetInt(1); + bool is_success = args->GetBool(2); + + if (is_success) { + DCHECK_EQ(args->GetSize(), 4U); + const CefString& response = args->GetString(3); + CefPostTask(TID_RENDERER, + base::Bind( + &CefMessageRouterRendererSideImpl::ExecuteSuccessCallback, this, + browser->GetIdentifier(), context_id, request_id, response)); + } else { + DCHECK_EQ(args->GetSize(), 5U); + int error_code = args->GetInt(3); + const CefString& error_message = args->GetString(4); + CefPostTask(TID_RENDERER, + base::Bind( + &CefMessageRouterRendererSideImpl::ExecuteFailureCallback, this, + browser->GetIdentifier(), context_id, request_id, error_code, + error_message)); + } + + return true; + } + + return false; + } + + private: + // Structure representing a pending request. + struct RequestInfo { + // True if the request is persistent. + bool persistent; + + // Success callback function. May be NULL. + CefRefPtr success_callback; + + // Failure callback function. May be NULL. + CefRefPtr failure_callback; + }; + + // Retrieve a RequestInfo object from the map based on the renderer-side + // IDs. If |always_remove| is true then the RequestInfo object will always be + // removed from the map. Othewise, the RequestInfo object will only be removed + // if the query is non-persistent. If |removed| is true the caller is + // responsible for deleting the returned QueryInfo object. + RequestInfo* GetRequestInfo(int browser_id, + int request_id, + int context_id, + bool always_remove, + bool* removed) { + class Visitor : public BrowserRequestInfoMap::Visitor { + public: + explicit Visitor(bool always_remove) + : always_remove_(always_remove), + removed_(false) {} + + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) OVERRIDE { + *remove = removed_ = (always_remove_ || !info->persistent); + return true; + } + + bool removed() const { return removed_; } + + private: + const bool always_remove_; + bool removed_; + }; + + Visitor visitor(always_remove); + RequestInfo* info = browser_request_info_map_.Find(browser_id, + std::make_pair(request_id, context_id), &visitor); + if (info) + *removed = visitor.removed(); + return info; + } + + // Returns the new request ID. + int SendQuery(CefRefPtr browser, + int64 frame_id, + int context_id, + const CefString& request, + bool persistent, + CefRefPtr success_callback, + CefRefPtr failure_callback) { + CEF_REQUIRE_RENDERER_THREAD(); + + const int request_id = request_id_generator_.GetNextId(); + + RequestInfo* info = new RequestInfo; + info->persistent = persistent; + info->success_callback = success_callback; + info->failure_callback = failure_callback; + browser_request_info_map_.Add(browser->GetIdentifier(), + std::make_pair(context_id, request_id), info); + + CefRefPtr message = + CefProcessMessage::Create(query_message_name_); + + CefRefPtr args = message->GetArgumentList(); + args->SetInt(0, CefInt64GetLow(frame_id)); + args->SetInt(1, CefInt64GetHigh(frame_id)); + args->SetInt(2, context_id); + args->SetInt(3, request_id); + args->SetString(4, request); + args->SetBool(5, persistent); + + browser->SendProcessMessage(PID_BROWSER, message); + + return request_id; + } + + // If |request_id| is kReservedId all requests associated with |context_id| + // will be canceled, otherwise only the specified |request_id| will be + // canceled. Returns true if any request was canceled. + bool SendCancel(CefRefPtr browser, + int64 frame_id, + int context_id, + int request_id) { + CEF_REQUIRE_RENDERER_THREAD(); + + const int browser_id = browser->GetIdentifier(); + + int cancel_count = 0; + if (request_id != kReservedId) { + // Cancel a single request. + bool removed; + RequestInfo* info = + GetRequestInfo(browser_id, context_id, request_id, true, &removed); + if (info) { + DCHECK(removed); + delete info; + cancel_count = 1; + } + } else { + // Cancel all requests with the specified context ID. + class Visitor : public BrowserRequestInfoMap::Visitor { + public: + explicit Visitor(int context_id) + : context_id_(context_id), + cancel_count_(0) {} + + virtual bool OnNextInfo(int browser_id, + InfoIdType info_id, + InfoObjectType info, + bool* remove) OVERRIDE { + if (info_id.first == context_id_) { + *remove = true; + delete info; + cancel_count_++; + } + return true; + } + + int cancel_count() const { return cancel_count_; } + + private: + const int context_id_; + int cancel_count_; + }; + + Visitor visitor(context_id); + browser_request_info_map_.FindAll(browser_id, &visitor); + cancel_count = visitor.cancel_count(); + } + + if (cancel_count > 0) { + CefRefPtr message = + CefProcessMessage::Create(cancel_message_name_); + + CefRefPtr args = message->GetArgumentList(); + args->SetInt(0, context_id); + args->SetInt(1, request_id); + + browser->SendProcessMessage(PID_BROWSER, message); + return true; + } + + return false; + } + + // Execute the onSuccess JavaScript callback. + void ExecuteSuccessCallback(int browser_id, int context_id, int request_id, + const CefString& response) { + CEF_REQUIRE_RENDERER_THREAD(); + + bool removed; + RequestInfo* info = + GetRequestInfo(browser_id, context_id, request_id, false, &removed); + if (!info) + return; + + CefRefPtr context = GetContextByID(context_id); + if (context && info->success_callback) { + CefV8ValueList args; + args.push_back(CefV8Value::CreateString(response)); + info->success_callback->ExecuteFunctionWithContext(context, NULL, args); + } + + if (removed) + delete info; + } + + // Execute the onFailure JavaScript callback. + void ExecuteFailureCallback(int browser_id, int context_id, int request_id, + int error_code, const CefString& error_message) { + CEF_REQUIRE_RENDERER_THREAD(); + + bool removed; + RequestInfo* info = + GetRequestInfo(browser_id, context_id, request_id, true, &removed); + if (!info) + return; + + CefRefPtr context = GetContextByID(context_id); + if (context && info->failure_callback) { + CefV8ValueList args; + args.push_back(CefV8Value::CreateInt(error_code)); + args.push_back(CefV8Value::CreateString(error_message)); + info->failure_callback->ExecuteFunctionWithContext(context, NULL, args); + } + + DCHECK(removed); + delete info; + } + + int CreateIDForContext(CefRefPtr context) { + CEF_REQUIRE_RENDERER_THREAD(); + + // The context should not already have an associated ID. + DCHECK_EQ(GetIDForContext(context, false), kReservedId); + + const int context_id = context_id_generator_.GetNextId(); + context_map_.insert(std::make_pair(context_id, context)); + return context_id; + } + + // Retrieves the existing ID value associated with the specified |context|. + // If |remove| is true the context will also be removed from the map. + int GetIDForContext(CefRefPtr context, bool remove) { + CEF_REQUIRE_RENDERER_THREAD(); + + ContextMap::iterator it = context_map_.begin(); + for (; it != context_map_.end(); ++it) { + if (it->second->IsSame(context)) { + int context_id = it->first; + if (remove) + context_map_.erase(it); + return context_id; + } + } + + return kReservedId; + } + + CefRefPtr GetContextByID(int context_id) { + CEF_REQUIRE_RENDERER_THREAD(); + + ContextMap::const_iterator it = context_map_.find(context_id); + if (it != context_map_.end()) + return it->second; + return NULL; + } + + const CefMessageRouterConfig config_; + const std::string query_message_name_; + const std::string cancel_message_name_; + + IdGenerator context_id_generator_; + IdGenerator request_id_generator_; + + // Map of (request ID, context ID) to RequestInfo for pending queries. An + // entry is added when a request is initiated via the bound function and + // removed when either the request completes, is canceled via the bound + // function, or the associated context is released. + typedef CefBrowserInfoMap, RequestInfo*> + BrowserRequestInfoMap; + BrowserRequestInfoMap browser_request_info_map_; + + // Map of context ID to CefV8Context for existing contexts. An entry is added + // when a bound function is executed for the first time in the context and + // removed when the context is released. + typedef std::map > ContextMap; + ContextMap context_map_; + + DISALLOW_COPY_AND_ASSIGN(CefMessageRouterRendererSideImpl); +}; + +} // namespace + +CefMessageRouterConfig::CefMessageRouterConfig() + : js_query_function("cefQuery"), + js_cancel_function("cefQueryCancel") { +} + +// static +CefRefPtr CefMessageRouterBrowserSide::Create( + const CefMessageRouterConfig& config) { + CefMessageRouterConfig validated_config = config; + if (!ValidateConfig(validated_config)) + return NULL; + return new CefMessageRouterBrowserSideImpl(validated_config); +} + +// static +CefRefPtr CefMessageRouterRendererSide::Create( + const CefMessageRouterConfig& config) { + CefMessageRouterConfig validated_config = config; + if (!ValidateConfig(validated_config)) + return NULL; + return new CefMessageRouterRendererSideImpl(validated_config); +} diff --git a/vendor/cef3/libcef_dll/wrapper/cef_stream_resource_handler.cc b/vendor/cef3/libcef_dll/wrapper/cef_stream_resource_handler.cc new file mode 100644 index 00000000000..f7e9868ac77 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/cef_stream_resource_handler.cc @@ -0,0 +1,203 @@ +// Copyright (c) 2012 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. + +#include "include/wrapper/cef_stream_resource_handler.h" + +#include + +#include "include/base/cef_bind.h" +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_callback.h" +#include "include/cef_request.h" +#include "include/cef_stream.h" +#include "include/wrapper/cef_closure_task.h" +#include "include/wrapper/cef_helpers.h" + +// Class that represents a readable/writable character buffer. +class CefStreamResourceHandler::Buffer { + public: + Buffer() + : size_(0), + bytes_requested_(0), + bytes_written_(0), + bytes_read_(0) { + } + + void Reset(int new_size) { + if (size_ < new_size) { + size_ = new_size; + buffer_.reset(new char[size_]); + DCHECK(buffer_); + } + bytes_requested_ = new_size; + bytes_written_ = 0; + bytes_read_ = 0; + } + + bool IsEmpty() const { + return (bytes_written_ == 0); + } + + bool CanRead() const { + return (bytes_read_ < bytes_written_); + } + + int WriteTo(void* data_out, int bytes_to_read) { + const int write_size = + std::min(bytes_to_read, bytes_written_ - bytes_read_); + if (write_size > 0) { + memcpy(data_out, buffer_ .get() + bytes_read_, write_size); + bytes_read_ += write_size; + } + return write_size; + } + + int ReadFrom(CefRefPtr reader) { + // Read until the buffer is full or until Read() returns 0 to indicate no + // more data. + int bytes_read; + do { + bytes_read = static_cast( + reader->Read(buffer_.get() + bytes_written_, 1, + bytes_requested_ - bytes_written_)); + bytes_written_ += bytes_read; + } while (bytes_read != 0 && bytes_written_ < bytes_requested_); + + return bytes_written_; + } + + private: + scoped_ptr buffer_; + int size_; + int bytes_requested_; + int bytes_written_; + int bytes_read_; + + DISALLOW_COPY_AND_ASSIGN(Buffer); +}; + +CefStreamResourceHandler::CefStreamResourceHandler( + const CefString& mime_type, + CefRefPtr stream) + : status_code_(200), + status_text_("OK"), + mime_type_(mime_type), + stream_(stream) +#ifndef NDEBUG + , buffer_owned_by_file_thread_(false) +#endif +{ + DCHECK(!mime_type_.empty()); + DCHECK(stream_.get()); + read_on_file_thread_ = stream_->MayBlock(); +} + +CefStreamResourceHandler::CefStreamResourceHandler( + int status_code, + const CefString& status_text, + const CefString& mime_type, + CefResponse::HeaderMap header_map, + CefRefPtr stream) + : status_code_(status_code), + status_text_(status_text), + mime_type_(mime_type), + header_map_(header_map), + stream_(stream) { + DCHECK(!mime_type_.empty()); + DCHECK(stream_.get()); + read_on_file_thread_ = stream_->MayBlock(); +} + +CefStreamResourceHandler::~CefStreamResourceHandler() { +} + +bool CefStreamResourceHandler::ProcessRequest(CefRefPtr request, + CefRefPtr callback) { + callback->Continue(); + return true; +} + +void CefStreamResourceHandler::GetResponseHeaders( + CefRefPtr response, + int64& response_length, + CefString& redirectUrl) { + response->SetStatus(status_code_); + response->SetStatusText(status_text_); + response->SetMimeType(mime_type_); + + if (!header_map_.empty()) + response->SetHeaderMap(header_map_); + + response_length = -1; +} + +bool CefStreamResourceHandler::ReadResponse(void* data_out, + int bytes_to_read, + int& bytes_read, + CefRefPtr callback) { + DCHECK_GT(bytes_to_read, 0); + + if (read_on_file_thread_) { +#ifndef NDEBUG + DCHECK(!buffer_owned_by_file_thread_); +#endif + if (buffer_ && (buffer_->CanRead() || buffer_->IsEmpty())) { + if (buffer_->CanRead()) { + // Provide data from the buffer. + bytes_read = buffer_->WriteTo(data_out, bytes_to_read); + return (bytes_read > 0); + } else { + // End of the steam. + bytes_read = 0; + return false; + } + } else { + // Perform another read on the file thread. + bytes_read = 0; +#ifndef NDEBUG + buffer_owned_by_file_thread_ = true; +#endif + CefPostTask(TID_FILE, + base::Bind(&CefStreamResourceHandler::ReadOnFileThread, this, + bytes_to_read, callback)); + return true; + } + } else { + // Read until the buffer is full or until Read() returns 0 to indicate no + // more data. + bytes_read = 0; + int read = 0; + do { + read = static_cast( + stream_->Read(static_cast(data_out) + bytes_read, 1, + bytes_to_read - bytes_read)); + bytes_read += read; + } while (read != 0 && bytes_read < bytes_to_read); + + return (bytes_read > 0); + } +} + +void CefStreamResourceHandler::Cancel() { +} + +void CefStreamResourceHandler::ReadOnFileThread( + int bytes_to_read, + CefRefPtr callback) { + CEF_REQUIRE_FILE_THREAD(); +#ifndef NDEBUG + DCHECK(buffer_owned_by_file_thread_); +#endif + + if (!buffer_) + buffer_.reset(new Buffer()); + buffer_->Reset(bytes_to_read); + buffer_->ReadFrom(stream_); + +#ifndef NDEBUG + buffer_owned_by_file_thread_ = false; +#endif + callback->Continue(); +} diff --git a/vendor/cef3/libcef_dll/wrapper/cef_xml_object.cc b/vendor/cef3/libcef_dll/wrapper/cef_xml_object.cc new file mode 100644 index 00000000000..7e0d1712ad3 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/cef_xml_object.cc @@ -0,0 +1,453 @@ +// Copyright (c) 2010 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. + +#include "include/wrapper/cef_xml_object.h" + +#include + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/cef_stream.h" + +namespace { + +class CefXmlObjectLoader { + public: + explicit CefXmlObjectLoader(CefRefPtr root_object) + : root_object_(root_object) { + } + + bool Load(CefRefPtr stream, + CefXmlReader::EncodingType encodingType, + const CefString& URI) { + CefRefPtr reader( + CefXmlReader::Create(stream, encodingType, URI)); + if (!reader.get()) + return false; + + bool ret = reader->MoveToNextNode(); + if (ret) { + CefRefPtr cur_object(root_object_), new_object; + CefXmlObject::ObjectVector queue; + int cur_depth, value_depth = -1; + CefXmlReader::NodeType cur_type; + std::stringstream cur_value; + bool last_has_ns = false; + + queue.push_back(root_object_); + + do { + cur_depth = reader->GetDepth(); + if (value_depth >= 0 && cur_depth > value_depth) { + // The current node has already been parsed as part of a value. + continue; + } + + cur_type = reader->GetType(); + if (cur_type == XML_NODE_ELEMENT_START) { + if (cur_depth == value_depth) { + // Add to the current value. + cur_value << std::string(reader->GetOuterXml()); + continue; + } else if (last_has_ns && reader->GetPrefix().empty()) { + if (!cur_object->HasChildren()) { + // Start a new value because the last element has a namespace and + // this element does not. + value_depth = cur_depth; + cur_value << std::string(reader->GetOuterXml()); + } else { + // Value following a child element is not allowed. + std::stringstream ss; + ss << "Value following child element, line " << + reader->GetLineNumber(); + load_error_ = ss.str(); + ret = false; + break; + } + } else { + // Start a new element. + new_object = new CefXmlObject(reader->GetQualifiedName()); + cur_object->AddChild(new_object); + last_has_ns = !reader->GetPrefix().empty(); + + if (!reader->IsEmptyElement()) { + // The new element potentially has a value and/or children, so + // set the current object and add the object to the queue. + cur_object = new_object; + queue.push_back(cur_object); + } + + if (reader->HasAttributes() && reader->MoveToFirstAttribute()) { + // Read all object attributes. + do { + new_object->SetAttributeValue(reader->GetQualifiedName(), + reader->GetValue()); + } while (reader->MoveToNextAttribute()); + reader->MoveToCarryingElement(); + } + } + } else if (cur_type == XML_NODE_ELEMENT_END) { + if (cur_depth == value_depth) { + // Ending an element that is already in the value. + continue; + } else if (cur_depth < value_depth) { + // Done with parsing the value portion of the current element. + cur_object->SetValue(cur_value.str()); + cur_value.str(""); + value_depth = -1; + } + + // Pop the current element from the queue. + queue.pop_back(); + + if (queue.empty() || + cur_object->GetName() != reader->GetQualifiedName()) { + // Open tag without close tag or close tag without open tag should + // never occur (the parser catches this error). + NOTREACHED(); + std::stringstream ss; + ss << "Mismatched end tag for " << + std::string(cur_object->GetName()) << + ", line " << reader->GetLineNumber(); + load_error_ = ss.str(); + ret = false; + break; + } + + // Set the current object to the previous object in the queue. + cur_object = queue.back().get(); + } else if (cur_type == XML_NODE_TEXT || cur_type == XML_NODE_CDATA || + cur_type == XML_NODE_ENTITY_REFERENCE) { + if (cur_depth == value_depth) { + // Add to the current value. + cur_value << std::string(reader->GetValue()); + } else if (!cur_object->HasChildren()) { + // Start a new value. + value_depth = cur_depth; + cur_value << std::string(reader->GetValue()); + } else { + // Value following a child element is not allowed. + std::stringstream ss; + ss << "Value following child element, line " << + reader->GetLineNumber(); + load_error_ = ss.str(); + ret = false; + break; + } + } + } while (reader->MoveToNextNode()); + } + + if (reader->HasError()) { + load_error_ = reader->GetError(); + return false; + } + + return ret; + } + + CefString GetLoadError() { return load_error_; } + + private: + CefString load_error_; + CefRefPtr root_object_; + + DISALLOW_COPY_AND_ASSIGN(CefXmlObjectLoader); +}; + +} // namespace + +CefXmlObject::CefXmlObject(const CefString& name) + : name_(name), parent_(NULL) { +} + +CefXmlObject::~CefXmlObject() { +} + +bool CefXmlObject::Load(CefRefPtr stream, + CefXmlReader::EncodingType encodingType, + const CefString& URI, CefString* loadError) { + Clear(); + + CefXmlObjectLoader loader(this); + if (!loader.Load(stream, encodingType, URI)) { + if (loadError) + *loadError = loader.GetLoadError(); + return false; + } + return true; +} + +void CefXmlObject::Set(CefRefPtr object) { + DCHECK(object.get()); + + Clear(); + + name_ = object->GetName(); + Append(object, true); +} + +void CefXmlObject::Append(CefRefPtr object, + bool overwriteAttributes) { + DCHECK(object.get()); + + if (object->HasChildren()) { + ObjectVector children; + object->GetChildren(children); + ObjectVector::const_iterator it = children.begin(); + for (; it != children.end(); ++it) + AddChild((*it)->Duplicate()); + } + + if (object->HasAttributes()) { + AttributeMap attributes; + object->GetAttributes(attributes); + AttributeMap::const_iterator it = attributes.begin(); + for (; it != attributes.end(); ++it) { + if (overwriteAttributes || !HasAttribute(it->first)) + SetAttributeValue(it->first, it->second); + } + } +} + +CefRefPtr CefXmlObject::Duplicate() { + CefRefPtr new_obj; + { + base::AutoLock lock_scope(lock_); + new_obj = new CefXmlObject(name_); + new_obj->Append(this, true); + } + return new_obj; +} + +void CefXmlObject::Clear() { + ClearChildren(); + ClearAttributes(); +} + +CefString CefXmlObject::GetName() { + CefString name; + { + base::AutoLock lock_scope(lock_); + name = name_; + } + return name; +} + +bool CefXmlObject::SetName(const CefString& name) { + DCHECK(!name.empty()); + if (name.empty()) + return false; + + base::AutoLock lock_scope(lock_); + name_ = name; + return true; +} + +bool CefXmlObject::HasParent() { + base::AutoLock lock_scope(lock_); + return (parent_ != NULL); +} + +CefRefPtr CefXmlObject::GetParent() { + CefRefPtr parent; + { + base::AutoLock lock_scope(lock_); + parent = parent_; + } + return parent; +} + +bool CefXmlObject::HasValue() { + base::AutoLock lock_scope(lock_); + return !value_.empty(); +} + +CefString CefXmlObject::GetValue() { + CefString value; + { + base::AutoLock lock_scope(lock_); + value = value_; + } + return value; +} + +bool CefXmlObject::SetValue(const CefString& value) { + base::AutoLock lock_scope(lock_); + DCHECK(children_.empty()); + if (!children_.empty()) + return false; + value_ = value; + return true; +} + +bool CefXmlObject::HasAttributes() { + base::AutoLock lock_scope(lock_); + return !attributes_.empty(); +} + +size_t CefXmlObject::GetAttributeCount() { + base::AutoLock lock_scope(lock_); + return attributes_.size(); +} + +bool CefXmlObject::HasAttribute(const CefString& name) { + if (name.empty()) + return false; + + base::AutoLock lock_scope(lock_); + AttributeMap::const_iterator it = attributes_.find(name); + return (it != attributes_.end()); +} + +CefString CefXmlObject::GetAttributeValue(const CefString& name) { + DCHECK(!name.empty()); + CefString value; + if (!name.empty()) { + base::AutoLock lock_scope(lock_); + AttributeMap::const_iterator it = attributes_.find(name); + if (it != attributes_.end()) + value = it->second; + } + return value; +} + +bool CefXmlObject::SetAttributeValue(const CefString& name, + const CefString& value) { + DCHECK(!name.empty()); + if (name.empty()) + return false; + + base::AutoLock lock_scope(lock_); + AttributeMap::iterator it = attributes_.find(name); + if (it != attributes_.end()) { + it->second = value; + } else { + attributes_.insert(std::make_pair(name, value)); + } + return true; +} + +size_t CefXmlObject::GetAttributes(AttributeMap& attributes) { + base::AutoLock lock_scope(lock_); + attributes = attributes_; + return attributes_.size(); +} + +void CefXmlObject::ClearAttributes() { + base::AutoLock lock_scope(lock_); + attributes_.clear(); +} + +bool CefXmlObject::HasChildren() { + base::AutoLock lock_scope(lock_); + return !children_.empty(); +} + +size_t CefXmlObject::GetChildCount() { + base::AutoLock lock_scope(lock_); + return children_.size(); +} + +bool CefXmlObject::HasChild(CefRefPtr child) { + DCHECK(child.get()); + + base::AutoLock lock_scope(lock_); + ObjectVector::const_iterator it = children_.begin(); + for (; it != children_.end(); ++it) { + if ((*it).get() == child.get()) + return true; + } + return false; +} + +bool CefXmlObject::AddChild(CefRefPtr child) { + DCHECK(child.get()); + if (!child.get()) + return false; + + CefRefPtr parent = child->GetParent(); + DCHECK(!parent); + if (parent) + return false; + + base::AutoLock lock_scope(lock_); + + children_.push_back(child); + child->SetParent(this); + return true; +} + +bool CefXmlObject::RemoveChild(CefRefPtr child) { + DCHECK(child.get()); + + base::AutoLock lock_scope(lock_); + ObjectVector::iterator it = children_.begin(); + for (; it != children_.end(); ++it) { + if ((*it).get() == child.get()) { + children_.erase(it); + child->SetParent(NULL); + return true; + } + } + return false; +} + +size_t CefXmlObject::GetChildren(ObjectVector& children) { + base::AutoLock lock_scope(lock_); + children = children_; + return children_.size(); +} + +void CefXmlObject::ClearChildren() { + base::AutoLock lock_scope(lock_); + ObjectVector::iterator it = children_.begin(); + for (; it != children_.end(); ++it) + (*it)->SetParent(NULL); + children_.clear(); +} + +CefRefPtr CefXmlObject::FindChild(const CefString& name) { + DCHECK(!name.empty()); + if (name.empty()) + return NULL; + + base::AutoLock lock_scope(lock_); + ObjectVector::const_iterator it = children_.begin(); + for (; it != children_.end(); ++it) { + if ((*it)->GetName() == name) + return (*it); + } + return NULL; +} + +size_t CefXmlObject::FindChildren(const CefString& name, + ObjectVector& children) { + DCHECK(!name.empty()); + if (name.empty()) + return 0; + + size_t ct = 0; + + base::AutoLock lock_scope(lock_); + ObjectVector::const_iterator it = children_.begin(); + for (; it != children_.end(); ++it) { + if ((*it)->GetName() == name) { + children.push_back(*it); + ct++; + } + } + return ct; +} + +void CefXmlObject::SetParent(CefXmlObject* parent) { + base::AutoLock lock_scope(lock_); + if (parent) { + DCHECK(parent_ == NULL); + parent_ = parent; + } else { + DCHECK(parent_ != NULL); + parent_ = NULL; + } +} diff --git a/vendor/cef3/libcef_dll/wrapper/cef_zip_archive.cc b/vendor/cef3/libcef_dll/wrapper/cef_zip_archive.cc new file mode 100644 index 00000000000..05448a428e6 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/cef_zip_archive.cc @@ -0,0 +1,174 @@ +// Copyright (c) 2010 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. + +#include "include/wrapper/cef_zip_archive.h" + +#include + +#include "include/base/cef_logging.h" +#include "include/base/cef_macros.h" +#include "include/base/cef_scoped_ptr.h" +#include "include/cef_stream.h" +#include "include/cef_zip_reader.h" +#include "include/wrapper/cef_byte_read_handler.h" + +#if defined(OS_LINUX) +#include +#endif + +namespace { + +// Convert |str| to lowercase in a Unicode-friendly manner. +CefString ToLower(const CefString& str) { + std::wstring wstr = str; + std::transform(wstr.begin(), wstr.end(), wstr.begin(), towlower); + return wstr; +} + +class CefZipFile : public CefZipArchive::File { + public: + CefZipFile() : data_size_(0) {} + + bool Initialize(size_t data_size) { + data_.reset(new unsigned char[data_size]); + if (data_) { + data_size_ = data_size; + return true; + } else { + DLOG(ERROR) << "Failed to allocate " << data_size << " bytes of memory"; + data_size_ = 0; + return false; + } + } + + virtual const unsigned char* GetData() const OVERRIDE { return data_.get(); } + + virtual size_t GetDataSize() const OVERRIDE { return data_size_; } + + virtual CefRefPtr GetStreamReader() const OVERRIDE { + CefRefPtr handler( + new CefByteReadHandler(data_.get(), data_size_, + const_cast(this))); + return CefStreamReader::CreateForHandler(handler); + } + + unsigned char* data() { return data_.get(); } + + private: + size_t data_size_; + scoped_ptr data_; + + IMPLEMENT_REFCOUNTING(CefZipFile); + DISALLOW_COPY_AND_ASSIGN(CefZipFile); +}; + +} // namespace + +// CefZipArchive implementation + +CefZipArchive::CefZipArchive() { +} + +CefZipArchive::~CefZipArchive() { +} + +size_t CefZipArchive::Load(CefRefPtr stream, + const CefString& password, + bool overwriteExisting) { + base::AutoLock lock_scope(lock_); + + CefRefPtr reader(CefZipReader::Create(stream)); + if (!reader.get()) + return 0; + + if (!reader->MoveToFirstFile()) + return 0; + + CefRefPtr contents; + FileMap::iterator it; + size_t count = 0; + + do { + const size_t size = static_cast(reader->GetFileSize()); + if (size == 0) { + // Skip directories and empty files. + continue; + } + + if (!reader->OpenFile(password)) + break; + + const CefString& name = ToLower(reader->GetFileName()); + + it = contents_.find(name); + if (it != contents_.end()) { + if (overwriteExisting) + contents_.erase(it); + else // Skip files that already exist. + continue; + } + + CefRefPtr contents = new CefZipFile(); + if (!contents->Initialize(size)) + continue; + unsigned char* data = contents->data(); + size_t offset = 0; + + // Read the file contents. + do { + offset += reader->ReadFile(data + offset, size - offset); + } while (offset < size && !reader->Eof()); + + DCHECK(offset == size); + + reader->CloseFile(); + count++; + + // Add the file to the map. + contents_.insert(std::make_pair(name, contents.get())); + } while (reader->MoveToNextFile()); + + return count; +} + +void CefZipArchive::Clear() { + base::AutoLock lock_scope(lock_); + contents_.clear(); +} + +size_t CefZipArchive::GetFileCount() const { + base::AutoLock lock_scope(lock_); + return contents_.size(); +} + +bool CefZipArchive::HasFile(const CefString& fileName) const { + base::AutoLock lock_scope(lock_); + FileMap::const_iterator it = contents_.find(ToLower(fileName)); + return (it != contents_.end()); +} + +CefRefPtr CefZipArchive::GetFile( + const CefString& fileName) const { + base::AutoLock lock_scope(lock_); + FileMap::const_iterator it = contents_.find(ToLower(fileName)); + if (it != contents_.end()) + return it->second; + return NULL; +} + +bool CefZipArchive::RemoveFile(const CefString& fileName) { + base::AutoLock lock_scope(lock_); + FileMap::iterator it = contents_.find(ToLower(fileName)); + if (it != contents_.end()) { + contents_.erase(it); + return true; + } + return false; +} + +size_t CefZipArchive::GetFiles(FileMap& map) const { + base::AutoLock lock_scope(lock_); + map = contents_; + return contents_.size(); +} diff --git a/vendor/cef3/libcef_dll/wrapper/libcef_dll_wrapper.cc b/vendor/cef3/libcef_dll/wrapper/libcef_dll_wrapper.cc new file mode 100644 index 00000000000..9008c064663 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/libcef_dll_wrapper.cc @@ -0,0 +1,735 @@ +// Copyright (c) 2014 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. +// +// --------------------------------------------------------------------------- +// +// This file was generated by the CEF translator tool. If making changes by +// hand only do so within the body of existing method and function +// implementations. See the translator.README.txt file in the tools directory +// for more information. +// + +#include "include/cef_app.h" +#include "include/capi/cef_app_capi.h" +#include "include/cef_geolocation.h" +#include "include/capi/cef_geolocation_capi.h" +#include "include/cef_origin_whitelist.h" +#include "include/capi/cef_origin_whitelist_capi.h" +#include "include/cef_path_util.h" +#include "include/capi/cef_path_util_capi.h" +#include "include/cef_process_util.h" +#include "include/capi/cef_process_util_capi.h" +#include "include/cef_scheme.h" +#include "include/capi/cef_scheme_capi.h" +#include "include/cef_task.h" +#include "include/capi/cef_task_capi.h" +#include "include/cef_trace.h" +#include "include/capi/cef_trace_capi.h" +#include "include/cef_url.h" +#include "include/capi/cef_url_capi.h" +#include "include/cef_v8.h" +#include "include/capi/cef_v8_capi.h" +#include "include/cef_web_plugin.h" +#include "include/capi/cef_web_plugin_capi.h" +#include "include/cef_version.h" +#include "libcef_dll/cpptoc/app_cpptoc.h" +#include "libcef_dll/cpptoc/browser_process_handler_cpptoc.h" +#include "libcef_dll/cpptoc/completion_callback_cpptoc.h" +#include "libcef_dll/cpptoc/context_menu_handler_cpptoc.h" +#include "libcef_dll/cpptoc/cookie_visitor_cpptoc.h" +#include "libcef_dll/cpptoc/domvisitor_cpptoc.h" +#include "libcef_dll/cpptoc/dialog_handler_cpptoc.h" +#include "libcef_dll/cpptoc/display_handler_cpptoc.h" +#include "libcef_dll/cpptoc/download_handler_cpptoc.h" +#include "libcef_dll/cpptoc/drag_handler_cpptoc.h" +#include "libcef_dll/cpptoc/end_tracing_callback_cpptoc.h" +#include "libcef_dll/cpptoc/focus_handler_cpptoc.h" +#include "libcef_dll/cpptoc/geolocation_handler_cpptoc.h" +#include "libcef_dll/cpptoc/get_geolocation_callback_cpptoc.h" +#include "libcef_dll/cpptoc/jsdialog_handler_cpptoc.h" +#include "libcef_dll/cpptoc/keyboard_handler_cpptoc.h" +#include "libcef_dll/cpptoc/life_span_handler_cpptoc.h" +#include "libcef_dll/cpptoc/load_handler_cpptoc.h" +#include "libcef_dll/cpptoc/navigation_entry_visitor_cpptoc.h" +#include "libcef_dll/cpptoc/print_handler_cpptoc.h" +#include "libcef_dll/cpptoc/read_handler_cpptoc.h" +#include "libcef_dll/cpptoc/render_handler_cpptoc.h" +#include "libcef_dll/cpptoc/render_process_handler_cpptoc.h" +#include "libcef_dll/cpptoc/request_handler_cpptoc.h" +#include "libcef_dll/cpptoc/resource_bundle_handler_cpptoc.h" +#include "libcef_dll/cpptoc/resource_handler_cpptoc.h" +#include "libcef_dll/cpptoc/run_file_dialog_callback_cpptoc.h" +#include "libcef_dll/cpptoc/scheme_handler_factory_cpptoc.h" +#include "libcef_dll/cpptoc/string_visitor_cpptoc.h" +#include "libcef_dll/cpptoc/task_cpptoc.h" +#include "libcef_dll/cpptoc/urlrequest_client_cpptoc.h" +#include "libcef_dll/cpptoc/v8accessor_cpptoc.h" +#include "libcef_dll/cpptoc/v8handler_cpptoc.h" +#include "libcef_dll/cpptoc/web_plugin_info_visitor_cpptoc.h" +#include "libcef_dll/cpptoc/web_plugin_unstable_callback_cpptoc.h" +#include "libcef_dll/cpptoc/write_handler_cpptoc.h" +#include "libcef_dll/ctocpp/allow_certificate_error_callback_ctocpp.h" +#include "libcef_dll/ctocpp/auth_callback_ctocpp.h" +#include "libcef_dll/ctocpp/before_download_callback_ctocpp.h" +#include "libcef_dll/ctocpp/binary_value_ctocpp.h" +#include "libcef_dll/ctocpp/browser_ctocpp.h" +#include "libcef_dll/ctocpp/browser_host_ctocpp.h" +#include "libcef_dll/ctocpp/callback_ctocpp.h" +#include "libcef_dll/ctocpp/command_line_ctocpp.h" +#include "libcef_dll/ctocpp/context_menu_params_ctocpp.h" +#include "libcef_dll/ctocpp/domdocument_ctocpp.h" +#include "libcef_dll/ctocpp/domnode_ctocpp.h" +#include "libcef_dll/ctocpp/dictionary_value_ctocpp.h" +#include "libcef_dll/ctocpp/download_item_ctocpp.h" +#include "libcef_dll/ctocpp/download_item_callback_ctocpp.h" +#include "libcef_dll/ctocpp/drag_data_ctocpp.h" +#include "libcef_dll/ctocpp/file_dialog_callback_ctocpp.h" +#include "libcef_dll/ctocpp/frame_ctocpp.h" +#include "libcef_dll/ctocpp/geolocation_callback_ctocpp.h" +#include "libcef_dll/ctocpp/jsdialog_callback_ctocpp.h" +#include "libcef_dll/ctocpp/list_value_ctocpp.h" +#include "libcef_dll/ctocpp/menu_model_ctocpp.h" +#include "libcef_dll/ctocpp/navigation_entry_ctocpp.h" +#include "libcef_dll/ctocpp/print_dialog_callback_ctocpp.h" +#include "libcef_dll/ctocpp/print_job_callback_ctocpp.h" +#include "libcef_dll/ctocpp/print_settings_ctocpp.h" +#include "libcef_dll/ctocpp/process_message_ctocpp.h" +#include "libcef_dll/ctocpp/quota_callback_ctocpp.h" +#include "libcef_dll/ctocpp/scheme_registrar_ctocpp.h" +#include "libcef_dll/ctocpp/stream_reader_ctocpp.h" +#include "libcef_dll/ctocpp/stream_writer_ctocpp.h" +#include "libcef_dll/ctocpp/task_runner_ctocpp.h" +#include "libcef_dll/ctocpp/urlrequest_ctocpp.h" +#include "libcef_dll/ctocpp/v8context_ctocpp.h" +#include "libcef_dll/ctocpp/v8exception_ctocpp.h" +#include "libcef_dll/ctocpp/v8stack_frame_ctocpp.h" +#include "libcef_dll/ctocpp/v8stack_trace_ctocpp.h" +#include "libcef_dll/ctocpp/v8value_ctocpp.h" +#include "libcef_dll/ctocpp/web_plugin_info_ctocpp.h" +#include "libcef_dll/ctocpp/xml_reader_ctocpp.h" +#include "libcef_dll/ctocpp/zip_reader_ctocpp.h" +#include "libcef_dll/transfer_util.h" + +// Define used to facilitate parsing. +#define CEF_GLOBAL + + +// GLOBAL METHODS - Body may be edited by hand. + +CEF_GLOBAL int CefExecuteProcess(const CefMainArgs& args, + CefRefPtr application, void* windows_sandbox_info) { + const char* api_hash = cef_api_hash(0); + if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) { + // The libcef API hash does not match the current header API hash. + NOTREACHED(); + return 0; + } + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: application, windows_sandbox_info + + // Execute + int _retval = cef_execute_process( + &args, + CefAppCppToC::Wrap(application), + windows_sandbox_info); + + // Return type: simple + return _retval; +} + +CEF_GLOBAL bool CefInitialize(const CefMainArgs& args, + const CefSettings& settings, CefRefPtr application, + void* windows_sandbox_info) { + const char* api_hash = cef_api_hash(0); + if (strcmp(api_hash, CEF_API_HASH_PLATFORM)) { + // The libcef API hash does not match the current header API hash. + NOTREACHED(); + return false; + } + + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: application, windows_sandbox_info + + // Execute + int _retval = cef_initialize( + &args, + &settings, + CefAppCppToC::Wrap(application), + windows_sandbox_info); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL void CefShutdown() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_shutdown(); + +#ifndef NDEBUG + // Check that all wrapper objects have been destroyed + DCHECK(base::AtomicRefCountIsZero( + &CefAllowCertificateErrorCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefAuthCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefBeforeDownloadCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefBinaryValueCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefBrowserCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefBrowserHostCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefBrowserProcessHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefCompletionCallbackCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefContextMenuHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefContextMenuParamsCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefCookieVisitorCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDOMDocumentCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDOMNodeCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDOMVisitorCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDialogHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDictionaryValueCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDisplayHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDownloadHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDownloadItemCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefDownloadItemCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDragDataCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefDragHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefEndTracingCallbackCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefFileDialogCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefFocusHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefFrameCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefGeolocationCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefGeolocationHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefGetGeolocationCallbackCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefJSDialogCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefJSDialogHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefKeyboardHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefLifeSpanHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefListValueCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefLoadHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefMenuModelCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefNavigationEntryCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefNavigationEntryVisitorCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefPrintDialogCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefPrintHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefPrintJobCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefPrintSettingsCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefProcessMessageCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefQuotaCallbackCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefReadHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefRenderHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefRenderProcessHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefRequestHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefResourceBundleHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefResourceHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefRunFileDialogCallbackCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefSchemeHandlerFactoryCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefSchemeRegistrarCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefStreamReaderCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefStreamWriterCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefStringVisitorCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefTaskCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefTaskRunnerCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefURLRequestCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefURLRequestClientCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefV8AccessorCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefV8ContextCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefV8ExceptionCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefV8HandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefV8StackFrameCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefV8StackTraceCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefV8ValueCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefWebPluginInfoCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefWebPluginInfoVisitorCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero( + &CefWebPluginUnstableCallbackCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefWriteHandlerCppToC::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefXmlReaderCToCpp::DebugObjCt)); + DCHECK(base::AtomicRefCountIsZero(&CefZipReaderCToCpp::DebugObjCt)); +#endif // !NDEBUG +} + +CEF_GLOBAL void CefDoMessageLoopWork() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_do_message_loop_work(); +} + +CEF_GLOBAL void CefRunMessageLoop() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_run_message_loop(); +} + +CEF_GLOBAL void CefQuitMessageLoop() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_quit_message_loop(); +} + +CEF_GLOBAL void CefSetOSModalLoop(bool osModalLoop) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_set_osmodal_loop( + osModalLoop); +} + +CEF_GLOBAL bool CefGetGeolocation( + CefRefPtr callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: callback; type: refptr_diff + DCHECK(callback.get()); + if (!callback.get()) + return false; + + // Execute + int _retval = cef_get_geolocation( + CefGetGeolocationCallbackCppToC::Wrap(callback)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefAddCrossOriginWhitelistEntry(const CefString& source_origin, + const CefString& target_protocol, const CefString& target_domain, + bool allow_target_subdomains) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: source_origin; type: string_byref_const + DCHECK(!source_origin.empty()); + if (source_origin.empty()) + return false; + // Verify param: target_protocol; type: string_byref_const + DCHECK(!target_protocol.empty()); + if (target_protocol.empty()) + return false; + // Unverified params: target_domain + + // Execute + int _retval = cef_add_cross_origin_whitelist_entry( + source_origin.GetStruct(), + target_protocol.GetStruct(), + target_domain.GetStruct(), + allow_target_subdomains); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefRemoveCrossOriginWhitelistEntry( + const CefString& source_origin, const CefString& target_protocol, + const CefString& target_domain, bool allow_target_subdomains) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: source_origin; type: string_byref_const + DCHECK(!source_origin.empty()); + if (source_origin.empty()) + return false; + // Verify param: target_protocol; type: string_byref_const + DCHECK(!target_protocol.empty()); + if (target_protocol.empty()) + return false; + // Unverified params: target_domain + + // Execute + int _retval = cef_remove_cross_origin_whitelist_entry( + source_origin.GetStruct(), + target_protocol.GetStruct(), + target_domain.GetStruct(), + allow_target_subdomains); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefClearCrossOriginWhitelist() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_clear_cross_origin_whitelist(); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefGetPath(PathKey key, CefString& path) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_get_path( + key, + path.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefLaunchProcess(CefRefPtr command_line) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: command_line; type: refptr_same + DCHECK(command_line.get()); + if (!command_line.get()) + return false; + + // Execute + int _retval = cef_launch_process( + CefCommandLineCToCpp::Unwrap(command_line)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name, + const CefString& domain_name, + CefRefPtr factory) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: scheme_name; type: string_byref_const + DCHECK(!scheme_name.empty()); + if (scheme_name.empty()) + return false; + // Unverified params: domain_name, factory + + // Execute + int _retval = cef_register_scheme_handler_factory( + scheme_name.GetStruct(), + domain_name.GetStruct(), + CefSchemeHandlerFactoryCppToC::Wrap(factory)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefClearSchemeHandlerFactories() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_clear_scheme_handler_factories(); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefCurrentlyOn(CefThreadId threadId) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_currently_on( + threadId); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefPostTask(CefThreadId threadId, CefRefPtr task) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = cef_post_task( + threadId, + CefTaskCppToC::Wrap(task)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefPostDelayedTask(CefThreadId threadId, + CefRefPtr task, int64 delay_ms) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: task; type: refptr_diff + DCHECK(task.get()); + if (!task.get()) + return false; + + // Execute + int _retval = cef_post_delayed_task( + threadId, + CefTaskCppToC::Wrap(task), + delay_ms); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefBeginTracing(const CefString& categories, + CefRefPtr callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: categories, callback + + // Execute + int _retval = cef_begin_tracing( + categories.GetStruct(), + CefCompletionCallbackCppToC::Wrap(callback)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefEndTracing(const CefString& tracing_file, + CefRefPtr callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Unverified params: tracing_file, callback + + // Execute + int _retval = cef_end_tracing( + tracing_file.GetStruct(), + CefEndTracingCallbackCppToC::Wrap(callback)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL int64 CefNowFromSystemTraceTime() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int64 _retval = cef_now_from_system_trace_time(); + + // Return type: simple + return _retval; +} + +CEF_GLOBAL bool CefParseURL(const CefString& url, CefURLParts& parts) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: url; type: string_byref_const + DCHECK(!url.empty()); + if (url.empty()) + return false; + + // Execute + int _retval = cef_parse_url( + url.GetStruct(), + &parts); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL bool CefCreateURL(const CefURLParts& parts, CefString& url) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + int _retval = cef_create_url( + &parts, + url.GetWritableStruct()); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL CefString CefGetMimeType(const CefString& extension) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: extension; type: string_byref_const + DCHECK(!extension.empty()); + if (extension.empty()) + return CefString(); + + // Execute + cef_string_userfree_t _retval = cef_get_mime_type( + extension.GetStruct()); + + // Return type: string + CefString _retvalStr; + _retvalStr.AttachToUserFree(_retval); + return _retvalStr; +} + +CEF_GLOBAL void CefGetExtensionsForMimeType(const CefString& mime_type, + std::vector& extensions) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: mime_type; type: string_byref_const + DCHECK(!mime_type.empty()); + if (mime_type.empty()) + return; + + // Translate param: extensions; type: string_vec_byref + cef_string_list_t extensionsList = cef_string_list_alloc(); + DCHECK(extensionsList); + if (extensionsList) + transfer_string_list_contents(extensions, extensionsList); + + // Execute + cef_get_extensions_for_mime_type( + mime_type.GetStruct(), + extensionsList); + + // Restore param:extensions; type: string_vec_byref + if (extensionsList) { + extensions.clear(); + transfer_string_list_contents(extensionsList, extensions); + cef_string_list_free(extensionsList); + } +} + +CEF_GLOBAL bool CefRegisterExtension(const CefString& extension_name, + const CefString& javascript_code, CefRefPtr handler) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: extension_name; type: string_byref_const + DCHECK(!extension_name.empty()); + if (extension_name.empty()) + return false; + // Verify param: javascript_code; type: string_byref_const + DCHECK(!javascript_code.empty()); + if (javascript_code.empty()) + return false; + // Unverified params: handler + + // Execute + int _retval = cef_register_extension( + extension_name.GetStruct(), + javascript_code.GetStruct(), + CefV8HandlerCppToC::Wrap(handler)); + + // Return type: bool + return _retval?true:false; +} + +CEF_GLOBAL void CefVisitWebPluginInfo( + CefRefPtr visitor) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: visitor; type: refptr_diff + DCHECK(visitor.get()); + if (!visitor.get()) + return; + + // Execute + cef_visit_web_plugin_info( + CefWebPluginInfoVisitorCppToC::Wrap(visitor)); +} + +CEF_GLOBAL void CefRefreshWebPlugins() { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Execute + cef_refresh_web_plugins(); +} + +CEF_GLOBAL void CefAddWebPluginPath(const CefString& path) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: path; type: string_byref_const + DCHECK(!path.empty()); + if (path.empty()) + return; + + // Execute + cef_add_web_plugin_path( + path.GetStruct()); +} + +CEF_GLOBAL void CefAddWebPluginDirectory(const CefString& dir) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: dir; type: string_byref_const + DCHECK(!dir.empty()); + if (dir.empty()) + return; + + // Execute + cef_add_web_plugin_directory( + dir.GetStruct()); +} + +CEF_GLOBAL void CefRemoveWebPluginPath(const CefString& path) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: path; type: string_byref_const + DCHECK(!path.empty()); + if (path.empty()) + return; + + // Execute + cef_remove_web_plugin_path( + path.GetStruct()); +} + +CEF_GLOBAL void CefUnregisterInternalWebPlugin(const CefString& path) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: path; type: string_byref_const + DCHECK(!path.empty()); + if (path.empty()) + return; + + // Execute + cef_unregister_internal_web_plugin( + path.GetStruct()); +} + +CEF_GLOBAL void CefForceWebPluginShutdown(const CefString& path) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: path; type: string_byref_const + DCHECK(!path.empty()); + if (path.empty()) + return; + + // Execute + cef_force_web_plugin_shutdown( + path.GetStruct()); +} + +CEF_GLOBAL void CefRegisterWebPluginCrash(const CefString& path) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: path; type: string_byref_const + DCHECK(!path.empty()); + if (path.empty()) + return; + + // Execute + cef_register_web_plugin_crash( + path.GetStruct()); +} + +CEF_GLOBAL void CefIsWebPluginUnstable(const CefString& path, + CefRefPtr callback) { + // AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING + + // Verify param: path; type: string_byref_const + DCHECK(!path.empty()); + if (path.empty()) + return; + // Verify param: callback; type: refptr_diff + DCHECK(callback.get()); + if (!callback.get()) + return; + + // Execute + cef_is_web_plugin_unstable( + path.GetStruct(), + CefWebPluginUnstableCallbackCppToC::Wrap(callback)); +} + diff --git a/vendor/cef3/libcef_dll/wrapper/libcef_dll_wrapper2.cc b/vendor/cef3/libcef_dll/wrapper/libcef_dll_wrapper2.cc new file mode 100644 index 00000000000..dc8ba7b0249 --- /dev/null +++ b/vendor/cef3/libcef_dll/wrapper/libcef_dll_wrapper2.cc @@ -0,0 +1,4 @@ +// 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. + diff --git a/vendor/cef3/libcef_dll_wrapper.vcproj b/vendor/cef3/libcef_dll_wrapper.vcproj new file mode 100644 index 00000000000..96302c5d2bc --- /dev/null +++ b/vendor/cef3/libcef_dll_wrapper.vcproj @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/vendor/cef3/libcef_dll_wrapper.vcxproj b/vendor/cef3/libcef_dll_wrapper.vcxproj new file mode 100644 index 00000000000..7ea54d1dc94 --- /dev/null +++ b/vendor/cef3/libcef_dll_wrapper.vcxproj @@ -0,0 +1,594 @@ + + + + + Debug + Win32 + + + Nightly + Win32 + + + Release + Win32 + + + + {A9D6DC71-C0DC-4549-AEA0-3B15B44E86A9} + Win32Proj + libcef_dll_wrapper + true + + + + Unicode + StaticLibrary + + + v120_xp + + + v120_xp + + + v120_xp + + + + + + + + + + + + + + + + + + $(ExecutablePath);$(MSBuildProjectDirectory)\.\bin\;$(MSBuildProjectDirectory)\.\bin\ + false + false + true + $(ProjectName) + $(OutDir)lib\$(ProjectName)$(TargetExt) + + + + $(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + /MP /we4389 %(AdditionalOptions) + EnableFastChecks + true + ProgramDatabase + 4127;4351;4355;4503;4611;4100;4121;4189;4244;4481;4505;4510;4512;4610;4996;4702;%(DisableSpecificWarnings) + false + true + false + Disabled + _DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions) + MultiThreadedDebugDLL + false + true + Level4 + + + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /ignore:4221 %(AdditionalOptions) + $(OutDir)lib\$(ProjectName)$(TargetExt) + MachineX86 + + + wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions) + dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;%(DelayLoadDLLs) + false + true + $(OutDir)lib\$(TargetName).lib + $(OutDir)$(TargetName).map + 5.01 + false + Console + MachineX86 + + + %(Filename).dlldata.c + true + %(Filename).h + %(Filename)_i.c + $(IntDir) + %(Filename)_p.c + %(Filename).tlb + + + ../../..;$(OutDir)obj/global_intermediate;$(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + 0x0409 + _DEBUG;V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;DYNAMIC_ANNOTATIONS_ENABLED=1;WTF_USE_DYNAMIC_ANNOTATIONS=1;%(PreprocessorDefinitions) + + + + + $(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + /MP /we4389 /d2Zi+ /Zc:inline /Oy- %(AdditionalOptions) + true + ProgramDatabase + 4127;4351;4355;4503;4611;4100;4121;4189;4244;4481;4505;4510;4512;4610;4996;4702;%(DisableSpecificWarnings) + false + true + AnySuitable + false + false + MaxSpeed + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions) + MultiThreadedDLL + false + true + true + Level4 + + + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /ignore:4221 %(AdditionalOptions) + $(OutDir)lib\$(ProjectName)$(TargetExt) + MachineX86 + + + wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions) + dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;%(DelayLoadDLLs) + true + false + true + $(OutDir)lib\$(TargetName).lib + $(OutDir)$(TargetName).map + 5.01 + true + true + Console + MachineX86 + + + %(Filename).dlldata.c + true + %(Filename).h + %(Filename)_i.c + $(IntDir) + %(Filename)_p.c + %(Filename).tlb + + + ../../..;$(OutDir)obj/global_intermediate;$(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + 0x0409 + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + + + + + $(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;%(AdditionalIncludeDirectories) + /MP /we4389 /d2Zi+ /Zc:inline /Oy- %(AdditionalOptions) + true + ProgramDatabase + 4127;4351;4355;4503;4611;4100;4121;4189;4244;4481;4505;4510;4512;4610;4996;4702;%(DisableSpecificWarnings) + false + true + AnySuitable + false + false + MaxSpeed + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions) + MultiThreadedDLL + false + true + true + Level4 + + + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /ignore:4221 %(AdditionalOptions) + $(OutDir)lib\$(ProjectName)$(TargetExt) + MachineX86 + + + wininet.lib;dnsapi.lib;version.lib;msimg32.lib;ws2_32.lib;usp10.lib;psapi.lib;dbghelp.lib;winmm.lib;shlwapi.lib;kernel32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;user32.lib;uuid.lib;odbc32.lib;odbccp32.lib;delayimp.lib;credui.lib;netapi32.lib + C:/Program Files (x86)/Windows Kits/8.1/Lib/win8/um/x86;%(AdditionalLibraryDirectories) + /safeseh /dynamicbase /ignore:4199 /ignore:4221 /nxcompat /largeaddressaware %(AdditionalOptions) + dbghelp.dll;dwmapi.dll;shell32.dll;uxtheme.dll;%(DelayLoadDLLs) + true + false + true + $(OutDir)lib\$(TargetName).lib + $(OutDir)$(TargetName).map + 5.01 + true + true + Console + MachineX86 + + + %(Filename).dlldata.c + true + %(Filename).h + %(Filename)_i.c + $(IntDir) + %(Filename)_p.c + %(Filename).tlb + + + ../../..;$(OutDir)obj/global_intermediate;$(OutDir)obj\global_intermediate;..\..\..\third_party\wtl\include;.;C:\Program Files (x86)\Windows Kits\8.1\Include\shared;C:\Program Files (x86)\Windows Kits\8.1\Include\um;C:\Program Files (x86)\Windows Kits\8.1\Include\winrt;$(VSInstallDir)\VC\atlmfc\include;%(AdditionalIncludeDirectories) + 0x0409 + V8_DEPRECATION_WARNINGS;_WIN32_WINNT=0x0602;WINVER=0x0602;WIN32;_WINDOWS;NOMINMAX;PSAPI_VERSION=1;_CRT_RAND_S;CERT_CHAIN_PARA_HAS_EXTRA_FIELDS;WIN32_LEAN_AND_MEAN;_ATL_NO_OPENGL;_HAS_EXCEPTIONS=0;_SECURE_ATL;CHROMIUM_BUILD;TOOLKIT_VIEWS=1;USE_AURA=1;USE_ASH=1;USE_DEFAULT_RENDER_THEME=1;USE_LIBJPEG_TURBO=1;ENABLE_ONE_CLICK_SIGNIN;ENABLE_PRE_SYNC_BACKUP;ENABLE_REMOTING=1;ENABLE_WEBRTC=1;ENABLE_PEPPER_CDMS;ENABLE_CONFIGURATION_POLICY;ENABLE_NOTIFICATIONS;ENABLE_HIDPI=1;ENABLE_EGLIMAGE=1;__STD_C;_CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;NTDDI_VERSION=0x06020000;_USING_V110_SDK71_;ENABLE_TASK_MANAGER=1;ENABLE_EXTENSIONS=1;ENABLE_PLUGIN_INSTALLATION=1;ENABLE_PLUGINS=1;ENABLE_SESSION_SERVICE=1;ENABLE_THEMES=1;ENABLE_AUTOFILL_DIALOG=1;ENABLE_BACKGROUND=1;ENABLE_GOOGLE_NOW=1;CLD_VERSION=2;CLD2_DATA_SOURCE=static;ENABLE_FULL_PRINTING=1;ENABLE_PRINTING=1;ENABLE_SPELLCHECK=1;ENABLE_CAPTIVE_PORTAL_DETECTION=1;ENABLE_APP_LIST=1;ENABLE_SETTINGS_APP=1;ENABLE_MANAGED_USERS=1;ENABLE_MDNS=1;ENABLE_SERVICE_DISCOVERY=1;ENABLE_WIFI_BOOTSTRAPPING=1;ENABLE_LOAD_COMPLETION_HACKS=1;USING_CEF_SHARED;__STDC_CONSTANT_MACROS;__STDC_FORMAT_MACROS;NDEBUG;NVALGRIND;DYNAMIC_ANNOTATIONS_ENABLED=0;%(PreprocessorDefinitions);%(PreprocessorDefinitions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vendor/cef3/libcef_dll_wrapper.vcxproj.filters b/vendor/cef3/libcef_dll_wrapper.vcxproj.filters new file mode 100644 index 00000000000..407014e184f --- /dev/null +++ b/vendor/cef3/libcef_dll_wrapper.vcxproj.filters @@ -0,0 +1,3065 @@ + + + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {1D4CEA7C-B637-77CF-7A24-85ABD36F82A8} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {907BD885-F750-8BFF-433D-6153B0C8239B} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {57CA55B8-BCC5-4000-CE3A-58972F82E9CB} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DBBAC0A6-BB0A-CA51-45CC-DA4574B671E6} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {6EC44E64-2A08-7BA1-DD52-37662FF8BB3A} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {FF3D12EC-282F-D293-DF6C-6D7938C94540} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + {BF7B5B1F-32D7-CA57-2F5C-5CFFA7F0BF7D} + + + {DB43CDD1-2824-1B32-3992-B9BA77D7F6A1} + + + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base + + + include\base\internal + + + include\base\internal + + + include\base\internal + + + include\base\internal + + + include\base\internal + + + include + + + include + + + include + + + include + + + include + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include\internal + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\capi + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + include\wrapper + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\base + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll + + + libcef_dll + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\wrapper + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\cpptoc + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + libcef_dll\ctocpp + + + + diff --git a/vendor/cef3/macros.cmake b/vendor/cef3/macros.cmake new file mode 100644 index 00000000000..8e832c3c9d1 --- /dev/null +++ b/vendor/cef3/macros.cmake @@ -0,0 +1,272 @@ +# Copyright (c) 2014 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. + +# +# Shared macros. +# + +# Append platform specific sources to a list of sources. +macro(APPEND_PLATFORM_SOURCES name_of_list) + if(OS_LINUX AND ${name_of_list}_LINUX) + list(APPEND ${name_of_list} ${${name_of_list}_LINUX}) + endif() + if(OS_POSIX AND ${name_of_list}_POSIX) + list(APPEND ${name_of_list} ${${name_of_list}_POSIX}) + endif() + if(OS_WINDOWS AND ${name_of_list}_WINDOWS) + list(APPEND ${name_of_list} ${${name_of_list}_WINDOWS}) + endif() + if(OS_MACOSX AND ${name_of_list}_MACOSX) + list(APPEND ${name_of_list} ${${name_of_list}_MACOSX}) + endif() +endmacro() + +# Add a logical target that can be used to link the specified libraries into an +# executable target. +macro(ADD_LOGICAL_TARGET target debug_lib release_lib) + add_library(${target} ${CEF_LIBTYPE} IMPORTED) + set_target_properties(${target} PROPERTIES + IMPORTED_LOCATION "${release_lib}" + IMPORTED_LOCATION_DEBUG "${debug_lib}" + IMPORTED_LOCATION_RELEASE "${release_lib}" + ) +endmacro() + +# Determine the target output directory based on platform and generator. +macro(SET_CEF_TARGET_OUT_DIR) + if(${CMAKE_GENERATOR} STREQUAL "Ninja") + # Ninja does not create a subdirectory named after the configuration. + set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}") + elseif(OS_LINUX) + set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}") + else() + set(CEF_TARGET_OUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/$") + endif() +endmacro() + +# Copy a list of files from one directory to another. Relative files paths are maintained. +macro(COPY_FILES target file_list source_dir target_dir) + foreach(FILENAME ${file_list}) + set(source_file ${source_dir}/${FILENAME}) + set(target_file ${target_dir}/${FILENAME}) + if(IS_DIRECTORY ${source_file}) + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${source_file}" "${target_file}" + VERBATIM + ) + else() + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${source_file}" "${target_file}" + VERBATIM + ) + endif() + endforeach() +endmacro() + +# Rename a directory replacing the target if it already exists. +macro(RENAME_DIRECTORY target source_dir target_dir) + add_custom_command( + TARGET ${target} + POST_BUILD + # Remove the target directory if it already exists. + COMMAND ${CMAKE_COMMAND} -E remove_directory "${target_dir}" + # Rename the source directory to target directory. + COMMAND ${CMAKE_COMMAND} -E rename "${source_dir}" "${target_dir}" + VERBATIM + ) +endmacro() + + +# +# Linux macros. +# + +if(OS_LINUX) + +# Use pkg-config to find Linux libraries and update compiler/linker variables. +macro(FIND_LINUX_LIBRARIES libraries) + # Read pkg-config info into variables. + execute_process(COMMAND pkg-config --cflags ${libraries} OUTPUT_VARIABLE FLL_CFLAGS) + execute_process(COMMAND pkg-config --libs-only-L --libs-only-other ${libraries} OUTPUT_VARIABLE FLL_LDFLAGS) + execute_process(COMMAND pkg-config --libs-only-l ${libraries} OUTPUT_VARIABLE FLL_LIBS) + + # Strip leading and trailing whitepspace. + STRING(STRIP "${FLL_CFLAGS}" FLL_CFLAGS) + STRING(STRIP "${FLL_LDFLAGS}" FLL_LDFLAGS) + STRING(STRIP "${FLL_LIBS}" FLL_LIBS) + + # Update the variables. + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLL_CFLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLL_CFLAGS}") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLL_LDFLAGS}") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLL_LDFLAGS}") + set(CEF_STANDARD_LIBS "${CEF_STANDARD_LIBS} ${FLL_LIBS}") +endmacro() + +# Set SUID permissions on the specified executable. +macro(SET_LINUX_SUID_PERMISSIONS target executable) + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E echo "" + COMMAND ${CMAKE_COMMAND} -E echo "*** Run the following command manually to set SUID permissions ***" + COMMAND ${CMAKE_COMMAND} -E echo "EXE=\"${executable}\" && sudo -- chown root:root $EXE && sudo -- chmod 4755 $EXE" + COMMAND ${CMAKE_COMMAND} -E echo "" + VERBATIM + ) +endmacro() + +endif(OS_LINUX) + + +# +# Mac OS X macros. +# + +if(OS_MACOSX) + +# Set Xcode target properties. +function(SET_XCODE_TARGET_PROPERTIES target) + set_target_properties(${target} PROPERTIES + XCODE_ATTRIBUTE_ALWAYS_SEARCH_USER_PATHS NO + XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "gnu++11" # -std=gnu++11 + XCODE_ATTRIBUTE_CLANG_LINK_OBJC_RUNTIME NO # -fno-objc-link-runtime + XCODE_ATTRIBUTE_CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS YES # -Wobjc-missing-property-synthesis + XCODE_ATTRIBUTE_COPY_PHASE_STRIP NO + XCODE_ATTRIBUTE_DEAD_CODE_STRIPPING[variant=Release] YES # -Wl,-dead_strip + XCODE_ATTRIBUTE_GCC_C_LANGUAGE_STANDARD "c99" # -std=c99 + XCODE_ATTRIBUTE_GCC_CW_ASM_SYNTAX NO # No -fasm-blocks + XCODE_ATTRIBUTE_GCC_DYNAMIC_NO_PIC NO + XCODE_ATTRIBUTE_GCC_ENABLE_CPP_EXCEPTIONS NO # -fno-exceptions + XCODE_ATTRIBUTE_GCC_ENABLE_CPP_RTTI NO # -fno-rtti + XCODE_ATTRIBUTE_GCC_ENABLE_PASCAL_STRINGS NO # No -mpascal-strings + XCODE_ATTRIBUTE_GCC_INLINES_ARE_PRIVATE_EXTERN YES # -fvisibility-inlines-hidden + XCODE_ATTRIBUTE_GCC_OBJC_CALL_CXX_CDTORS YES # -fobjc-call-cxx-cdtors + XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN YES # -fvisibility=hidden + XCODE_ATTRIBUTE_GCC_THREADSAFE_STATICS NO # -fno-threadsafe-statics + XCODE_ATTRIBUTE_GCC_TREAT_WARNINGS_AS_ERRORS YES # -Werror + XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0" + XCODE_ATTRIBUTE_GCC_WARN_ABOUT_MISSING_NEWLINE YES # -Wnewline-eof + XCODE_ATTRIBUTE_USE_HEADERMAP NO + OSX_ARCHITECTURES_DEBUG "${CMAKE_OSX_ARCHITECTURES}" + OSX_ARCHITECTURES_RELEASE "${CMAKE_OSX_ARCHITECTURES}" + ) +endfunction() + +# Override default add_library function. +function(add_library name) + _add_library(${name} ${ARGN}) + SET_XCODE_TARGET_PROPERTIES(${name}) +endfunction() + +# Override default add_executable function. +function(add_executable name) + _add_executable(${name} ${ARGN}) + SET_XCODE_TARGET_PROPERTIES(${name}) +endfunction() + +# Fix the framework link in the helper executable. +macro(FIX_MACOSX_HELPER_FRAMEWORK_LINK target app_path) + add_custom_command(TARGET ${target} + POST_BUILD + COMMAND install_name_tool -change "@executable_path/Chromium Embedded Framework" + "@executable_path/../../../../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" + "${app_path}/Contents/MacOS/${target}" + VERBATIM + ) +endmacro() + +# Fix the framework link in the main executable. +macro(FIX_MACOSX_MAIN_FRAMEWORK_LINK target app_path) + add_custom_command(TARGET ${target} + POST_BUILD + COMMAND install_name_tool -change "@executable_path/Chromium Embedded Framework" + "@executable_path/../Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" + "${app_path}/Contents/MacOS/${target}" + VERBATIM + ) +endmacro() + +# Make the other helper app bundles. +macro(MAKE_MACOSX_HELPERS target app_path) + add_custom_command(TARGET ${target} + POST_BUILD + # The exported variables need to be set for generators other than Xcode. + COMMAND export BUILT_PRODUCTS_DIR=${app_path} && + export CONTENTS_FOLDER_PATH=/Contents && + tools/make_more_helpers.sh "Frameworks" "${target}" + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + VERBATIM + ) +endmacro() + +# Manually process and copy over resource files. +macro(COPY_MACOSX_RESOURCES resource_list prefix_list target source_dir app_path) + foreach(FILENAME ${resource_list}) + # Remove one or more prefixes from the source paths. + set(TARGET_FILENAME "${FILENAME}") + foreach(PREFIX ${prefix_list}) + string(REGEX REPLACE "^.*${PREFIX}" "" TARGET_FILENAME ${TARGET_FILENAME}) + endforeach() + + # Determine the absolute source and target paths. + set(TARGET_PATH "${app_path}/Contents/Resources/${TARGET_FILENAME}") + if(IS_ABSOLUTE ${FILENAME}) + set(SOURCE_PATH ${FILENAME}) + else() + set(SOURCE_PATH "${source_dir}/${FILENAME}") + endif() + + if(${FILENAME} MATCHES ".xib$") + # Change the target file extension. + string(REGEX REPLACE ".xib$" ".nib" TARGET_PATH ${TARGET_PATH}) + + get_filename_component(TARGET_DIRECTORY ${TARGET_PATH} PATH) + add_custom_command( + TARGET ${target} + POST_BUILD + # Create the target directory. + COMMAND ${CMAKE_COMMAND} -E make_directory "${TARGET_DIRECTORY}" + # Compile the XIB file to a NIB. + COMMAND /usr/bin/ibtool --output-format binary1 --compile "${TARGET_PATH}" "${SOURCE_PATH}" + VERBATIM + ) + elseif(NOT ${TARGET_FILENAME} STREQUAL "Info.plist") + # Copy the file as-is. + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy "${SOURCE_PATH}" "${TARGET_PATH}" + VERBATIM + ) + endif() + endforeach() +endmacro() + +endif(OS_MACOSX) + + +# +# Windows macros. +# + +if(OS_WINDOWS) + +# Add custom manifest files to an executable target. +macro(ADD_WINDOWS_MANIFEST target) + add_custom_command( + TARGET ${target} + POST_BUILD + COMMAND "mt.exe" -nologo + -manifest \"${CMAKE_CURRENT_SOURCE_DIR}/${target}.exe.manifest\" \"${CMAKE_CURRENT_SOURCE_DIR}/compatibility.manifest\" + -outputresource:"${CEF_TARGET_OUT_DIR}/${target}.exe"\;\#1 + COMMENT "Adding manifest..." + ) +endmacro() + +endif(OS_WINDOWS) diff --git a/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/BaseSystem/BaseSystem 2008.vcxproj b/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/BaseSystem/BaseSystem 2008.vcxproj index b4a66520e6a..438adc48dd5 100644 --- a/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/BaseSystem/BaseSystem 2008.vcxproj +++ b/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/BaseSystem/BaseSystem 2008.vcxproj @@ -23,19 +23,19 @@ StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte @@ -70,7 +70,6 @@ CEGUIBase - ..\..\..\..\$(PlatformTarget)\$(Configuration)\ CEGUIBase diff --git a/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/Renderers/DirectX9Renderer/DirectX9GUIRenderer 2008.vcxproj b/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/Renderers/DirectX9Renderer/DirectX9GUIRenderer 2008.vcxproj index e80ab03b71a..8bd1c7b6e1f 100644 --- a/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/Renderers/DirectX9Renderer/DirectX9GUIRenderer 2008.vcxproj +++ b/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/Renderers/DirectX9Renderer/DirectX9GUIRenderer 2008.vcxproj @@ -23,19 +23,19 @@ StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte @@ -71,7 +71,6 @@ DirectX9GUIRenderer - ..\..\..\..\..\$(PlatformTarget)\$(Configuration)\ DirectX9GUIRenderer diff --git a/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/WidgetSets/Falagard/Falagard 2008.vcxproj b/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/WidgetSets/Falagard/Falagard 2008.vcxproj index e1f8a08e48d..e228c4a6aa0 100644 --- a/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/WidgetSets/Falagard/Falagard 2008.vcxproj +++ b/vendor/cegui-0.4.0-custom/makefiles/win32/VC++7.1/WidgetSets/Falagard/Falagard 2008.vcxproj @@ -23,19 +23,19 @@ StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte @@ -71,7 +71,6 @@ CEGUIFalagardBase - ..\..\..\..\..\$(PlatformTarget)\$(Configuration)\ CEGUIFalagardBase diff --git a/vendor/cegui-0.4.0-custom/src/elements/CEGUIMultiLineEditbox.cpp b/vendor/cegui-0.4.0-custom/src/elements/CEGUIMultiLineEditbox.cpp index 20c3e37646b..e704ca64891 100644 --- a/vendor/cegui-0.4.0-custom/src/elements/CEGUIMultiLineEditbox.cpp +++ b/vendor/cegui-0.4.0-custom/src/elements/CEGUIMultiLineEditbox.cpp @@ -712,6 +712,10 @@ void MultiLineEditbox::formatText(void) { // get point at which to break the token lineLen = fnt->getCharAtPixel(paraText.substr(lineIndex, nextTokenSize), areaWidth); + + // If not enough room, pretend there is (to prevent infinite loop) + if ( lineLen == 0 ) + lineLen = 1; } // text wraps, exit loop early with line info up until wrap point diff --git a/vendor/curl/lib/libcurl 2008.vcxproj b/vendor/curl/lib/libcurl 2008.vcxproj index df0f932e27f..173c9b40be0 100644 --- a/vendor/curl/lib/libcurl 2008.vcxproj +++ b/vendor/curl/lib/libcurl 2008.vcxproj @@ -34,37 +34,37 @@ DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte DynamicLibrary - v120 + v120_xp false MultiByte @@ -106,12 +106,10 @@ <_ProjectFileVersion>12.0.21005.1 - ..\$(PlatformTarget)\$(Configuration)\ false libcurl - ..\$(PlatformTarget)\$(Configuration)\ false libcurl @@ -168,9 +166,9 @@ ws2_32.lib;wldap32.lib;zlib.lib;%(AdditionalDependencies) true - ..\..\zlib\$(PlatformTarget)\$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\zlib;%(AdditionalLibraryDirectories) true - ../../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb false $(IntDir)$(TargetName).lib @@ -213,9 +211,9 @@ ws2_32.lib;wldap32.lib;zlib.lib;%(AdditionalDependencies) true - ..\..\zlib\$(PlatformTarget)\$(Configuration);%(AdditionalLibraryDirectories) + $(SolutionDir)..\obj\$(PlatformTarget)\$(Configuration)\zlib;%(AdditionalLibraryDirectories) true - ../../../symbols/$(Configuration)_$(PlatformTarget)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb false diff --git a/vendor/ehs/vs2008/ehs 2008.vcxproj b/vendor/ehs/vs2008/ehs 2008.vcxproj index f65dbe86f4f..6732fc12b64 100644 --- a/vendor/ehs/vs2008/ehs 2008.vcxproj +++ b/vendor/ehs/vs2008/ehs 2008.vcxproj @@ -34,37 +34,37 @@ StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte @@ -126,11 +126,9 @@ ehs_d - ..\$(PlatformTarget)\$(Configuration)\ ehs - ..\$(PlatformTarget)\$(Configuration)\ ehs diff --git a/vendor/jpeg/win32/jpeg_2008.vcxproj b/vendor/jpeg/win32/jpeg_2008.vcxproj index 3f1052bc6c2..af6b1f2e9e8 100644 --- a/vendor/jpeg/win32/jpeg_2008.vcxproj +++ b/vendor/jpeg/win32/jpeg_2008.vcxproj @@ -22,19 +22,19 @@ StaticLibrary - v120 + v120_xp Unicode true StaticLibrary - v120 + v120_xp Unicode true StaticLibrary - v120 + v120_xp Unicode @@ -67,7 +67,6 @@ jpeg - ..\$(PlatformTarget)\$(Configuration)\ jpeg diff --git a/vendor/json-c/json 2008.vcxproj b/vendor/json-c/json 2008.vcxproj index 413b9385909..db0c751ae23 100644 --- a/vendor/json-c/json 2008.vcxproj +++ b/vendor/json-c/json 2008.vcxproj @@ -35,36 +35,36 @@ StaticLibrary - v120 + v120_xp Unicode true StaticLibrary - v120 + v120_xp Unicode true StaticLibrary - v120 + v120_xp Unicode StaticLibrary - v120 + v120_xp Unicode true StaticLibrary - v120 + v120_xp Unicode true StaticLibrary - v120 + v120_xp Unicode @@ -119,11 +119,9 @@ json - $(PlatformTarget)\$(Configuration)\ json - $(PlatformTarget)\$(Configuration)\ json diff --git a/vendor/libpng/projects/vs2008/libpng.vcxproj b/vendor/libpng/projects/vs2008/libpng.vcxproj index d5ad45d8750..47e38ddb53a 100644 --- a/vendor/libpng/projects/vs2008/libpng.vcxproj +++ b/vendor/libpng/projects/vs2008/libpng.vcxproj @@ -21,15 +21,15 @@ StaticLibrary - v120 + v120_xp StaticLibrary - v120 + v120_xp StaticLibrary - v120 + v120_xp @@ -64,7 +64,6 @@ libpng_d - ..\..\$(PlatformTarget)\$(Configuration)\ libpng diff --git a/vendor/lua/mak.vs2008/lua5.1c_dll.vcxproj b/vendor/lua/mak.vs2008/lua5.1c_dll.vcxproj index c8c9951df6a..bfc1358cc36 100644 --- a/vendor/lua/mak.vs2008/lua5.1c_dll.vcxproj +++ b/vendor/lua/mak.vs2008/lua5.1c_dll.vcxproj @@ -22,17 +22,17 @@ DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte @@ -70,7 +70,7 @@ lua5.1c - ..\$(PlatformTarget)\$(Configuration)Client\ + $(SolutionDir)..\output\MTA San Andreas\mods\deathmatch\ false lua5.1c @@ -163,7 +163,7 @@ true - ../../../symbols/$(Configuration)_$(ProjectName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Windows true diff --git a/vendor/lua/mak.vs2008/lua5.1s_dll.vcproj b/vendor/lua/mak.vs2008/lua5.1s_dll.vcproj index 1135b4ea26e..e9b7ace095b 100644 --- a/vendor/lua/mak.vs2008/lua5.1s_dll.vcproj +++ b/vendor/lua/mak.vs2008/lua5.1s_dll.vcproj @@ -46,7 +46,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../../Shared/publicsdk/lua/include" - PreprocessorDefinitions="LUA_USE_APICHECK;LUA_BUILD_AS_DLL" + PreprocessorDefinitions="LUA_BUILD_AS_DLL" StringPooling="true" MinimalRebuild="true" BasicRuntimeChecks="3" diff --git a/vendor/lua/mak.vs2008/lua5.1s_dll.vcxproj b/vendor/lua/mak.vs2008/lua5.1s_dll.vcxproj index 335cc07bd48..5c2329a8df7 100644 --- a/vendor/lua/mak.vs2008/lua5.1s_dll.vcxproj +++ b/vendor/lua/mak.vs2008/lua5.1s_dll.vcxproj @@ -34,32 +34,32 @@ DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte @@ -124,12 +124,12 @@ lua5.1 - ..\..\..\output\MTA San Andreas\server\mods\deathmatch\ + $(SolutionDir)..\output\MTA San Andreas\server\mods\deathmatch\ false lua5.1 - ..\..\..\output\MTA San Andreas\server\$(PlatformTarget)\ + $(SolutionDir)..\output\MTA San Andreas\server\$(PlatformTarget)\ false lua5.1 @@ -137,7 +137,7 @@ Disabled ../../../Shared/publicsdk/lua/include;%(AdditionalIncludeDirectories) - LUA_USE_APICHECK;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) + LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) true true EnableFastChecks @@ -206,7 +206,7 @@ - MaxSpeed + Custom ../../../Shared/publicsdk/lua/include;%(AdditionalIncludeDirectories) LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) true @@ -218,6 +218,8 @@ ProgramDatabase CompileAsC 4996;%(DisableSpecificWarnings) + Disabled + Size ../include;%(AdditionalIncludeDirectories) @@ -225,7 +227,6 @@ true - ../../../symbols/$(Configuration)_$(ProjectName).pdb Windows true @@ -279,7 +280,7 @@ - MaxSpeed + Custom ../../../Shared/publicsdk/lua/include;%(AdditionalIncludeDirectories) LUA_BUILD_AS_DLL;%(PreprocessorDefinitions) true @@ -290,6 +291,8 @@ ProgramDatabase CompileAsC 4996;%(DisableSpecificWarnings) + Speed + Disabled ../include;%(AdditionalIncludeDirectories) @@ -297,7 +300,7 @@ true - ../../../symbols/$(Configuration)_$(ProjectName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Windows true @@ -334,7 +337,7 @@ true - ../../../symbols/$(Configuration)_$(PlatformTarget)_$(ProjectName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb Windows true diff --git a/vendor/lua/src/lauxlib.c b/vendor/lua/src/lauxlib.c index 10f14e2c088..32170eb8f1b 100644 --- a/vendor/lua/src/lauxlib.c +++ b/vendor/lua/src/lauxlib.c @@ -74,7 +74,7 @@ LUALIB_API void luaL_where (lua_State *L, int level) { lua_Debug ar; if (lua_getstack(L, level, &ar)) { /* check function at level */ lua_getinfo(L, "Sl", &ar); /* get info about it */ - if (ar.currentline > 0) { /* is there info? */ + if (ar.currentline >= 0) { /* is there info? */ lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); return; } diff --git a/vendor/pcre/pcre 2008.vcxproj b/vendor/pcre/pcre 2008.vcxproj index dc90442686e..1cbe99ada99 100644 --- a/vendor/pcre/pcre 2008.vcxproj +++ b/vendor/pcre/pcre 2008.vcxproj @@ -35,36 +35,36 @@ DynamicLibrary - v120 + v120_xp Unicode true DynamicLibrary - v120 + v120_xp Unicode true DynamicLibrary - v120 + v120_xp Unicode DynamicLibrary - v120 + v120_xp Unicode true DynamicLibrary - v120 + v120_xp Unicode true DynamicLibrary - v120 + v120_xp Unicode @@ -119,11 +119,9 @@ pcre3 - $(PlatformTarget)\$(Configuration)\ pcre3 - $(PlatformTarget)\$(Configuration)\ pcre3 @@ -237,7 +235,7 @@ true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb $(IntDir)$(TargetName).lib @@ -262,7 +260,7 @@ true - ../../symbols/$(Configuration)_$(PlatformTarget)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb $(IntDir)$(TargetName).lib MachineX64 diff --git a/vendor/pme/vs2008/pme 2008.vcxproj b/vendor/pme/vs2008/pme 2008.vcxproj index a5af7ca913a..17704f17a88 100644 --- a/vendor/pme/vs2008/pme 2008.vcxproj +++ b/vendor/pme/vs2008/pme 2008.vcxproj @@ -34,37 +34,37 @@ StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte StaticLibrary - v120 + v120_xp false MultiByte @@ -126,11 +126,9 @@ pme_d - ..\$(PlatformTarget)\$(Configuration)\ pme - ..\$(PlatformTarget)\$(Configuration)\ pme diff --git a/vendor/pthreads/pthread 2013.vcxproj b/vendor/pthreads/pthread 2013.vcxproj index 6b5c268ae14..cc1166077fe 100644 --- a/vendor/pthreads/pthread 2013.vcxproj +++ b/vendor/pthreads/pthread 2013.vcxproj @@ -47,36 +47,36 @@ DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte true DynamicLibrary - v120 + v120_xp MultiByte @@ -131,11 +131,9 @@ pthread - $(PlatformTarget)\$(Configuration)\ pthread - $(PlatformTarget)\$(Configuration)\ pthread @@ -249,7 +247,7 @@ true - ../../symbols/$(Configuration)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb $(IntDir)$(TargetName).lib @@ -274,7 +272,7 @@ true - ../../symbols/$(Configuration)_$(PlatformTarget)_$(SafeParentName).pdb + $(SolutionDir)..\symbols\$(Configuration)_$(SafeRootNamespace).pdb $(IntDir)$(TargetName).lib MachineX64 diff --git a/vendor/sqlite/sqlite.vcxproj b/vendor/sqlite/sqlite.vcxproj index 743235ced01..06f76addf4d 100644 --- a/vendor/sqlite/sqlite.vcxproj +++ b/vendor/sqlite/sqlite.vcxproj @@ -22,19 +22,19 @@ DynamicLibrary - v120 + v120_xp Unicode true DynamicLibrary - v120 + v120_xp Unicode true DynamicLibrary - v120 + v120_xp Unicode diff --git a/vendor/unrar/UnRARDll.vcxproj b/vendor/unrar/UnRARDll.vcxproj index cd1feccaf6f..68219de270f 100644 --- a/vendor/unrar/UnRARDll.vcxproj +++ b/vendor/unrar/UnRARDll.vcxproj @@ -27,23 +27,23 @@ Application - v120 + v120_xp StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte true StaticLibrary - v120 + v120_xp MultiByte @@ -77,9 +77,7 @@ build\unrardll32\$(Configuration)\ build\unrardll32\$(Configuration)\obj\ - - build\unrardll32\$(Configuration)\ - + $(SolutionDir)$(Configuration)\ $(Configuration)\ diff --git a/vendor/zlib/zlib 2008.vcxproj b/vendor/zlib/zlib 2008.vcxproj index d10423633b7..6733cafed4d 100644 --- a/vendor/zlib/zlib 2008.vcxproj +++ b/vendor/zlib/zlib 2008.vcxproj @@ -34,32 +34,32 @@ StaticLibrary - v120 + v120_xp false StaticLibrary - v120 + v120_xp false StaticLibrary - v120 + v120_xp false StaticLibrary - v120 + v120_xp false StaticLibrary - v120 + v120_xp false StaticLibrary - v120 + v120_xp false @@ -100,11 +100,9 @@ <_ProjectFileVersion>12.0.21005.1 - $(PlatformTarget)\$(Configuration)\ zlib - $(PlatformTarget)\$(Configuration)\ zlib