mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Introduce CefV8Exception for returning detailed exception information from CefV8Value::ExecuteFunction*() and add the ability to re-throw exceptions. (issue #317).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@371 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
96
libcef_dll/ctocpp/v8exception_ctocpp.cc
Normal file
96
libcef_dll/ctocpp/v8exception_ctocpp.cc
Normal file
@ -0,0 +1,96 @@
|
||||
// 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.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// A portion of this file was generated by the CEF translator tool. When
|
||||
// making changes by hand only do so within the body of existing static and
|
||||
// virtual method 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()
|
||||
{
|
||||
CefString str;
|
||||
if (CEF_MEMBER_MISSING(struct_, get_message))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_message(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefV8ExceptionCToCpp::GetSourceLine()
|
||||
{
|
||||
CefString str;
|
||||
if (CEF_MEMBER_MISSING(struct_, get_source_line))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_source_line(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
CefString CefV8ExceptionCToCpp::GetScriptResourceName()
|
||||
{
|
||||
CefString str;
|
||||
if (CEF_MEMBER_MISSING(struct_, get_script_resource_name))
|
||||
return str;
|
||||
|
||||
cef_string_userfree_t strPtr = struct_->get_script_resource_name(struct_);
|
||||
str.AttachToUserFree(strPtr);
|
||||
return str;
|
||||
}
|
||||
|
||||
int CefV8ExceptionCToCpp::GetLineNumber()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, get_line_number))
|
||||
return 0;
|
||||
|
||||
return struct_->get_line_number(struct_);
|
||||
}
|
||||
|
||||
int CefV8ExceptionCToCpp::GetStartPosition()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, get_start_position))
|
||||
return 0;
|
||||
|
||||
return struct_->get_start_position(struct_);
|
||||
}
|
||||
|
||||
int CefV8ExceptionCToCpp::GetEndPosition()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, get_end_position))
|
||||
return 0;
|
||||
|
||||
return struct_->get_end_position(struct_);
|
||||
}
|
||||
|
||||
int CefV8ExceptionCToCpp::GetStartColumn()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, get_start_column))
|
||||
return 0;
|
||||
|
||||
return struct_->get_start_column(struct_);
|
||||
}
|
||||
|
||||
int CefV8ExceptionCToCpp::GetEndColumn()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, get_end_column))
|
||||
return 0;
|
||||
|
||||
return struct_->get_end_column(struct_);
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefV8ExceptionCToCpp, CefV8Exception,
|
||||
cef_v8exception_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user