summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 16:48:26 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-10 16:48:26 +0000
commitf8b6b6fbd20068286b05d557c16c419b95dbab7f (patch)
tree102dccb008bdb1f6b4eb35de6793d51d7d720ead
parente041ed196ecb55846388b88b8f8452d211c14e4c (diff)
downloadchromium_src-f8b6b6fbd20068286b05d557c16c419b95dbab7f.zip
chromium_src-f8b6b6fbd20068286b05d557c16c419b95dbab7f.tar.gz
chromium_src-f8b6b6fbd20068286b05d557c16c419b95dbab7f.tar.bz2
Adds logging of main URL for IPC messages. This is just a start. I
want to see how useful this is before I expand it to other logging areas (like timers). BUG=none TEST=none Review URL: http://codereview.chromium.org/41022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11337 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/render_view.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index db11b68..5c2b948 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -65,6 +65,7 @@
#if defined(OS_WIN)
// TODO(port): these files are currently Windows only because they concern:
+// * logging
// * plugins
// * printing
// * theming
@@ -72,12 +73,21 @@
#include "base/gfx/gdi_util.h"
#include "base/gfx/native_theme.h"
#include "chrome/common/gfx/emf.h"
+#include "chrome/renderer/renderer_logging.h"
#include "chrome/views/message_box_view.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/renderer/chrome_plugin_host.h"
#include "skia/ext/vector_canvas.h"
#endif
+#if defined(OS_WIN)
+// If true, the URL of the active renderer is logged. Logging is done in such
+// way that if the renderer crashes the URL of the active renderer is contained
+// in the dump. Currently mini-dumps are only supported on windows, so this is
+// only enabled on windows.
+#define LOG_RENDERER_URL
+#endif
+
using base::TimeDelta;
//-----------------------------------------------------------------------------
@@ -327,6 +337,12 @@ void RenderView::Init(gfx::NativeViewId parent_hwnd,
}
void RenderView::OnMessageReceived(const IPC::Message& message) {
+#ifdef LOG_RENDERER_URL
+ WebFrame* main_frame = webview() ? webview()->GetMainFrame() : NULL;
+ renderer_logging::ScopedActiveRenderingURLSetter url_setter(
+ main_frame ? main_frame->GetURL() : GURL());
+#endif
+
// If the current RenderView instance represents a popup, then we
// need to wait for ViewMsg_CreatingNew_ACK to be sent by the browser.
// As part of this ack we also receive the browser window handle, which
@@ -843,6 +859,10 @@ void RenderView::OnNavigate(const ViewMsg_Navigate_Params& params) {
if (!webview())
return;
+#ifdef LOG_RENDERER_URL
+ renderer_logging::ScopedActiveRenderingURLSetter url_setter(params.url);
+#endif
+
AboutHandler::MaybeHandle(params.url);
bool is_reload = params.reload;