mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix proxy V8 initialization failure resulting from Chromium update.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1110 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -20,7 +20,9 @@
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
#include "net/base/net_module.h"
|
||||
#include "net/proxy/proxy_resolver_v8.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -34,7 +36,8 @@ base::StringPiece ResourceProvider(int resource_id) {
|
||||
CefBrowserMainParts::CefBrowserMainParts(
|
||||
const content::MainFunctionParams& parameters)
|
||||
: BrowserMainParts(),
|
||||
devtools_delegate_(NULL) {
|
||||
devtools_delegate_(NULL),
|
||||
proxy_v8_isolate_(NULL) {
|
||||
}
|
||||
|
||||
CefBrowserMainParts::~CefBrowserMainParts() {
|
||||
@@ -60,6 +63,15 @@ int CefBrowserMainParts::PreCreateThreads() {
|
||||
user_prefs_ = new BrowserPrefStore();
|
||||
user_prefs_->SetInitializationCompleted();
|
||||
|
||||
// Create a v8::Isolate for the current thread if it doesn't already exist.
|
||||
if (!v8::Isolate::GetCurrent()) {
|
||||
proxy_v8_isolate_ = v8::Isolate::New();
|
||||
proxy_v8_isolate_->Enter();
|
||||
}
|
||||
|
||||
// Initialize the V8 proxy integration.
|
||||
net::ProxyResolverV8::RememberDefaultIsolate();
|
||||
|
||||
// Initialize proxy configuration tracker.
|
||||
pref_proxy_config_tracker_.reset(
|
||||
ProxyServiceFactory::CreatePrefProxyConfigTracker(
|
||||
@@ -105,5 +117,10 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
|
||||
void CefBrowserMainParts::PostDestroyThreads() {
|
||||
pref_proxy_config_tracker_.reset(NULL);
|
||||
|
||||
if (proxy_v8_isolate_) {
|
||||
proxy_v8_isolate_->Exit();
|
||||
proxy_v8_isolate_->Dispose();
|
||||
}
|
||||
|
||||
PlatformCleanup();
|
||||
}
|
||||
|
Reference in New Issue
Block a user