summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/about_handler.h
blob: d79f341b70fe56aea2132094e2ebec2f08a992d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2006-2008 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.

// Contains code for handling "about:" URLs in the renderer process.  We handle
// most about: URLs in the browser process (see
// browser/browser_about_handler.*), but test URLs like about:crash need to
// happen in the renderer.

#ifndef CHROME_RENDERER_ABOUT_HANDLER_H__
#define CHROME_RENDERER_ABOUT_HANDLER_H__

#include "base/basictypes.h"

class GURL;

class AboutHandler {
 public:
  // Given a URL, determine whether or not to handle it specially.  Returns
  // true if the URL was handled.
  static bool MaybeHandle(const GURL& url);

  // Returns true if the URL is one that this AboutHandler will handle when
  // MaybeHandle is called.
  static bool WillHandle(const GURL& url);

  // Induces a renderer crash.
  static void AboutCrash();

  // Induces a renderer hang.
  static void AboutHang();

  // Induces a brief (20 second) hang to make sure hang monitors go away.
  static void AboutShortHang();

 private:
  AboutHandler();
  ~AboutHandler();

  DISALLOW_EVIL_CONSTRUCTORS(AboutHandler);
};

#endif  // CHROME_RENDERER_ABOUT_HANDLER_H__