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:
Marshall Greenblatt
2011-10-28 20:30:19 +00:00
parent 5147a4c7a0
commit 0ec9541b78
13 changed files with 154 additions and 16 deletions

View File

@@ -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 =

View File

@@ -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