OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/frame_host/debug_urls.h" | 5 #include "content/browser/frame_host/debug_urls.h" |
6 | 6 |
7 #if defined(SYZYASAN) | 7 #if defined(SYZYASAN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/debug/asan_invalid_access.h" | 14 #include "base/debug/asan_invalid_access.h" |
15 #include "base/debug/profiler.h" | 15 #include "base/debug/profiler.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
18 #include "base/threading/thread_restrictions.h" | 18 #include "base/threading/thread_restrictions.h" |
19 #include "cc/base/switches.h" | 19 #include "cc/base/switches.h" |
20 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 20 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
22 #include "content/public/common/content_constants.h" | 22 #include "content/public/common/content_constants.h" |
23 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
| 24 #include "ppapi/features/features.h" |
24 #include "ppapi/proxy/ppapi_messages.h" | 25 #include "ppapi/proxy/ppapi_messages.h" |
25 #include "third_party/kasko/kasko_features.h" | 26 #include "third_party/kasko/kasko_features.h" |
26 #include "url/gurl.h" | 27 #include "url/gurl.h" |
27 | 28 |
28 #if defined(ENABLE_PLUGINS) | 29 #if BUILDFLAG(ENABLE_PLUGINS) |
29 #include "content/browser/ppapi_plugin_process_host.h" | 30 #include "content/browser/ppapi_plugin_process_host.h" |
30 #endif | 31 #endif |
31 | 32 |
32 namespace content { | 33 namespace content { |
33 | 34 |
34 class ScopedAllowWaitForDebugURL { | 35 class ScopedAllowWaitForDebugURL { |
35 private: | 36 private: |
36 base::ThreadRestrictions::ScopedAllowWait wait; | 37 base::ThreadRestrictions::ScopedAllowWait wait; |
37 }; | 38 }; |
38 | 39 |
39 namespace { | 40 namespace { |
40 | 41 |
41 // Define the Asan debug URLs. | 42 // Define the Asan debug URLs. |
42 const char kAsanCrashDomain[] = "crash"; | 43 const char kAsanCrashDomain[] = "crash"; |
43 const char kAsanHeapOverflow[] = "/browser-heap-overflow"; | 44 const char kAsanHeapOverflow[] = "/browser-heap-overflow"; |
44 const char kAsanHeapUnderflow[] = "/browser-heap-underflow"; | 45 const char kAsanHeapUnderflow[] = "/browser-heap-underflow"; |
45 const char kAsanUseAfterFree[] = "/browser-use-after-free"; | 46 const char kAsanUseAfterFree[] = "/browser-use-after-free"; |
46 #if defined(SYZYASAN) | 47 #if defined(SYZYASAN) |
47 const char kAsanCorruptHeapBlock[] = "/browser-corrupt-heap-block"; | 48 const char kAsanCorruptHeapBlock[] = "/browser-corrupt-heap-block"; |
48 const char kAsanCorruptHeap[] = "/browser-corrupt-heap"; | 49 const char kAsanCorruptHeap[] = "/browser-corrupt-heap"; |
49 #endif | 50 #endif |
50 | 51 |
51 #if BUILDFLAG(ENABLE_KASKO) | 52 #if BUILDFLAG(ENABLE_KASKO) |
52 // Define the Kasko debug URLs. | 53 // Define the Kasko debug URLs. |
53 const char kKaskoCrashDomain[] = "kasko"; | 54 const char kKaskoCrashDomain[] = "kasko"; |
54 const char kKaskoSendReport[] = "/send-report"; | 55 const char kKaskoSendReport[] = "/send-report"; |
55 #endif | 56 #endif |
56 | 57 |
57 void HandlePpapiFlashDebugURL(const GURL& url) { | 58 void HandlePpapiFlashDebugURL(const GURL& url) { |
58 #if defined(ENABLE_PLUGINS) | 59 #if BUILDFLAG(ENABLE_PLUGINS) |
59 bool crash = url == kChromeUIPpapiFlashCrashURL; | 60 bool crash = url == kChromeUIPpapiFlashCrashURL; |
60 | 61 |
61 std::vector<PpapiPluginProcessHost*> hosts; | 62 std::vector<PpapiPluginProcessHost*> hosts; |
62 PpapiPluginProcessHost::FindByName( | 63 PpapiPluginProcessHost::FindByName( |
63 base::UTF8ToUTF16(kFlashPluginName), &hosts); | 64 base::UTF8ToUTF16(kFlashPluginName), &hosts); |
64 for (std::vector<PpapiPluginProcessHost*>::iterator iter = hosts.begin(); | 65 for (std::vector<PpapiPluginProcessHost*>::iterator iter = hosts.begin(); |
65 iter != hosts.end(); ++iter) { | 66 iter != hosts.end(); ++iter) { |
66 if (crash) | 67 if (crash) |
67 (*iter)->Send(new PpapiMsg_Crash()); | 68 (*iter)->Send(new PpapiMsg_Crash()); |
68 else | 69 else |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 return url == kChromeUIBadCastCrashURL || | 262 return url == kChromeUIBadCastCrashURL || |
262 url == kChromeUICrashURL || | 263 url == kChromeUICrashURL || |
263 url == kChromeUIDumpURL || | 264 url == kChromeUIDumpURL || |
264 url == kChromeUIKillURL || | 265 url == kChromeUIKillURL || |
265 url == kChromeUIHangURL || | 266 url == kChromeUIHangURL || |
266 url == kChromeUIShorthangURL || | 267 url == kChromeUIShorthangURL || |
267 url == kChromeUIMemoryExhaustURL; | 268 url == kChromeUIMemoryExhaustURL; |
268 } | 269 } |
269 | 270 |
270 } // namespace content | 271 } // namespace content |
OLD | NEW |