mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Move frame-related methods from CefBrowser into a new CefFrame class.
- Add CefBrowser::Get*Frame() methods for retrieving the appropriate CefFrame instance. - Add a CefFrame attribute to CefHandler callback methods where appropriate. - Add support for V8 JavaScript extensions and values via CefV8Value and CefV8Handler. Native C++ and user-defined JavaScript object hierarchies may now be created and accessed using the CEF API. - Remove the CefHandler and CefVariant classes and related CefBrowser methods that have been obsoleted by the addition of CEF V8 support. - Add the CefRegisterExtension() function for registering system-wide V8 extensions. - Add the CefHandler::HandleJSBinding() callback method for attaching V8 values to the global frame JavaScript object. This method replaces the previous technique of calling CefBrowser::AddJSHandler(). - Add new wrapper template methods for simplifying DLL wrapper implementations. - Move cef_string* files from libcef_dll to libcef so that projects can link libcef statically without errors. - Fix crashes when CEF exits due to object constructors being executed on non-UI threads if the application is closed while a page is still loading. - Update the cefclient project to reflect changes and demonstrate the new APIs. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@26 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
49
libcef_dll/ctocpp/v8handler_ctocpp.cc
Normal file
49
libcef_dll/ctocpp/v8handler_ctocpp.cc
Normal file
@@ -0,0 +1,49 @@
|
||||
// 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 "../precompiled_libcef.h"
|
||||
#include "ctocpp/v8handler_ctocpp.h"
|
||||
#include "cpptoc/v8value_cpptoc.h"
|
||||
|
||||
|
||||
bool CefV8HandlerCToCpp::Execute(const std::wstring& name,
|
||||
CefRefPtr<CefV8Value> object,
|
||||
CefV8ValueList& arguments,
|
||||
CefRefPtr<CefV8Value>& retval,
|
||||
std::wstring& exception)
|
||||
{
|
||||
if(CEF_MEMBER_MISSING(struct_, execute))
|
||||
return RV_CONTINUE;
|
||||
|
||||
cef_v8value_t** argsStructPtr = NULL;
|
||||
int argsSize = arguments.size();
|
||||
if(argsSize > 0) {
|
||||
argsStructPtr = new cef_v8value_t*[argsSize];
|
||||
for(int i = 0; i < argsSize; ++i)
|
||||
argsStructPtr[i] = CefV8ValueCppToC::Wrap(arguments[i]);
|
||||
}
|
||||
|
||||
cef_v8value_t* retvalStruct = NULL;
|
||||
cef_string_t exceptionStr = NULL;
|
||||
|
||||
int rv = struct_->execute(struct_, name.c_str(),
|
||||
CefV8ValueCppToC::Wrap(object), argsSize, argsStructPtr, &retvalStruct,
|
||||
&exceptionStr);
|
||||
if(retvalStruct)
|
||||
retval = CefV8ValueCppToC::Unwrap(retvalStruct);
|
||||
if(exceptionStr) {
|
||||
exception = exceptionStr;
|
||||
cef_string_free(exceptionStr);
|
||||
}
|
||||
|
||||
if(argsStructPtr)
|
||||
delete [] argsStructPtr;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
long CefCToCpp<CefV8HandlerCToCpp, CefV8Handler, cef_v8handler_t>::DebugObjCt
|
||||
= 0;
|
||||
#endif
|
Reference in New Issue
Block a user