diff options
author | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-07 07:23:34 +0000 |
---|---|---|
committer | ukai@chromium.org <ukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-07 07:23:34 +0000 |
commit | e00ba01409c8f249acf31d578e9853867daa15cb (patch) | |
tree | a6e602821b310429f74c86008eb7f18858671097 /chrome/browser/worker_host | |
parent | 743f2d42d3bcf91d4992cedd160cc2db67df1b15 (diff) | |
download | chromium_src-e00ba01409c8f249acf31d578e9853867daa15cb.zip chromium_src-e00ba01409c8f249acf31d578e9853867daa15cb.tar.gz chromium_src-e00ba01409c8f249acf31d578e9853867daa15cb.tar.bz2 |
WebSocket in Worker: commandline passing for worker process.
Pass feature control command line flags to worker process, and enable WebKit features in worker.
Also, passing logging flags and prepend --render-cmd-prefix if specified.
BUG=27618
TEST=none
Review URL: http://codereview.chromium.org/445003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33957 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/worker_host')
-rw-r--r-- | chrome/browser/worker_host/worker_process_host.cc | 39 | ||||
-rw-r--r-- | chrome/browser/worker_host/worker_process_host.h | 2 |
2 files changed, 37 insertions, 4 deletions
diff --git a/chrome/browser/worker_host/worker_process_host.cc b/chrome/browser/worker_host/worker_process_host.cc index e2be3ef..3373e2f 100644 --- a/chrome/browser/worker_host/worker_process_host.cc +++ b/chrome/browser/worker_host/worker_process_host.cc @@ -52,8 +52,8 @@ class WorkerCrashTask : public Task { WorkerProcessHost::WorkerProcessHost( - ResourceDispatcherHost* resource_dispatcher_host_) - : ChildProcessHost(WORKER_PROCESS, resource_dispatcher_host_) { + ResourceDispatcherHost* resource_dispatcher_host) + : ChildProcessHost(WORKER_PROCESS, resource_dispatcher_host) { next_route_id_callback_.reset(NewCallbackWithReturnValue( WorkerService::GetInstance(), &WorkerService::next_worker_route_id)); } @@ -105,6 +105,40 @@ bool WorkerProcessHost::Init() { cmd_line->AppendSwitch(switches::kWorkerStartupDialog); } + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableLogging)) { + cmd_line->AppendSwitch(switches::kEnableLogging); + } + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kLoggingLevel)) { + const std::wstring level = + CommandLine::ForCurrentProcess()->GetSwitchValue( + switches::kLoggingLevel); + cmd_line->AppendSwitchWithValue( + switches::kLoggingLevel, level); + } + + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableWebSockets)) { + cmd_line->AppendSwitch(switches::kDisableWebSockets); + } +#if defined(OS_WIN) + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kDisableDesktopNotifications)) { + cmd_line->AppendSwitch(switches::kDisableDesktopNotifications); + } +#endif + +#if defined(OS_POSIX) + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kRendererCmdPrefix)) { + const std::wstring prefix = + CommandLine::ForCurrentProcess()->GetSwitchValue( + switches::kRendererCmdPrefix); + cmd_line->PrependWrapper(prefix); + } +#endif + Launch( #if defined(OS_WIN) FilePath(), @@ -523,4 +557,3 @@ WorkerProcessHost::WorkerInstance::GetSender() const { DCHECK(NumSenders() == 1); return *senders_.begin(); } - diff --git a/chrome/browser/worker_host/worker_process_host.h b/chrome/browser/worker_host/worker_process_host.h index 48a59e8..1834725 100644 --- a/chrome/browser/worker_host/worker_process_host.h +++ b/chrome/browser/worker_host/worker_process_host.h @@ -99,7 +99,7 @@ class WorkerProcessHost : public ChildProcessHost { DocumentSet document_set_; }; - explicit WorkerProcessHost(ResourceDispatcherHost* resource_dispatcher_host_); + explicit WorkerProcessHost(ResourceDispatcherHost* resource_dispatcher_host); ~WorkerProcessHost(); // Starts the process. Returns true iff it succeeded. |