Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Issue 842523002: base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON(). (Closed)

Created:
5 years, 11 months ago by danakj
Modified:
5 years, 4 months ago
CC:
Aaron Boodman, abarth-chromium, android-webview-reviews_chromium.org, asvitkine+watch_chromium.org, ben+mojo_chromium.org, browser-components-watch_chromium.org, cbentzel+watch_chromium.org, cc-bugs_chromium.org, chromium-apps-reviews_chromium.org, chromium-reviews, danakj+watch_chromium.org, darin (slow to review), darin-cc_chromium.org, enne (OOO), erikwright+watch_chromium.org, extensions-reviews_chromium.org, feature-media-reviews_chromium.org, felt, gavinp+memory_chromium.org, grt+watch_chromium.org, gunsch+watch_chromium.org, horo+watch_chromium.org, jam, jbauman+watch_chromium.org, jsbell+serviceworker_chromium.org, jshin+watch_chromium.org, kalyank, kinuko+serviceworker, lcwu+watch_chromium.org, maniscalco+watch_chromium.org, maxbogue+watch_chromium.org, mcasas+watch_chromium.org, michaeln, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nhiroki, piman, piman+watch_chromium.org, posciak+watch_chromium.org, pvalenzuela+watch_chromium.org, qsr+mojo_chromium.org, serviceworker-reviews, sievers+watch_chromium.org, tim+watch_chromium.org, tzik, viettrungluu+watch_chromium.org, Ian Vollick, wfh+watch_chromium.org, wjia+watch_chromium.org, yzshen+watch_chromium.org, zea+watch_chromium.org, ncarter (slow), dcheng
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON(). This ensures that if the header is not included, and a DCHECK is guarded by this check, that the file will fail to compile instead of silently compiling the DCHECK out. For example: #if DCHECK_IS_ON DCHECK(SomeThing()); #endif This example would be compiled out if DCHECK_IS_ON was not defined due to not including the logging.h header. Instead, this will fail to compile: #if DCHECK_IS_ON() DCHECK(SomeThing()); #endif R=thakis@chromium.org Committed: https://crrev.com/e649f573a38b00bb20fe0925098251a4ff184566 Cr-Commit-Position: refs/heads/master@{#310626}

Patch Set 1 #

Total comments: 2

Patch Set 2 : dcheck2: rebase #

Patch Set 3 : dcheck2: macro #

Total comments: 2

Patch Set 4 : dcheck2: withoutandroidchange #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+168 lines, -171 lines) Patch
M android_webview/browser/hardware_renderer.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M base/i18n/build_utf8_validator_tables.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M base/logging.h View 1 2 5 chunks +18 lines, -20 lines 0 comments Download
M base/logging_unittest.cc View 1 2 2 chunks +7 lines, -7 lines 0 comments Download
M base/mac/mac_logging.h View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M base/mac/mach_logging.h View 1 2 2 chunks +8 lines, -8 lines 0 comments Download
M base/memory/discardable_shared_memory.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M base/memory/discardable_shared_memory.cc View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
M base/metrics/histogram_macros.h View 1 2 1 chunk +16 lines, -16 lines 0 comments Download
M base/tracked_objects.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M base/tracked_objects.cc View 1 2 7 chunks +9 lines, -9 lines 0 comments Download
M cc/base/completion_event.h View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M cc/layers/delegated_frame_provider.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/picture_layer_tiling.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M cc/resources/picture_layer_tiling_set.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/prioritized_resource.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/resources/prioritized_resource.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M cc/resources/prioritized_resource_manager.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M cc/resources/resource_provider.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M cc/resources/scoped_resource.h View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M cc/resources/scoped_resource.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/proxy.h View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M cc/trees/proxy.cc View 1 2 4 chunks +6 lines, -6 lines 0 comments Download
M cc/trees/single_thread_proxy.h View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M cc/trees/single_thread_proxy.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/tree_synchronizer.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/activity_log/hashed_ad_network_database.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_reenabler.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_bar.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/installer/util/shell_util.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chromecast/base/metrics/cast_histograms.h View 1 2 1 chunk +7 lines, -8 lines 3 comments Download
M components/history/core/browser/top_sites_cache.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/browser/android/java/gin_java_bridge_dispatcher_host.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/service_worker/service_worker_database.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/common/gpu/media/gpu_video_decode_accelerator.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/gpu/queue_message_swap_promise.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/renderer/gpu/queue_message_swap_promise.cc View 1 2 4 chunks +5 lines, -5 lines 0 comments Download
M content/renderer/media/remote_media_stream_impl.cc View 1 2 3 chunks +4 lines, -4 lines 0 comments Download
M extensions/renderer/logging_native_handler.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/logging_native_handler.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M extensions/renderer/script_context_set.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M gpu/command_buffer/service/gles2_cmd_clear_framebuffer.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M gpu/command_buffer/service/gles2_cmd_decoder_unittest.cc View 1 2 7 chunks +7 lines, -7 lines 0 comments Download
M gpu/command_buffer/service/test_helper.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M mojo/edk/system/transport_data.cc View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
M net/spdy/spdy_session.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M net/spdy/spdy_write_queue.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/http_bridge.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M ui/compositor/dip_util.cc View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M ui/gfx/font_list_impl.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ui/gl/gl_gl_api_implementation.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 45 (11 generated)
danakj
5 years, 11 months ago (2015-01-06 23:40:56 UTC) #2
danakj
I was kinda on the fence about the .js changes but I figured consistency > ...
5 years, 11 months ago (2015-01-06 23:41:17 UTC) #3
danakj
Oops, upload ate my # lines from the description, fixed.
5 years, 11 months ago (2015-01-06 23:42:47 UTC) #4
Nico
https://codereview.chromium.org/842523002/diff/1/android_webview/browser/hardware_renderer.cc File android_webview/browser/hardware_renderer.cc (left): https://codereview.chromium.org/842523002/diff/1/android_webview/browser/hardware_renderer.cc#oldcode120 android_webview/browser/hardware_renderer.cc:120: #if DCHECK_IS_ON Can we make DCHECK_IS_ON a function-style macro? ...
5 years, 11 months ago (2015-01-06 23:46:16 UTC) #5
danakj
https://codereview.chromium.org/842523002/diff/1/android_webview/browser/hardware_renderer.cc File android_webview/browser/hardware_renderer.cc (left): https://codereview.chromium.org/842523002/diff/1/android_webview/browser/hardware_renderer.cc#oldcode120 android_webview/browser/hardware_renderer.cc:120: #if DCHECK_IS_ON On 2015/01/06 23:46:15, Nico wrote: > Can ...
5 years, 11 months ago (2015-01-06 23:55:10 UTC) #6
danakj
PTAL. Updated description to match.
5 years, 11 months ago (2015-01-07 00:03:12 UTC) #7
Nico
lgtm Great catch, btw :-) https://codereview.chromium.org/842523002/diff/40001/chromecast/browser/android/external_video_surface_container_impl.cc File chromecast/browser/android/external_video_surface_container_impl.cc (right): https://codereview.chromium.org/842523002/diff/40001/chromecast/browser/android/external_video_surface_container_impl.cc#newcode46 chromecast/browser/android/external_video_surface_container_impl.cc:46: JNIEnv* env = base::android::AttachCurrentThread(); ...
5 years, 11 months ago (2015-01-07 00:12:13 UTC) #8
danakj
Cool thanks! https://codereview.chromium.org/842523002/diff/40001/chromecast/browser/android/external_video_surface_container_impl.cc File chromecast/browser/android/external_video_surface_container_impl.cc (right): https://codereview.chromium.org/842523002/diff/40001/chromecast/browser/android/external_video_surface_container_impl.cc#newcode46 chromecast/browser/android/external_video_surface_container_impl.cc:46: JNIEnv* env = base::android::AttachCurrentThread(); On 2015/01/07 00:12:13, ...
5 years, 11 months ago (2015-01-07 04:40:17 UTC) #9
danakj
+sievers for OWNERS of what you can
5 years, 11 months ago (2015-01-07 17:49:46 UTC) #11
danakj
+jamesr for mojo/
5 years, 11 months ago (2015-01-07 17:50:29 UTC) #13
danakj
+benm for android_webview/
5 years, 11 months ago (2015-01-07 17:59:25 UTC) #15
danakj
+jyasskin for extensions/
5 years, 11 months ago (2015-01-07 18:00:21 UTC) #17
benm (inactive)
On 2015/01/07 17:59:25, danakj wrote: > +benm for android_webview/ lgtm
5 years, 11 months ago (2015-01-07 18:01:09 UTC) #18
danakj
+maniscalco for sync/ +erikwright for components/
5 years, 11 months ago (2015-01-07 18:04:20 UTC) #20
danakj
+damienv for chromecast/ +rvargas for net/
5 years, 11 months ago (2015-01-07 18:09:23 UTC) #22
maniscalco
sync/ lgtm
5 years, 11 months ago (2015-01-07 18:13:03 UTC) #23
lcwu1
https://codereview.chromium.org/842523002/diff/60001/chromecast/base/metrics/cast_histograms.h File chromecast/base/metrics/cast_histograms.h (right): https://codereview.chromium.org/842523002/diff/60001/chromecast/base/metrics/cast_histograms.h#newcode16 chromecast/base/metrics/cast_histograms.h:16: constant_histogram_name, histogram_add_method_invocation, \ Any reason why you want to ...
5 years, 11 months ago (2015-01-07 18:49:57 UTC) #25
Nico
https://codereview.chromium.org/842523002/diff/60001/chromecast/base/metrics/cast_histograms.h File chromecast/base/metrics/cast_histograms.h (right): https://codereview.chromium.org/842523002/diff/60001/chromecast/base/metrics/cast_histograms.h#newcode16 chromecast/base/metrics/cast_histograms.h:16: constant_histogram_name, histogram_add_method_invocation, \ On 2015/01/07 18:49:56, lcwu1 wrote: > ...
5 years, 11 months ago (2015-01-07 19:02:50 UTC) #26
no sievers
lgtm
5 years, 11 months ago (2015-01-07 19:09:09 UTC) #27
danakj
https://codereview.chromium.org/842523002/diff/60001/chromecast/base/metrics/cast_histograms.h File chromecast/base/metrics/cast_histograms.h (right): https://codereview.chromium.org/842523002/diff/60001/chromecast/base/metrics/cast_histograms.h#newcode16 chromecast/base/metrics/cast_histograms.h:16: constant_histogram_name, histogram_add_method_invocation, \ On 2015/01/07 19:02:50, Nico wrote: > ...
5 years, 11 months ago (2015-01-07 19:31:53 UTC) #28
lcwu1
lgtm on chromecast/.
5 years, 11 months ago (2015-01-07 19:46:31 UTC) #29
jamesr
mojo lgtm although this code is mirrored from the mojo repo so we'll have to ...
5 years, 11 months ago (2015-01-07 20:06:18 UTC) #31
Ken Rockot(use gerrit already)
sgtm On Wed, Jan 7, 2015 at 12:06 PM, <jamesr@chromium.org> wrote: > mojo lgtm although ...
5 years, 11 months ago (2015-01-07 20:11:23 UTC) #32
rvargas (doing something else)
net lgtm
5 years, 11 months ago (2015-01-07 20:54:28 UTC) #33
danakj
rockot@ would you mind reviewing the extensions/ changes?
5 years, 11 months ago (2015-01-08 18:55:12 UTC) #34
danakj
+sky for components/history/
5 years, 11 months ago (2015-01-08 18:56:08 UTC) #36
Ken Rockot(use gerrit already)
extensions lgtm
5 years, 11 months ago (2015-01-08 19:02:28 UTC) #37
sky
Tricky, LGTM
5 years, 11 months ago (2015-01-08 23:10:47 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/842523002/60001
5 years, 11 months ago (2015-01-08 23:12:17 UTC) #40
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 11 months ago (2015-01-08 23:36:50 UTC) #41
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/e649f573a38b00bb20fe0925098251a4ff184566 Cr-Commit-Position: refs/heads/master@{#310626}
5 years, 11 months ago (2015-01-08 23:37:54 UTC) #42
dcheng
FWIW, if you forget the ()s (or forget to #include the header directly/indirectly), then #if ...
5 years, 4 months ago (2015-08-12 23:48:41 UTC) #43
danakj
On Wed, Aug 12, 2015 at 4:49 PM, Dana Jansens <danakj@chromium.org> wrote: > Really..? I ...
5 years, 4 months ago (2015-08-12 23:55:12 UTC) #44
danakj
5 years, 4 months ago (2015-08-13 00:12:03 UTC) #45
Message was sent while issue was closed.
Really..? I thought it doesn't compile.. *checks*

On Wed, Aug 12, 2015 at 4:48 PM, <dcheng@chromium.org> wrote:

> FWIW, if you forget the ()s (or forget to #include the header
> directly/indirectly), then
>
> #if DCHECK_IS_ON
>
> always evaluates to false. Maybe we should have a presubmit to enforce
> that "()"
> are always present? nick@ noticed this by chance when he was
> experimenting with
> a pre-2015 patch.
>
> https://codereview.chromium.org/842523002/
>

To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698