| 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 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 else | 68 else |
| 69 (*iter)->Send(new PpapiMsg_Hang()); | 69 (*iter)->Send(new PpapiMsg_Hang()); |
| 70 } | 70 } |
| 71 #endif | 71 #endif |
| 72 } | 72 } |
| 73 | 73 |
| 74 bool IsKaskoDebugURL(const GURL& url) { | 74 bool IsKaskoDebugURL(const GURL& url) { |
| 75 #if BUILDFLAG(ENABLE_KASKO) | 75 #if BUILDFLAG(ENABLE_KASKO) |
| 76 return (url.is_valid() && url.SchemeIs(kChromeUIScheme) && | 76 return (url.is_valid() && url.SchemeIs(kChromeUIScheme) && |
| 77 url.DomainIs(kKaskoCrashDomain) && | 77 url.DomainIs(kKaskoCrashDomain) && |
| 78 url.path() == kKaskoSendReport); | 78 url.path_piece() == kKaskoSendReport); |
| 79 #else | 79 #else |
| 80 return false; | 80 return false; |
| 81 #endif | 81 #endif |
| 82 } | 82 } |
| 83 | 83 |
| 84 void HandleKaskoDebugURL() { | 84 void HandleKaskoDebugURL() { |
| 85 #if BUILDFLAG(ENABLE_KASKO) | 85 #if BUILDFLAG(ENABLE_KASKO) |
| 86 // Signature of the exported crash key setting function. | 86 // Signature of the exported crash key setting function. |
| 87 using SetCrashKeyValueImplPtr = void(__cdecl *)(const wchar_t*, | 87 using SetCrashKeyValueImplPtr = void(__cdecl *)(const wchar_t*, |
| 88 const wchar_t*); | 88 const wchar_t*); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 if (!base::debug::IsBinaryInstrumented()) | 120 if (!base::debug::IsBinaryInstrumented()) |
| 121 return false; | 121 return false; |
| 122 #endif | 122 #endif |
| 123 | 123 |
| 124 if (!(url.is_valid() && url.SchemeIs(kChromeUIScheme) && | 124 if (!(url.is_valid() && url.SchemeIs(kChromeUIScheme) && |
| 125 url.DomainIs(kAsanCrashDomain) && | 125 url.DomainIs(kAsanCrashDomain) && |
| 126 url.has_path())) { | 126 url.has_path())) { |
| 127 return false; | 127 return false; |
| 128 } | 128 } |
| 129 | 129 |
| 130 if (url.path() == kAsanHeapOverflow || url.path() == kAsanHeapUnderflow || | 130 if (url.path_piece() == kAsanHeapOverflow || |
| 131 url.path() == kAsanUseAfterFree) { | 131 url.path_piece() == kAsanHeapUnderflow || |
| 132 url.path_piece() == kAsanUseAfterFree) { |
| 132 return true; | 133 return true; |
| 133 } | 134 } |
| 134 | 135 |
| 135 #if defined(SYZYASAN) | 136 #if defined(SYZYASAN) |
| 136 if (url.path() == kAsanCorruptHeapBlock || url.path() == kAsanCorruptHeap) | 137 if (url.path_piece() == kAsanCorruptHeapBlock || |
| 138 url.path_piece() == kAsanCorruptHeap) { |
| 137 return true; | 139 return true; |
| 140 } |
| 138 #endif | 141 #endif |
| 139 | 142 |
| 140 return false; | 143 return false; |
| 141 } | 144 } |
| 142 | 145 |
| 143 bool HandleAsanDebugURL(const GURL& url) { | 146 bool HandleAsanDebugURL(const GURL& url) { |
| 144 #if defined(SYZYASAN) | 147 #if defined(SYZYASAN) |
| 145 if (!base::debug::IsBinaryInstrumented()) | 148 if (!base::debug::IsBinaryInstrumented()) |
| 146 return false; | 149 return false; |
| 147 | 150 |
| 148 if (url.path() == kAsanCorruptHeapBlock) { | 151 if (url.path_piece() == kAsanCorruptHeapBlock) { |
| 149 base::debug::AsanCorruptHeapBlock(); | 152 base::debug::AsanCorruptHeapBlock(); |
| 150 return true; | 153 return true; |
| 151 } else if (url.path() == kAsanCorruptHeap) { | 154 } else if (url.path_piece() == kAsanCorruptHeap) { |
| 152 base::debug::AsanCorruptHeap(); | 155 base::debug::AsanCorruptHeap(); |
| 153 return true; | 156 return true; |
| 154 } | 157 } |
| 155 #endif | 158 #endif |
| 156 | 159 |
| 157 #if defined(ADDRESS_SANITIZER) || defined(SYZYASAN) | 160 #if defined(ADDRESS_SANITIZER) || defined(SYZYASAN) |
| 158 if (url.path() == kAsanHeapOverflow) { | 161 if (url.path_piece() == kAsanHeapOverflow) { |
| 159 base::debug::AsanHeapOverflow(); | 162 base::debug::AsanHeapOverflow(); |
| 160 } else if (url.path() == kAsanHeapUnderflow) { | 163 } else if (url.path_piece() == kAsanHeapUnderflow) { |
| 161 base::debug::AsanHeapUnderflow(); | 164 base::debug::AsanHeapUnderflow(); |
| 162 } else if (url.path() == kAsanUseAfterFree) { | 165 } else if (url.path_piece() == kAsanUseAfterFree) { |
| 163 base::debug::AsanHeapUseAfterFree(); | 166 base::debug::AsanHeapUseAfterFree(); |
| 164 } else { | 167 } else { |
| 165 return false; | 168 return false; |
| 166 } | 169 } |
| 167 #endif | 170 #endif |
| 168 | 171 |
| 169 return true; | 172 return true; |
| 170 } | 173 } |
| 171 | 174 |
| 172 void HangCurrentThread() { | 175 void HangCurrentThread() { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 return url == kChromeUIBadCastCrashURL || | 261 return url == kChromeUIBadCastCrashURL || |
| 259 url == kChromeUICrashURL || | 262 url == kChromeUICrashURL || |
| 260 url == kChromeUIDumpURL || | 263 url == kChromeUIDumpURL || |
| 261 url == kChromeUIKillURL || | 264 url == kChromeUIKillURL || |
| 262 url == kChromeUIHangURL || | 265 url == kChromeUIHangURL || |
| 263 url == kChromeUIShorthangURL || | 266 url == kChromeUIShorthangURL || |
| 264 url == kChromeUIMemoryExhaustURL; | 267 url == kChromeUIMemoryExhaustURL; |
| 265 } | 268 } |
| 266 | 269 |
| 267 } // namespace content | 270 } // namespace content |
| OLD | NEW |