Replace JSBindingHandler with a new V8ContextHandler interface that contains callbacks for V8 context creation and release (issue #359).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@392 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2011-11-21 21:21:55 +00:00
parent ead9b4508c
commit 605753c3b8
25 changed files with 335 additions and 195 deletions

View File

@@ -286,12 +286,12 @@ public:
DestroyTest();
}
virtual void OnJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object) OVERRIDE
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) OVERRIDE
{
if(binding_test_)
TestHandleJSBinding(browser, frame, object);
TestHandleJSBinding(browser, frame, context->GetGlobal());
}
void TestHandleJSBinding(CefRefPtr<CefBrowser> browser,
@@ -453,10 +453,13 @@ public:
DestroyTest();
}
virtual void OnJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object) OVERRIDE
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) OVERRIDE
{
// Retrieve the 'window' object.
CefRefPtr<CefV8Value> object = context->GetGlobal();
// Create the functions that will be used during the test.
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(NULL, NULL);
CefRefPtr<CefV8Handler> handler = new TestHandler(this);
@@ -683,10 +686,13 @@ public:
{
}
virtual void OnJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object) OVERRIDE
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) OVERRIDE
{
// Retrieve the 'window' object.
CefRefPtr<CefV8Value> object = context->GetGlobal();
CefRefPtr<CefV8Context> cc = CefV8Context::GetCurrentContext();
CefRefPtr<CefBrowser> currentBrowser = cc->GetBrowser();
CefRefPtr<CefFrame> currentFrame = cc->GetFrame();
@@ -1374,10 +1380,13 @@ public:
nav_++;
}
virtual void OnJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object) OVERRIDE
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) OVERRIDE
{
// Retrieve the 'window' object.
CefRefPtr<CefV8Value> object = context->GetGlobal();
if (nav_ == 0) {
// Create an object without any internal values.
CefRefPtr<CefV8Value> obj1 = CefV8Value::CreateObject(NULL, NULL);
@@ -1669,10 +1678,13 @@ public:
3, false));
}
virtual void OnJSBinding(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Value> object) OVERRIDE
virtual void OnContextCreated(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
CefRefPtr<CefV8Context> context) OVERRIDE
{
// Retrieve the 'window' object.
CefRefPtr<CefV8Value> object = context->GetGlobal();
// Create the functions that will be used during the test.
CefRefPtr<CefV8Value> obj = CefV8Value::CreateObject(NULL, NULL);
CefRefPtr<CefV8Handler> handler = new TestHandler(this);