mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add CefFrame::GetV8Context() method for retrieving the V8 context of a frame (issue #344).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@345 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/request_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/stream_reader_ctocpp.h"
|
||||
#include "libcef_dll/ctocpp/v8context_ctocpp.h"
|
||||
|
||||
|
||||
// VIRTUAL METHODS - Body may be edited by hand.
|
||||
@@ -216,6 +217,18 @@ void CefFrameCToCpp::VisitDOM(CefRefPtr<CefDOMVisitor> visitor)
|
||||
struct_->visit_dom(struct_, CefDOMVisitorCppToC::Wrap(visitor));
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Context> CefFrameCToCpp::GetV8Context()
|
||||
{
|
||||
if (CEF_MEMBER_MISSING(struct_, get_v8context))
|
||||
return NULL;
|
||||
|
||||
cef_v8context_t* v8ContextStruct = struct_->get_v8context(struct_);
|
||||
if (v8ContextStruct)
|
||||
return CefV8ContextCToCpp::Wrap(v8ContextStruct);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NDEBUG
|
||||
template<> long CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>::DebugObjCt =
|
||||
|
@@ -56,6 +56,7 @@ public:
|
||||
virtual CefString GetURL() OVERRIDE;
|
||||
virtual CefRefPtr<CefBrowser> GetBrowser() OVERRIDE;
|
||||
virtual void VisitDOM(CefRefPtr<CefDOMVisitor> visitor) OVERRIDE;
|
||||
virtual CefRefPtr<CefV8Context> GetV8Context() OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // USING_CEF_SHARED
|
||||
|
Reference in New Issue
Block a user