mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Introduce chrome proxy implementation based on command-line flags (issue #600).
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@1080 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/message_loop.h"
|
||||
#include "base/string_number_conversions.h"
|
||||
#include "chrome/browser/net/proxy_service_factory.h"
|
||||
#include "content/public/browser/gpu_data_manager.h"
|
||||
#include "content/public/common/content_client.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
@ -54,12 +55,28 @@ int CefBrowserMainParts::PreCreateThreads() {
|
||||
// before the IO thread is started.
|
||||
content::GpuDataManager::GetInstance();
|
||||
|
||||
// Initialize user preferences.
|
||||
user_prefs_ = new BrowserPrefStore();
|
||||
user_prefs_->SetInitializationCompleted();
|
||||
|
||||
// Initialize proxy configuration tracker.
|
||||
pref_proxy_config_tracker_.reset(
|
||||
ProxyServiceFactory::CreatePrefProxyConfigTracker(
|
||||
user_prefs_->CreateService()));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void CefBrowserMainParts::PreMainMessageLoopRun() {
|
||||
browser_context_.reset(new CefBrowserContext());
|
||||
|
||||
// Initialize proxy configuration service.
|
||||
ChromeProxyConfigService* chrome_proxy_config_service =
|
||||
ProxyServiceFactory::CreateProxyConfigService(true);
|
||||
proxy_config_service_.reset(chrome_proxy_config_service);
|
||||
pref_proxy_config_tracker_->SetChromeProxyConfigService(
|
||||
chrome_proxy_config_service);
|
||||
|
||||
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
||||
if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
|
||||
std::string port_str =
|
||||
@ -76,9 +93,12 @@ void CefBrowserMainParts::PreMainMessageLoopRun() {
|
||||
void CefBrowserMainParts::PostMainMessageLoopRun() {
|
||||
if (devtools_delegate_)
|
||||
devtools_delegate_->Stop();
|
||||
pref_proxy_config_tracker_->DetachFromPrefService();
|
||||
browser_context_.reset();
|
||||
}
|
||||
|
||||
void CefBrowserMainParts::PostDestroyThreads() {
|
||||
pref_proxy_config_tracker_.reset(NULL);
|
||||
|
||||
PlatformCleanup();
|
||||
}
|
||||
|
Reference in New Issue
Block a user