summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorgavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 14:52:30 +0000
committergavinp@chromium.org <gavinp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-16 14:52:30 +0000
commitd471190afa7f7ef0b7d19494dd5406c0b0ccb576 (patch)
tree9e27dbbdb4ff30807ec040c4180e84350746255e /chrome
parent6d97d7d2260c457f891247770be3795aeb3e257c (diff)
downloadchromium_src-d471190afa7f7ef0b7d19494dd5406c0b0ccb576.zip
chromium_src-d471190afa7f7ef0b7d19494dd5406c0b0ccb576.tar.gz
chromium_src-d471190afa7f7ef0b7d19494dd5406c0b0ccb576.tar.bz2
Expose WebCore log channels on the chrome command line
Add --webcore-log-channels=Loading,ResourceLoading to your chrome command line to get WebKit debugging joy. See third_party/WebKit/Source/WebCore/platform/Logging.cpp for a list of log levels. BUG=none TEST=none Review URL: http://codereview.chromium.org/6528016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/in_process_webkit/webkit_thread.cc11
-rw-r--r--chrome/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/renderer/render_thread.cc4
-rw-r--r--chrome/worker/worker_thread.cc4
6 files changed, 22 insertions, 3 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));