Add support for V8 startup tests and a new V8Test.Extension test (issue #712).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@818 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-09-28 17:11:10 +00:00
parent 149ae3df88
commit 410bbcfea4
5 changed files with 178 additions and 47 deletions

View File

@@ -176,6 +176,7 @@ class ClientAppExtensionHandler : public CefV8Handler {
ClientApp::ClientApp()
: proxy_type_(CEF_PROXY_TYPE_DIRECT) {
CreateBrowserDelegates(browser_delegates_);
CreateRenderDelegates(render_delegates_);
// Default schemes that support cookies.
@@ -213,6 +214,19 @@ void ClientApp::OnContextInitialized() {
CefRefPtr<CefCookieManager> manager = CefCookieManager::GetGlobalManager();
ASSERT(manager.get());
manager->SetSupportedSchemes(cookieable_schemes_);
// Execute delegate callbacks.
BrowserDelegateSet::iterator it = browser_delegates_.begin();
for (; it != browser_delegates_.end(); ++it)
(*it)->OnContextInitialized(this);
}
void ClientApp::OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) {
// Execute delegate callbacks.
BrowserDelegateSet::iterator it = browser_delegates_.begin();
for (; it != browser_delegates_.end(); ++it)
(*it)->OnBeforeChildProcessLaunch(this, command_line);
}
void ClientApp::GetProxyForUrl(const CefString& url,

View File

@@ -18,6 +18,26 @@ class ClientApp : public CefApp,
public CefProxyHandler,
public CefRenderProcessHandler {
public:
// Interface for browser delegates. All BrowserDelegates must be returned via
// CreateBrowserDelegates. Do not perform work in the BrowserDelegate
// constructor.
class BrowserDelegate : public virtual CefBase {
public:
// Called on the browser process UI thread immediately after the CEF context
// has been initialized.
virtual void OnContextInitialized(CefRefPtr<ClientApp> app) {
}
// Called on the browser process IO thread before a child process is launched.
// Provides an opportunity to modify the child process command line.
virtual void OnBeforeChildProcessLaunch(
CefRefPtr<ClientApp> app,
CefRefPtr<CefCommandLine> command_line) {
}
};
typedef std::set<CefRefPtr<BrowserDelegate> > BrowserDelegateSet;
// Interface for renderer delegates. All RenderDelegates must be returned via
// CreateRenderDelegates. Do not perform work in the RenderDelegate
// constructor.
@@ -97,6 +117,10 @@ class ClientApp : public CefApp,
int browser_id);
private:
// Creates all of the BrowserDelegate objects. Implemented in
// client_app_delegates.
static void CreateBrowserDelegates(BrowserDelegateSet& delegates);
// Creates all of the RenderDelegate objects. Implemented in
// client_app_delegates.
static void CreateRenderDelegates(RenderDelegateSet& delegates);
@@ -117,7 +141,9 @@ class ClientApp : public CefApp,
// CefBrowserProcessHandler methods.
virtual CefRefPtr<CefProxyHandler> GetProxyHandler() OVERRIDE { return this; }
virtual void OnContextInitialized();
virtual void OnContextInitialized() OVERRIDE;
virtual void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
// CefProxyHandler methods.
virtual void GetProxyForUrl(const CefString& url,
@@ -150,6 +176,9 @@ class ClientApp : public CefApp,
CallbackMap;
CallbackMap callback_map_;
// Set of supported BrowserDelegates.
BrowserDelegateSet browser_delegates_;
// Set of supported RenderDelegates.
RenderDelegateSet render_delegates_;

View File

@@ -7,6 +7,10 @@
#include "cefclient/dom_test.h"
#include "cefclient/scheme_test.h"
// static
void ClientApp::CreateBrowserDelegates(BrowserDelegateSet& delegates) {
}
// static
void ClientApp::CreateRenderDelegates(RenderDelegateSet& delegates) {
client_renderer::CreateRenderDelegates(delegates);