chore: restore //url dchecks (#15637)

This commit is contained in:
Jeremy Apthorp 2018-11-22 09:02:52 -08:00 committed by GitHub
parent fb52fdc592
commit a8a881c8db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 65 additions and 50 deletions

View file

@ -16,41 +16,6 @@ example, the checks might be disabled for a whole build target, but actually
only one or two specific checks fail. Then it's better to simply comment out the
failing checks and allow the rest of the target to have them enabled.
Please keep the following lists updated.
The ELECTRON_NO_DCHECK build flag disables debug checks universally.
This patch applies the flag to the following GN targets:
third_party/blink/renderer/core/loader:loader
url:url
These files have debug checks explicitly commented out:
base/memory/weak_ptr.cc
base/process/kill_win.cc
components/viz/service/display/program_binding.h
components/viz/service/display_embedder/server_shared_bitmap_manager.cc
content/browser/frame_host/navigation_controller_impl.cc
content/browser/frame_host/render_frame_host_impl.cc
content/browser/renderer_host/render_widget_host_view_mac.mm
ppapi/host/ppapi_host.cc
third_party/blink/renderer/core/dom/node.cc
third_party/blink/renderer/platform/wtf/text/string_impl.cc
ui/base/clipboard/clipboard_win.cc
diff --git a/base/logging.h b/base/logging.h
index 08c1f0fc59672b2134c634e081f0c4df4d261b75..7a758ce3ef90145d2b68e07e17f00fc30cfb30a6 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -874,7 +874,7 @@ const LogSeverity LOG_DCHECK = LOG_FATAL;
#else // !(defined(_PREFAST_) && defined(OS_WIN))
-#if DCHECK_IS_ON()
+#if DCHECK_IS_ON() && !defined(ELECTRON_NO_DCHECK)
#define DCHECK(condition) \
LAZY_STREAM(LOG_STREAM(DCHECK), !ANALYZER_ASSUME_TRUE(condition)) \
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index d8aca9e2cbffdfd0bbb0bd67e8adfb53547132bb..86224ab7a3c5637422559da25bc8c1040a03e937 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
@ -138,18 +103,3 @@ index e49dd8c81270cdd9794ddee11bad036c2f444af5..9e61c901cd2df168520b83a8522ca8c0
FreeData(format, handle);
}
}
diff --git a/url/BUILD.gn b/url/BUILD.gn
index 57bbe16c15ea442963a53f89b009e2c99c7b090a..07725187c595784d9e5f49d45a8835da78144830 100644
--- a/url/BUILD.gn
+++ b/url/BUILD.gn
@@ -98,6 +98,10 @@ component("url") {
]
deps += [ "//third_party/icu" ]
}
+
+ if (is_electron_build) {
+ defines += [ "ELECTRON_NO_DCHECK" ]
+ }
}
if (is_android) {