- Pass information to the renderer process synchronously on render thread creation and new browser creation to avoid race conditions (issue #744).

- Add the ability to pass extra information to child processes using a new CefBrowserProcessHandler::OnRenderProcessThreadCreated callback (issue #744).
- Fix OnBeforeChildProcessLaunch documentation (issue #754).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@910 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-11-20 20:08:36 +00:00
parent 8a504d3d25
commit 1e871cc2c8
32 changed files with 957 additions and 234 deletions

View File

@@ -57,6 +57,22 @@ void CefRenderProcessObserver::WebKitInitialized() {
// Register any custom schemes with WebKit.
CefContentRendererClient::Get()->RegisterCustomSchemes();
if (pending_cross_origin_whitelist_entries_.size() > 0) {
// Add pending cross-origin white list entries.
for (size_t i = 0;
i < pending_cross_origin_whitelist_entries_.size(); ++i) {
const Cef_CrossOriginWhiteListEntry_Params& entry =
pending_cross_origin_whitelist_entries_[i];
GURL gurl = GURL(entry.source_origin);
WebKit::WebSecurityPolicy::addOriginAccessWhitelistEntry(
gurl,
WebKit::WebString::fromUTF8(entry.target_protocol),
WebKit::WebString::fromUTF8(entry.target_domain),
entry.allow_target_subdomains);
}
pending_cross_origin_whitelist_entries_.clear();
}
// The number of stack trace frames to capture for uncaught exceptions.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kUncaughtExceptionStackSize)) {
@@ -86,23 +102,20 @@ void CefRenderProcessObserver::WebKitInitialized() {
void CefRenderProcessObserver::OnModifyCrossOriginWhitelistEntry(
bool add,
const std::string& source_origin,
const std::string& target_protocol,
const std::string& target_domain,
bool allow_target_subdomains) {
GURL gurl = GURL(source_origin);
const Cef_CrossOriginWhiteListEntry_Params& params) {
GURL gurl = GURL(params.source_origin);
if (add) {
WebKit::WebSecurityPolicy::addOriginAccessWhitelistEntry(
gurl,
WebKit::WebString::fromUTF8(target_protocol),
WebKit::WebString::fromUTF8(target_domain),
allow_target_subdomains);
WebKit::WebString::fromUTF8(params.target_protocol),
WebKit::WebString::fromUTF8(params.target_domain),
params.allow_target_subdomains);
} else {
WebKit::WebSecurityPolicy::removeOriginAccessWhitelistEntry(
gurl,
WebKit::WebString::fromUTF8(target_protocol),
WebKit::WebString::fromUTF8(target_domain),
allow_target_subdomains);
WebKit::WebString::fromUTF8(params.target_protocol),
WebKit::WebString::fromUTF8(params.target_domain),
params.allow_target_subdomains);
}
}