OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/renderer/about_handler.h" | 5 #include "chrome/renderer/about_handler.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
9 #include "base/threading/platform_thread.h" | 9 #include "base/threading/platform_thread.h" |
10 #include "chrome/common/about_handler.h" | 10 #include "chrome/common/about_handler.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 return true; // theoretically :] | 36 return true; // theoretically :] |
37 } | 37 } |
38 url_handler++; | 38 url_handler++; |
39 about_urls_handler_index++; | 39 about_urls_handler_index++; |
40 } | 40 } |
41 return false; | 41 return false; |
42 } | 42 } |
43 | 43 |
44 // static | 44 // static |
45 void AboutHandler::AboutCrash() { | 45 void AboutHandler::AboutCrash() { |
46 CHECK(false); | 46 // NOTE(shess): Crash directly rather than using NOTREACHED() so |
47 // that the signature is easier to triage in crash reports. | |
48 volatile int* zero = NULL; | |
49 *zero = 0; | |
50 | |
51 // Just in case the compiler decides the above is undefined and | |
52 // optimizes it away. | |
Nico
2011/07/03 19:34:37
I don't think that can happen with a volatile poin
| |
53 NOTREACHED(); | |
47 } | 54 } |
48 | 55 |
49 // static | 56 // static |
50 void AboutHandler::AboutKill() { | 57 void AboutHandler::AboutKill() { |
51 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); | 58 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); |
52 } | 59 } |
53 | 60 |
54 // static | 61 // static |
55 void AboutHandler::AboutHang() { | 62 void AboutHandler::AboutHang() { |
56 for (;;) { | 63 for (;;) { |
57 base::PlatformThread::Sleep(1000); | 64 base::PlatformThread::Sleep(1000); |
58 } | 65 } |
59 } | 66 } |
60 | 67 |
61 // static | 68 // static |
62 void AboutHandler::AboutShortHang() { | 69 void AboutHandler::AboutShortHang() { |
63 base::PlatformThread::Sleep(20000); | 70 base::PlatformThread::Sleep(20000); |
64 } | 71 } |
65 | 72 |
66 // static | 73 // static |
67 size_t AboutHandler::AboutURLHandlerSize() { | 74 size_t AboutHandler::AboutURLHandlerSize() { |
68 return arraysize(about_urls_handlers); | 75 return arraysize(about_urls_handlers); |
69 } | 76 } |
OLD | NEW |