dcheck.patch 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: deepak1556 <[email protected]>
  3. Date: Thu, 20 Sep 2018 17:44:38 -0700
  4. Subject: dcheck.patch
  5. This disables some debug checks which currently fail when running the Electron
  6. test suite. In general there should be sustained effort to have all debug checks
  7. enabled. If you want to help, choose one of the diffs below and remove it. Then
  8. build Electron (debug configuration) and make sure all tests pass on the CI
  9. systems. Unfortunately the tests don't always cover the check failures, so it's
  10. good to also run some non-trivial Electron app to verify.
  11. Apart from getting rid of a whole diff, you may also be able to replace one diff
  12. with another which enables at least some of the previously disabled checks. For
  13. example, the checks might be disabled for a whole build target, but actually
  14. only one or two specific checks fail. Then it's better to simply comment out the
  15. failing checks and allow the rest of the target to have them enabled.
  16. diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
  17. index f950552abbe9e9a0002156b596438fe9aa4f01b9..23931899eb58432fd8eabf4d681d2294a88fd97d 100644
  18. --- a/content/browser/frame_host/navigation_controller_impl.cc
  19. +++ b/content/browser/frame_host/navigation_controller_impl.cc
  20. @@ -1250,8 +1250,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
  21. return NAVIGATION_TYPE_NEW_SUBFRAME;
  22. }
  23. - // We only clear the session history when navigating to a new page.
  24. - DCHECK(!params.history_list_was_cleared);
  25. + // Electron does its own book keeping of navigation entries and we
  26. + // expect content to not track any, by clearing history list for
  27. + // all navigations.
  28. + // DCHECK(!params.history_list_was_cleared);
  29. if (rfh->GetParent()) {
  30. // All manual subframes would be did_create_new_entry and handled above, so
  31. @@ -1506,7 +1508,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
  32. new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
  33. }
  34. - DCHECK(!params.history_list_was_cleared || !replace_entry);
  35. + // Electron does its own book keeping of navigation entries and we
  36. + // expect content to not track any, by clearing history list for
  37. + // all navigations.
  38. + // DCHECK(!params.history_list_was_cleared || !replace_entry);
  39. // The browser requested to clear the session history when it initiated the
  40. // navigation. Now we know that the renderer has updated its state accordingly
  41. // and it is safe to also clear the browser side history.
  42. diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
  43. index 4362daa04e89ca8f47c5e07e998fc9f1ad4f4c5b..75d4c0ae3b419bb114f22d1e5df8d346f738b96a 100644
  44. --- a/ui/base/clipboard/clipboard_win.cc
  45. +++ b/ui/base/clipboard/clipboard_win.cc
  46. @@ -776,10 +776,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
  47. void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
  48. UINT cf_format = format.ToFormatEtc().cfFormat;
  49. - DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
  50. + //DCHECK_NE(clipboard_owner_->hwnd(), nullptr);
  51. if (handle && !::SetClipboardData(cf_format, handle)) {
  52. - DCHECK_NE(GetLastError(),
  53. - static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
  54. + //DCHECK_NE(GetLastError(),
  55. + // static_cast<unsigned long>(ERROR_CLIPBOARD_NOT_OPEN));
  56. FreeData(cf_format, handle);
  57. }
  58. }