Chromium Code Reviews| 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" | |
| 8 #include "base/process_util.h" | 7 #include "base/process_util.h" |
| 9 #include "base/threading/platform_thread.h" | 8 #include "base/threading/platform_thread.h" |
| 10 #include "chrome/common/about_handler.h" | 9 #include "chrome/common/about_handler.h" |
| 11 #include "content/common/url_constants.h" | 10 #include "content/common/url_constants.h" |
| 12 #include "googleurl/src/gurl.h" | 11 #include "googleurl/src/gurl.h" |
| 13 | 12 |
| 14 typedef void (*AboutHandlerFuncPtr)(); | 13 typedef void (*AboutHandlerFuncPtr)(); |
| 15 | 14 |
| 16 // This needs to match up with chrome_about_handler::about_urls in | 15 // This needs to match up with chrome_about_handler::about_urls in |
| 17 // chrome/common/about_handler.cc. | 16 // chrome/common/about_handler.cc. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 36 return true; // theoretically :] | 35 return true; // theoretically :] |
| 37 } | 36 } |
| 38 url_handler++; | 37 url_handler++; |
| 39 about_urls_handler_index++; | 38 about_urls_handler_index++; |
| 40 } | 39 } |
| 41 return false; | 40 return false; |
| 42 } | 41 } |
| 43 | 42 |
| 44 // static | 43 // static |
| 45 void AboutHandler::AboutCrash() { | 44 void AboutHandler::AboutCrash() { |
| 46 CHECK(false); | 45 // NOTE(shess): Crash directly rather than using NOTREACHED() so |
| 46 // that the signature is easier to triage in crash reports. | |
| 47 int* zero = NULL; | |
| 48 *zero = 0; | |
|
Scott Hess - ex-Googler
2011/07/01 19:59:01
In an email thread, msw said:
| |
| 47 } | 49 } |
| 48 | 50 |
| 49 // static | 51 // static |
| 50 void AboutHandler::AboutKill() { | 52 void AboutHandler::AboutKill() { |
| 51 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); | 53 base::KillProcess(base::GetCurrentProcessHandle(), 1, false); |
| 52 } | 54 } |
| 53 | 55 |
| 54 // static | 56 // static |
| 55 void AboutHandler::AboutHang() { | 57 void AboutHandler::AboutHang() { |
| 56 for (;;) { | 58 for (;;) { |
| 57 base::PlatformThread::Sleep(1000); | 59 base::PlatformThread::Sleep(1000); |
| 58 } | 60 } |
| 59 } | 61 } |
| 60 | 62 |
| 61 // static | 63 // static |
| 62 void AboutHandler::AboutShortHang() { | 64 void AboutHandler::AboutShortHang() { |
| 63 base::PlatformThread::Sleep(20000); | 65 base::PlatformThread::Sleep(20000); |
| 64 } | 66 } |
| 65 | 67 |
| 66 // static | 68 // static |
| 67 size_t AboutHandler::AboutURLHandlerSize() { | 69 size_t AboutHandler::AboutURLHandlerSize() { |
| 68 return arraysize(about_urls_handlers); | 70 return arraysize(about_urls_handlers); |
| 69 } | 71 } |
| OLD | NEW |