| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/tools/test_shell/test_shell.h" | 5 #include "webkit/tools/test_shell/test_shell.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <commdlg.h> | 8 #include <commdlg.h> |
| 9 #include <objbase.h> | 9 #include <objbase.h> |
| 10 #include <process.h> | 10 #include <process.h> |
| 11 #include <shlwapi.h> | 11 #include <shlwapi.h> |
| 12 | 12 |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/containers/stack_container.h" |
| 14 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 15 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 16 #include "base/message_loop.h" | 17 #include "base/message_loop.h" |
| 17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 18 #include "base/stack_container.h" | |
| 19 #include "base/string_piece.h" | 19 #include "base/string_piece.h" |
| 20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
| 21 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| 22 #include "base/win/resource_util.h" | 22 #include "base/win/resource_util.h" |
| 23 #include "breakpad/src/client/windows/handler/exception_handler.h" | 23 #include "breakpad/src/client/windows/handler/exception_handler.h" |
| 24 #include "grit/webkit_chromium_resources.h" | 24 #include "grit/webkit_chromium_resources.h" |
| 25 #include "grit/webkit_resources.h" | 25 #include "grit/webkit_resources.h" |
| 26 #include "net/base/net_module.h" | 26 #include "net/base/net_module.h" |
| 27 #include "net/url_request/url_request_file_job.h" | 27 #include "net/url_request/url_request_file_job.h" |
| 28 #include "skia/ext/bitmap_platform_device.h" | 28 #include "skia/ext/bitmap_platform_device.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 MDRawAssertionInfo *assertion, | 92 MDRawAssertionInfo *assertion, |
| 93 bool succeeded) { | 93 bool succeeded) { |
| 94 // Warning: Don't use the heap in this function. It may be corrupted. | 94 // Warning: Don't use the heap in this function. It may be corrupted. |
| 95 if (!g_currentTestName[0]) | 95 if (!g_currentTestName[0]) |
| 96 return false; | 96 return false; |
| 97 | 97 |
| 98 // Try to rename the minidump file to include the crashed test's name. | 98 // Try to rename the minidump file to include the crashed test's name. |
| 99 // StackString uses the stack but overflows onto the heap. But we don't | 99 // StackString uses the stack but overflows onto the heap. But we don't |
| 100 // care too much about being completely correct here, since most crashes | 100 // care too much about being completely correct here, since most crashes |
| 101 // will be happening on developers' machines where they have debuggers. | 101 // will be happening on developers' machines where they have debuggers. |
| 102 StackWString<kPathBufSize * 2> origPath; | 102 base::StackString16<kPathBufSize * 2> origPath; |
| 103 origPath->append(dumpPath); | 103 origPath->append(dumpPath); |
| 104 origPath->push_back(FilePath::kSeparators[0]); | 104 origPath->push_back(FilePath::kSeparators[0]); |
| 105 origPath->append(minidumpID); | 105 origPath->append(minidumpID); |
| 106 origPath->append(L".dmp"); | 106 origPath->append(L".dmp"); |
| 107 | 107 |
| 108 StackWString<kPathBufSize * 2> newPath; | 108 base::StackString16<kPathBufSize * 2> newPath; |
| 109 newPath->append(dumpPath); | 109 newPath->append(dumpPath); |
| 110 newPath->push_back(FilePath::kSeparators[0]); | 110 newPath->push_back(FilePath::kSeparators[0]); |
| 111 newPath->append(g_currentTestName); | 111 newPath->append(g_currentTestName); |
| 112 newPath->append(L"-"); | 112 newPath->append(L"-"); |
| 113 newPath->append(minidumpID); | 113 newPath->append(minidumpID); |
| 114 newPath->append(L".dmp"); | 114 newPath->append(L".dmp"); |
| 115 | 115 |
| 116 // May use the heap, but oh well. If this fails, we'll just have the | 116 // May use the heap, but oh well. If this fails, we'll just have the |
| 117 // original dump file lying around. | 117 // original dump file lying around. |
| 118 _wrename(origPath->c_str(), newPath->c_str()); | 118 _wrename(origPath->c_str(), newPath->c_str()); |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 744 |
| 745 bool EnsureFontLoaded(HFONT font) { | 745 bool EnsureFontLoaded(HFONT font) { |
| 746 return true; | 746 return true; |
| 747 } | 747 } |
| 748 | 748 |
| 749 bool DownloadUrl(const std::string& url, HWND caller_window) { | 749 bool DownloadUrl(const std::string& url, HWND caller_window) { |
| 750 return false; | 750 return false; |
| 751 } | 751 } |
| 752 | 752 |
| 753 } // namespace webkit_glue | 753 } // namespace webkit_glue |
| OLD | NEW |