diff options
-rw-r--r-- | chrome/browser/in_process_webkit/webkit_thread.cc | 11 | ||||
-rw-r--r-- | chrome/browser/renderer_host/browser_render_process_host.cc | 1 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 4 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 1 | ||||
-rw-r--r-- | chrome/renderer/render_thread.cc | 4 | ||||
-rw-r--r-- | chrome/worker/worker_thread.cc | 4 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.cc | 10 | ||||
-rw-r--r-- | webkit/glue/webkit_glue.h | 4 | ||||
-rw-r--r-- | webkit/tools/test_shell/test_shell.cc | 2 |
9 files changed, 33 insertions, 8 deletions
diff --git a/chrome/browser/in_process_webkit/webkit_thread.cc b/chrome/browser/in_process_webkit/webkit_thread.cc index b2b469b..3af9826 100644 --- a/chrome/browser/in_process_webkit/webkit_thread.cc +++ b/chrome/browser/in_process_webkit/webkit_thread.cc @@ -1,6 +1,6 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this -// source code is governed by a BSD-style license that can be found in the -// LICENSE file. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. #include "chrome/browser/in_process_webkit/webkit_thread.h" @@ -8,6 +8,7 @@ #include "chrome/browser/in_process_webkit/browser_webkitclient_impl.h" #include "chrome/common/chrome_switches.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" +#include "webkit/glue/webkit_glue.h" WebKitThread::WebKitThread() { } @@ -46,6 +47,10 @@ void WebKitThread::InternalWebKitThread::Init() { DCHECK(!webkit_client_.get()); webkit_client_.reset(new BrowserWebKitClientImpl); WebKit::initialize(webkit_client_.get()); + webkit_glue::EnableWebCoreLogChannels( + CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kWebCoreLogChannels)); + // If possible, post initialization tasks to this thread (rather than doing // them now) so we don't block the UI thread any longer than we have to. } diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index e3aabd3..be7cc29 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -741,6 +741,7 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer( switches::kV, switches::kVideoThreads, switches::kVModule, + switches::kWebCoreLogChannels, }; renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames, arraysize(kSwitchNames)); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index c4d19bf..a80cae4 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -1233,6 +1233,10 @@ const char kVersion[] = "version"; // kWaitForDebugger flag passed on or not. const char kWaitForDebuggerChildren[] = "wait-for-debugger-children"; +// Choose which logging channels in WebCore to activate. See +// Logging.cpp in WebKit's WebCore for a list of available channels. +const char kWebCoreLogChannels[] = "webcore-log-channels"; + // Causes the worker process allocation to use as many processes as cores. const char kWebWorkerProcessPerCore[] = "web-worker-process-per-core"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 988c2f2..c11445e 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -343,6 +343,7 @@ extern const char kUtilityProcess[]; extern const char kUtilityProcessAllowedDir[]; extern const char kVersion[]; extern const char kWaitForDebuggerChildren[]; +extern const char kWebCoreLogChannels[]; extern const char kWebWorkerProcessPerCore[]; extern const char kWebWorkerShareProcesses[]; extern const char kWinHttpProxyResolver[]; diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc index 85bcddc..54e4694 100644 --- a/chrome/renderer/render_thread.cc +++ b/chrome/renderer/render_thread.cc @@ -95,6 +95,7 @@ #include "webkit/extensions/v8/benchmarking_extension.h" #include "webkit/extensions/v8/gears_extension.h" #include "webkit/extensions/v8/playback_extension.h" +#include "webkit/glue/webkit_glue.h" #include "v8/include/v8.h" #if defined(OS_WIN) @@ -865,6 +866,9 @@ void RenderThread::EnsureWebKitInitialized() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + webkit_glue::EnableWebCoreLogChannels( + command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); + // chrome: pages should not be accessible by normal content, and should // also be unable to script anything but themselves (to help limit the damage // that a corrupt chrome: page could cause). diff --git a/chrome/worker/worker_thread.cc b/chrome/worker/worker_thread.cc index 90bf9b6..951a80f 100644 --- a/chrome/worker/worker_thread.cc +++ b/chrome/worker/worker_thread.cc @@ -20,6 +20,7 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebDatabase.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" +#include "webkit/glue/webkit_glue.h" using WebKit::WebRuntimeFeatures; @@ -41,6 +42,9 @@ WorkerThread::WorkerThread() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + webkit_glue::EnableWebCoreLogChannels( + command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); + WebKit::WebRuntimeFeatures::enableDatabase( !command_line.HasSwitch(switches::kDisableDatabases)); diff --git a/webkit/glue/webkit_glue.cc b/webkit/glue/webkit_glue.cc index 6d76c71..ce4bf41 100644 --- a/webkit/glue/webkit_glue.cc +++ b/webkit/glue/webkit_glue.cc @@ -15,6 +15,7 @@ #include "base/logging.h" #include "base/scoped_ptr.h" #include "base/string_piece.h" +#include "base/string_tokenizer.h" #include "base/string_util.h" #include "base/stringprintf.h" #include "base/sys_info.h" @@ -80,8 +81,13 @@ void SetJavaScriptFlags(const std::string& str) { #endif } -void EnableWebCoreNotImplementedLogging() { - WebKit::enableLogChannel("NotYetImplemented"); +void EnableWebCoreLogChannels(const std::string& channels) { + if (channels.empty()) + return; + StringTokenizer t(channels, ", "); + while (t.GetNext()) { + WebKit::enableLogChannel(t.token().c_str()); + } } string16 DumpDocumentText(WebFrame* web_frame) { diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h index c742c09..d2cdd5f 100644 --- a/webkit/glue/webkit_glue.h +++ b/webkit/glue/webkit_glue.h @@ -51,8 +51,8 @@ namespace webkit_glue { void SetJavaScriptFlags(const std::string& flags); -// Turn on the logging for notImplemented() calls from WebCore. -void EnableWebCoreNotImplementedLogging(); +// Turn on logging for flags in the provided comma delimited list. +void EnableWebCoreLogChannels(const std::string& channels); // Returns the text of the document element. string16 DumpDocumentText(WebKit::WebFrame* web_frame); diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 2ffacc6..f106c35 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -266,7 +266,7 @@ void TestShell::InitLogging(bool suppress_error_dialogs, // not running layout tests (because otherwise they'd corrupt the test // output). if (!layout_test_mode) - webkit_glue::EnableWebCoreNotImplementedLogging(); + webkit_glue::EnableWebCoreLogChannels("NotYetImplemented"); } // static |