diff options
author | vmpstr <vmpstr@chromium.org> | 2015-10-26 17:17:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-27 00:18:36 +0000 |
commit | cc8936ba36ee29b5859f65c936e16f87eeac82b4 (patch) | |
tree | 10a5e5f7e314b09d90ff307927dfa648209175b8 | |
parent | 02c0dfad5b9bd4e6040cbe9faf2cc295c0da43a8 (diff) | |
download | chromium_src-cc8936ba36ee29b5859f65c936e16f87eeac82b4.zip chromium_src-cc8936ba36ee29b5859f65c936e16f87eeac82b4.tar.gz chromium_src-cc8936ba36ee29b5859f65c936e16f87eeac82b4.tar.bz2 |
Remove DCHECK_IMPLIES/CHECK_IMPLIES.
This patch removes both DCHECK_IMPLIES and CHECK_IMPLIES macros.
R=thakis, sky, jam
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1421483005
Cr-Commit-Position: refs/heads/master@{#356193}
53 files changed, 134 insertions, 150 deletions
diff --git a/base/logging.h b/base/logging.h index f495118..8c7f20a 100644 --- a/base/logging.h +++ b/base/logging.h @@ -571,7 +571,6 @@ DEFINE_CHECK_OP_IMPL(GT, > ) #define CHECK_LT(val1, val2) CHECK_OP(LT, < , val1, val2) #define CHECK_GE(val1, val2) CHECK_OP(GE, >=, val1, val2) #define CHECK_GT(val1, val2) CHECK_OP(GT, > , val1, val2) -#define CHECK_IMPLIES(val1, val2) CHECK(!(val1) || (val2)) #if defined(NDEBUG) #define ENABLE_DLOG 0 @@ -725,7 +724,6 @@ const LogSeverity LOG_DCHECK = LOG_INFO; #define DCHECK_LT(val1, val2) DCHECK_OP(LT, < , val1, val2) #define DCHECK_GE(val1, val2) DCHECK_OP(GE, >=, val1, val2) #define DCHECK_GT(val1, val2) DCHECK_OP(GT, > , val1, val2) -#define DCHECK_IMPLIES(val1, val2) DCHECK(!(val1) || (val2)) #if !DCHECK_IS_ON() && defined(OS_CHROMEOS) // Implement logging of NOTREACHED() as a dedicated function to get function diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc index cb38093..874e629 100644 --- a/base/trace_event/memory_dump_manager.cc +++ b/base/trace_event/memory_dump_manager.cc @@ -206,9 +206,9 @@ void MemoryDumpManager::UnregisterDumpProvider(MemoryDumpProvider* mdp) { // and OnMemoryDump() at the same time). // Otherwise, it is not possible to guarantee that its unregistration is // race-free. If you hit this DCHECK, your MDP has a bug. - DCHECK_IMPLIES( - subtle::NoBarrier_Load(&memory_tracing_enabled_), - mdp_iter->task_runner && mdp_iter->task_runner->BelongsToCurrentThread()) + DCHECK(!subtle::NoBarrier_Load(&memory_tracing_enabled_) || + (mdp_iter->task_runner && + mdp_iter->task_runner->BelongsToCurrentThread())) << "The MemoryDumpProvider attempted to unregister itself in a racy way. " << "Please file a crbug."; diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc index d1fb70e..032bc77 100644 --- a/base/trace_event/trace_log.cc +++ b/base/trace_event/trace_log.cc @@ -879,7 +879,7 @@ void TraceLog::FlushInternal(const TraceLog::OutputCallback& cb, flush_task_runner_ = ThreadTaskRunnerHandle::IsSet() ? ThreadTaskRunnerHandle::Get() : nullptr; - DCHECK_IMPLIES(thread_message_loops_.size(), flush_task_runner_); + DCHECK(!thread_message_loops_.size() || flush_task_runner_); flush_output_callback_ = cb; if (thread_shared_chunk_) { diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc index 0bec926..0c38011 100644 --- a/cc/animation/animation_player.cc +++ b/cc/animation/animation_player.cc @@ -119,9 +119,8 @@ void AnimationPlayer::UnbindElementAnimations() { } void AnimationPlayer::AddAnimation(scoped_ptr<Animation> animation) { - DCHECK_IMPLIES( - animation->target_property() == Animation::SCROLL_OFFSET, - animation_host_ && animation_host_->SupportsScrollAnimations()); + DCHECK(animation->target_property() != Animation::SCROLL_OFFSET || + (animation_host_ && animation_host_->SupportsScrollAnimations())); if (element_animations_) { element_animations_->layer_animation_controller()->AddAnimation( diff --git a/cc/input/top_controls_manager.cc b/cc/input/top_controls_manager.cc index 1a961b5..5fe1267 100644 --- a/cc/input/top_controls_manager.cc +++ b/cc/input/top_controls_manager.cc @@ -176,8 +176,8 @@ void TopControlsManager::ResetAnimations() { void TopControlsManager::SetupAnimation(AnimationDirection direction) { DCHECK_NE(NO_ANIMATION, direction); - DCHECK_IMPLIES(direction == HIDING_CONTROLS, TopControlsShownRatio() > 0.f); - DCHECK_IMPLIES(direction == SHOWING_CONTROLS, TopControlsShownRatio() < 1.f); + DCHECK(direction != HIDING_CONTROLS || TopControlsShownRatio() > 0.f); + DCHECK(direction != SHOWING_CONTROLS || TopControlsShownRatio() < 1.f); if (top_controls_animation_ && animation_direction_ == direction) return; diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc index 81ae0b1..0b92ff4 100644 --- a/cc/layers/picture_layer.cc +++ b/cc/layers/picture_layer.cc @@ -57,8 +57,8 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) { // If update called, then recording source size must match bounds pushed to // impl layer. - DCHECK_IMPLIES(update_source_frame_number_ == source_frame_number, - impl_bounds == recording_source_bounds) + DCHECK(update_source_frame_number_ != source_frame_number || + impl_bounds == recording_source_bounds) << " bounds " << impl_bounds.ToString() << " recording source " << recording_source_bounds.ToString(); diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc index 34357ff..732b822 100644 --- a/cc/layers/picture_layer_impl.cc +++ b/cc/layers/picture_layer_impl.cc @@ -100,8 +100,8 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { LayerImpl::PushPropertiesTo(base_layer); // Twin relationships should never change once established. - DCHECK_IMPLIES(twin_layer_, twin_layer_ == layer_impl); - DCHECK_IMPLIES(twin_layer_, layer_impl->twin_layer_ == this); + DCHECK(!twin_layer_ || twin_layer_ == layer_impl); + DCHECK(!twin_layer_ || layer_impl->twin_layer_ == this); // The twin relationship does not need to exist before the first // PushPropertiesTo from pending to active layer since before that the active // layer can not have a pile or tilings, it has only been created and inserted @@ -112,7 +112,7 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { layer_impl->SetNearestNeighbor(nearest_neighbor_); // Solid color layers have no tilings. - DCHECK_IMPLIES(raster_source_->IsSolidColor(), tilings_->num_tilings() == 0); + DCHECK(!raster_source_->IsSolidColor() || tilings_->num_tilings() == 0); // The pending tree should only have a high res (and possibly low res) tiling. DCHECK_LE(tilings_->num_tilings(), layer_tree_impl()->create_low_res_tiling() ? 2u : 1u); @@ -123,8 +123,8 @@ void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { DCHECK(invalidation_.IsEmpty()); // After syncing a solid color layer, the active layer has no tilings. - DCHECK_IMPLIES(raster_source_->IsSolidColor(), - layer_impl->tilings_->num_tilings() == 0); + DCHECK(!raster_source_->IsSolidColor() || + layer_impl->tilings_->num_tilings() == 0); layer_impl->raster_page_scale_ = raster_page_scale_; layer_impl->raster_device_scale_ = raster_device_scale_; @@ -144,8 +144,8 @@ void PictureLayerImpl::AppendQuads(RenderPass* render_pass, AppendQuadsData* append_quads_data) { // The bounds and the pile size may differ if the pile wasn't updated (ie. // PictureLayer::Update didn't happen). In that case the pile will be empty. - DCHECK_IMPLIES(!raster_source_->GetSize().IsEmpty(), - bounds() == raster_source_->GetSize()) + DCHECK(raster_source_->GetSize().IsEmpty() || + bounds() == raster_source_->GetSize()) << " bounds " << bounds().ToString() << " pile " << raster_source_->GetSize().ToString(); @@ -529,8 +529,8 @@ void PictureLayerImpl::UpdateRasterSource( const PictureLayerTilingSet* pending_set) { // The bounds and the pile size may differ if the pile wasn't updated (ie. // PictureLayer::Update didn't happen). In that case the pile will be empty. - DCHECK_IMPLIES(!raster_source->GetSize().IsEmpty(), - bounds() == raster_source->GetSize()) + DCHECK(raster_source->GetSize().IsEmpty() || + bounds() == raster_source->GetSize()) << " bounds " << bounds().ToString() << " pile " << raster_source->GetSize().ToString(); @@ -545,9 +545,8 @@ void PictureLayerImpl::UpdateRasterSource( invalidation_.Swap(new_invalidation); bool can_have_tilings = CanHaveTilings(); - DCHECK_IMPLIES( - pending_set, - can_have_tilings == GetPendingOrActiveTwinLayer()->CanHaveTilings()); + DCHECK(!pending_set || + can_have_tilings == GetPendingOrActiveTwinLayer()->CanHaveTilings()); // Need to call UpdateTiles again if CanHaveTilings changed. if (could_have_tilings != can_have_tilings) @@ -779,8 +778,8 @@ void PictureLayerImpl::GetContentsResourceId(ResourceId* resource_id, gfx::Size* resource_size) const { // The bounds and the pile size may differ if the pile wasn't updated (ie. // PictureLayer::Update didn't happen). In that case the pile will be empty. - DCHECK_IMPLIES(!raster_source_->GetSize().IsEmpty(), - bounds() == raster_source_->GetSize()) + DCHECK(raster_source_->GetSize().IsEmpty() || + bounds() == raster_source_->GetSize()) << " bounds " << bounds().ToString() << " pile " << raster_source_->GetSize().ToString(); gfx::Rect content_rect(bounds()); @@ -920,7 +919,7 @@ void PictureLayerImpl::AddLowResolutionTilingIfNeeded() { PictureLayerTiling* low_res = tilings_->FindTilingWithScale(low_res_raster_contents_scale_); - DCHECK_IMPLIES(low_res, low_res->resolution() != HIGH_RESOLUTION); + DCHECK(!low_res || low_res->resolution() != HIGH_RESOLUTION); // Only create new low res tilings when the transform is static. This // prevents wastefully creating a paired low res tiling for every new high diff --git a/cc/layers/picture_layer_impl_unittest.cc b/cc/layers/picture_layer_impl_unittest.cc index 6e1b4c9..872db91 100644 --- a/cc/layers/picture_layer_impl_unittest.cc +++ b/cc/layers/picture_layer_impl_unittest.cc @@ -232,7 +232,7 @@ class PictureLayerImplTest : public testing::Test { // Steal from the recycled tree if possible. scoped_ptr<LayerImpl> pending_root = pending_tree->DetachLayerTree(); scoped_ptr<FakePictureLayerImpl> pending_layer; - DCHECK_IMPLIES(pending_root, pending_root->id() == root_id_); + DCHECK(!pending_root || pending_root->id() == root_id_); if (!pending_root) { pending_root = LayerImpl::Create(pending_tree, root_id_); pending_layer = FakePictureLayerImpl::Create(pending_tree, id_); diff --git a/cc/layers/video_layer_impl.cc b/cc/layers/video_layer_impl.cc index 82e32f8..220a9da 100644 --- a/cc/layers/video_layer_impl.cc +++ b/cc/layers/video_layer_impl.cc @@ -243,11 +243,10 @@ void VideoLayerImpl::AppendQuads(RenderPass* render_pass, DCHECK(uv_tex_size == media::VideoFrame::PlaneSize( frame_->format(), media::VideoFrame::kVPlane, coded_size)); - DCHECK_IMPLIES( - frame_resources_.size() > 3, - ya_tex_size == - media::VideoFrame::PlaneSize( - frame_->format(), media::VideoFrame::kAPlane, coded_size)); + DCHECK(frame_resources_.size() <= 3 || + ya_tex_size == media::VideoFrame::PlaneSize( + frame_->format(), media::VideoFrame::kAPlane, + coded_size)); } // Compute the UV sub-sampling factor based on the ratio between diff --git a/cc/output/direct_renderer.cc b/cc/output/direct_renderer.cc index 1be41e9..0083427 100644 --- a/cc/output/direct_renderer.cc +++ b/cc/output/direct_renderer.cc @@ -436,8 +436,8 @@ void DirectRenderer::DrawRenderPass(DrawingFrame* frame, // If |has_external_stencil_test| we can't discard or clear. Make sure we // don't need to. - DCHECK_IMPLIES(has_external_stencil_test, - !frame->current_render_pass->has_transparent_background); + DCHECK(!has_external_stencil_test || + !frame->current_render_pass->has_transparent_background); SurfaceInitializationMode mode; if (should_clear_surface && render_pass_is_clipped) { diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc index 81cc323..1d56429 100644 --- a/cc/output/gl_renderer.cc +++ b/cc/output/gl_renderer.cc @@ -3534,7 +3534,7 @@ void GLRenderer::ScheduleOverlays(DrawingFrame* frame) { unsigned texture_id = 0; if (overlay.use_output_surface_for_resource) { texture_id = output_surface_->GetOverlayTextureId(); - DCHECK_IMPLIES(!texture_id, IsContextLost()); + DCHECK(texture_id || IsContextLost()); } else { pending_overlay_resources_.push_back( make_scoped_ptr(new ResourceProvider::ScopedReadLockGL( diff --git a/cc/playback/display_item_list.cc b/cc/playback/display_item_list.cc index 7614bfd..40194f7 100644 --- a/cc/playback/display_item_list.cc +++ b/cc/playback/display_item_list.cc @@ -203,7 +203,7 @@ size_t DisplayItemList::ApproximateMemoryUsage() const { if (use_cached_picture_ && retain_individual_display_items_) return 0; - DCHECK_IMPLIES(use_cached_picture_, picture_); + DCHECK(!use_cached_picture_ || picture_); size_t memory_usage = sizeof(*this); @@ -273,7 +273,7 @@ void DisplayItemList::GenerateDiscardableImagesMetadata() { DCHECK(ProcessAppendedItemsCalled()); // This should be only called once, and only after CreateAndCacheSkPicture. DCHECK(image_map_.empty()); - DCHECK_IMPLIES(use_cached_picture_, picture_); + DCHECK(!use_cached_picture_ || picture_); if (use_cached_picture_ && !picture_->willPlayBackBitmaps()) return; diff --git a/cc/resources/texture_mailbox.cc b/cc/resources/texture_mailbox.cc index ff4c6f9..ad008b8 100644 --- a/cc/resources/texture_mailbox.cc +++ b/cc/resources/texture_mailbox.cc @@ -36,7 +36,7 @@ TextureMailbox::TextureMailbox(const gpu::Mailbox& mailbox, size_in_pixels_(size_in_pixels), is_overlay_candidate_(is_overlay_candidate), nearest_neighbor_(false) { - DCHECK_IMPLIES(is_overlay_candidate, !size_in_pixels.IsEmpty()); + DCHECK(!is_overlay_candidate || !size_in_pixels.IsEmpty()); } TextureMailbox::TextureMailbox(SharedBitmap* shared_bitmap, diff --git a/cc/scheduler/scheduler.cc b/cc/scheduler/scheduler.cc index b21eacb..28f99ed 100644 --- a/cc/scheduler/scheduler.cc +++ b/cc/scheduler/scheduler.cc @@ -75,10 +75,8 @@ Scheduler::Scheduler( TRACE_EVENT1("cc", "Scheduler::Scheduler", "settings", settings_.AsValue()); DCHECK(client_); DCHECK(!state_machine_.BeginFrameNeeded()); - DCHECK_IMPLIES(settings_.use_external_begin_frame_source, - external_frame_source_); - DCHECK_IMPLIES(!settings_.use_external_begin_frame_source, - synthetic_frame_source_); + DCHECK(!settings_.use_external_begin_frame_source || external_frame_source_); + DCHECK(settings_.use_external_begin_frame_source || synthetic_frame_source_); DCHECK(unthrottled_frame_source_); begin_retro_frame_closure_ = diff --git a/cc/scheduler/scheduler_state_machine.cc b/cc/scheduler/scheduler_state_machine.cc index 8e4fed8..2e4ad85d 100644 --- a/cc/scheduler/scheduler_state_machine.cc +++ b/cc/scheduler/scheduler_state_machine.cc @@ -493,8 +493,7 @@ bool SchedulerStateMachine::ShouldCommit() const { // If we only have an active tree, it is incorrect to replace it // before we've drawn it. - DCHECK_IMPLIES(settings_.commit_to_active_tree, - !active_tree_needs_first_draw_); + DCHECK(!settings_.commit_to_active_tree || !active_tree_needs_first_draw_); return true; } diff --git a/cc/test/fake_display_list_raster_source.cc b/cc/test/fake_display_list_raster_source.cc index de69afa..163559b 100644 --- a/cc/test/fake_display_list_raster_source.cc +++ b/cc/test/fake_display_list_raster_source.cc @@ -82,8 +82,8 @@ scoped_refptr<FakeDisplayListRasterSource> FakeDisplayListRasterSource::CreatePartiallyFilled( const gfx::Size& size, const gfx::Rect& recorded_viewport) { - DCHECK_IMPLIES(!recorded_viewport.IsEmpty(), - gfx::Rect(size).Contains(recorded_viewport)); + DCHECK(recorded_viewport.IsEmpty() || + gfx::Rect(size).Contains(recorded_viewport)); auto recording_source = FakeDisplayListRecordingSource::CreateRecordingSource( recorded_viewport, size); diff --git a/cc/tiles/picture_layer_tiling.cc b/cc/tiles/picture_layer_tiling.cc index 62e7da8..50a478f 100644 --- a/cc/tiles/picture_layer_tiling.cc +++ b/cc/tiles/picture_layer_tiling.cc @@ -284,8 +284,7 @@ void PictureLayerTiling::SetRasterSourceAndResize( } void PictureLayerTiling::Invalidate(const Region& layer_invalidation) { - DCHECK_IMPLIES(tree_ == ACTIVE_TREE, - !client_->GetPendingOrActiveTwinTiling(this)); + DCHECK(tree_ != ACTIVE_TREE || !client_->GetPendingOrActiveTwinTiling(this)); RemoveTilesInRegion(layer_invalidation, true /* recreate tiles */); } @@ -686,8 +685,8 @@ bool PictureLayerTiling::ComputeTilePriorityRects( eventually_rect = tiling_data_.ExpandRectIgnoringBordersToTileBounds(eventually_rect); - DCHECK_IMPLIES(!eventually_rect.IsEmpty(), - gfx::Rect(tiling_size()).Contains(eventually_rect)) + DCHECK(eventually_rect.IsEmpty() || + gfx::Rect(tiling_size()).Contains(eventually_rect)) << "tiling_size: " << tiling_size().ToString() << " eventually_rect: " << eventually_rect.ToString(); diff --git a/cc/tiles/picture_layer_tiling_set.cc b/cc/tiles/picture_layer_tiling_set.cc index 9facf9f2..0848e61 100644 --- a/cc/tiles/picture_layer_tiling_set.cc +++ b/cc/tiles/picture_layer_tiling_set.cc @@ -140,7 +140,7 @@ void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSourceForCommit( // Invalidate tiles and update them to the new raster source. for (PictureLayerTiling* tiling : tilings_) { - DCHECK_IMPLIES(tree_ == PENDING_TREE, !tiling->has_tiles()); + DCHECK(tree_ != PENDING_TREE || !tiling->has_tiles()); tiling->SetRasterSourceAndResize(raster_source); // We can commit on either active or pending trees, but only active one can diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc index 56e6971..eccf3f0 100644 --- a/cc/tiles/tile_manager.cc +++ b/cc/tiles/tile_manager.cc @@ -521,8 +521,8 @@ void TileManager::AssignGpuMemoryToTiles( tile->scheduled_priority_ = schedule_priority++; - DCHECK_IMPLIES(tile->draw_info().mode() != TileDrawInfo::OOM_MODE, - !tile->draw_info().IsReadyToDraw()); + DCHECK(tile->draw_info().mode() == TileDrawInfo::OOM_MODE || + !tile->draw_info().IsReadyToDraw()); // If the tile already has a raster_task, then the memory used by it is // already accounted for in memory_usage. Otherwise, we'll have to acquire @@ -795,8 +795,8 @@ bool TileManager::AreRequiredTilesReadyToDraw( client_->BuildRasterQueue(global_state_.tree_priority, type)); for (; !all_queue->IsEmpty(); all_queue->Pop()) { Tile* tile = all_queue->Top().tile(); - DCHECK_IMPLIES(tile->required_for_activation(), - tile->draw_info().IsReadyToDraw()); + DCHECK(!tile->required_for_activation() || + tile->draw_info().IsReadyToDraw()); } #endif return true; diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 95c3e56..0a06830 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc @@ -125,7 +125,7 @@ class TileManagerTilePriorityQueueTest : public testing::Test { // Steal from the recycled tree. scoped_ptr<LayerImpl> old_pending_root = pending_tree->DetachLayerTree(); - DCHECK_IMPLIES(old_pending_root, old_pending_root->id() == id_); + DCHECK(!old_pending_root || old_pending_root->id() == id_); scoped_ptr<FakePictureLayerImpl> pending_layer; if (old_pending_root) { diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 7641fe8..e00c15e 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -955,8 +955,8 @@ void LayerTreeHost::RegisterViewportLayers( scoped_refptr<Layer> page_scale_layer, scoped_refptr<Layer> inner_viewport_scroll_layer, scoped_refptr<Layer> outer_viewport_scroll_layer) { - DCHECK_IMPLIES(inner_viewport_scroll_layer, - inner_viewport_scroll_layer != outer_viewport_scroll_layer); + DCHECK(!inner_viewport_scroll_layer || + inner_viewport_scroll_layer != outer_viewport_scroll_layer); overscroll_elasticity_layer_ = overscroll_elasticity_layer; page_scale_layer_ = page_scale_layer; inner_viewport_scroll_layer_ = inner_viewport_scroll_layer; diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc index 5af5fc1..e02cf8b 100644 --- a/cc/trees/layer_tree_host_common.cc +++ b/cc/trees/layer_tree_host_common.cc @@ -415,8 +415,8 @@ void UpdateAccumulatedSurfaceState( current_target->render_surface()->draw_transform(); // If we have unclipped descendants, the draw transform is a translation. - DCHECK_IMPLIES(current_target->num_unclipped_descendants(), - current_draw_transform.IsIdentityOrTranslation()); + DCHECK(!current_target->num_unclipped_descendants() || + current_draw_transform.IsIdentityOrTranslation()); target_rect = MathUtil::MapEnclosingClippedRect(current_draw_transform, target_rect); diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 235817d..c598dcd 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -477,8 +477,8 @@ void LayerTreeHostImpl::StartPageScaleAnimation( } void LayerTreeHostImpl::SetNeedsAnimateInput() { - DCHECK_IMPLIES(IsCurrentlyScrollingInnerViewport(), - !settings_.ignore_root_layer_flings); + DCHECK(!IsCurrentlyScrollingInnerViewport() || + !settings_.ignore_root_layer_flings); SetNeedsAnimate(); } @@ -1019,7 +1019,7 @@ DrawResult LayerTreeHostImpl::CalculateRenderPasses( // destroyed. // TODO(weiliangc): Test copy request w/ output surface recreation. Would // trigger this DCHECK. - DCHECK_IMPLIES(have_copy_request, draw_result == DRAW_SUCCESS); + DCHECK(!have_copy_request || draw_result == DRAW_SUCCESS); return draw_result; } diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc index f92be58..2f1d954 100644 --- a/cc/trees/property_tree_builder.cc +++ b/cc/trees/property_tree_builder.cc @@ -236,7 +236,7 @@ bool AddTransformNodeIfNeeded( is_page_scale_layer; LayerType* transform_parent = GetTransformParent(data_from_ancestor, layer); - DCHECK_IMPLIES(!is_root, transform_parent); + DCHECK(is_root || transform_parent); int parent_index = kRootPropertyTreeNodeId; if (transform_parent) diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc index 96cd8b2..e9e6389 100644 --- a/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc +++ b/chrome/browser/captive_portal/captive_portal_tab_helper_unittest.cc @@ -127,7 +127,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { content::WebContentsTester* web_contents_tester = content::WebContentsTester::For(web_contents()); web_contents_tester->StartNavigation(url); - DCHECK_IMPLIES(navigation_type == kSameProcess, !pending_main_rfh()); + DCHECK(navigation_type != kSameProcess || !pending_main_rfh()); EXPECT_CALL(mock_reloader(), OnAbort()).Times(1); content::RenderFrameHost* rfh = @@ -156,7 +156,7 @@ class CaptivePortalTabHelperTest : public ChromeRenderViewHostTestHarness { content::WebContentsTester* web_contents_tester = content::WebContentsTester::For(web_contents()); web_contents_tester->StartNavigation(url); - DCHECK_IMPLIES(navigation_type == kSameProcess, !pending_main_rfh()); + DCHECK(navigation_type != kSameProcess || !pending_main_rfh()); EXPECT_CALL(mock_reloader(), OnAbort()).Times(1); content::RenderFrameHost* rfh = diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc index 26c5c96..e3bb65a 100644 --- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc +++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc @@ -122,7 +122,7 @@ bool ManagePasswordsUIController::OnChooseCredentials( ScopedVector<autofill::PasswordForm> federated_credentials, const GURL& origin, base::Callback<void(const password_manager::CredentialInfo&)> callback) { - DCHECK_IMPLIES(local_credentials.empty(), !federated_credentials.empty()); + DCHECK(!local_credentials.empty() || !federated_credentials.empty()); passwords_data_.OnRequestCredentials(local_credentials.Pass(), federated_credentials.Pass(), origin); diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.cc b/components/page_load_metrics/browser/metrics_web_contents_observer.cc index d19d332..6fed6ca 100644 --- a/components/page_load_metrics/browser/metrics_web_contents_observer.cc +++ b/components/page_load_metrics/browser/metrics_web_contents_observer.cc @@ -49,9 +49,8 @@ bool IsValidPageLoadTiming(const PageLoadTiming& timing) { DCHECK(!timing.navigation_start.is_null()); // If we have a DOM content loaded event, we should have a response start. - DCHECK_IMPLIES( - !timing.dom_content_loaded_event_start.is_zero(), - timing.response_start <= timing.dom_content_loaded_event_start); + DCHECK(timing.dom_content_loaded_event_start.is_zero() || + timing.response_start <= timing.dom_content_loaded_event_start); // If we have a load event, we should have both a response start and a DCL. // TODO(csharrison) crbug.com/536203 shows that sometimes we can get a load diff --git a/components/tracing/child_memory_dump_manager_delegate_impl.h b/components/tracing/child_memory_dump_manager_delegate_impl.h index 007776a..8150a07 100644 --- a/components/tracing/child_memory_dump_manager_delegate_impl.h +++ b/components/tracing/child_memory_dump_manager_delegate_impl.h @@ -41,11 +41,11 @@ class TRACING_EXPORT ChildMemoryDumpManagerDelegateImpl // Pass kInvalidTracingProcessId to invalidate the id. void set_tracing_process_id(uint64 id) { - DCHECK_IMPLIES( - tracing_process_id_ != - base::trace_event::MemoryDumpManager::kInvalidTracingProcessId, - id == base::trace_event::MemoryDumpManager::kInvalidTracingProcessId || - id == tracing_process_id_); + DCHECK(tracing_process_id_ == + base::trace_event::MemoryDumpManager::kInvalidTracingProcessId || + id == + base::trace_event::MemoryDumpManager::kInvalidTracingProcessId || + id == tracing_process_id_); tracing_process_id_ = id; } diff --git a/content/browser/frame_host/navigation_entry_impl.cc b/content/browser/frame_host/navigation_entry_impl.cc index 3b1f6d8..3c20692 100644 --- a/content/browser/frame_host/navigation_entry_impl.cc +++ b/content/browser/frame_host/navigation_entry_impl.cc @@ -602,8 +602,8 @@ NavigationEntryImpl::TreeNode* NavigationEntryImpl::FindFrameEntry( work_queue.pop(); if (node->MatchesFrame(frame_tree_node)) { // Only the root TreeNode should have a FTN ID of -1. - DCHECK_IMPLIES(node->frame_entry->frame_tree_node_id() == -1, - node == root_node()); + DCHECK(node->frame_entry->frame_tree_node_id() != -1 || + node == root_node()); return node; } // Enqueue any children and keep looking. diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc index d253d5f..dde92ee 100644 --- a/content/browser/frame_host/navigation_handle_impl.cc +++ b/content/browser/frame_host/navigation_handle_impl.cc @@ -248,7 +248,7 @@ void NavigationHandleImpl::ReadyToCommitNavigation( void NavigationHandleImpl::DidCommitNavigation( bool same_page, RenderFrameHostImpl* render_frame_host) { - CHECK_IMPLIES(render_frame_host_, render_frame_host_ == render_frame_host); + CHECK(!render_frame_host_ || render_frame_host_ == render_frame_host); is_same_page_ = same_page; render_frame_host_ = render_frame_host; state_ = net_error_code_ == net::OK ? DID_COMMIT : DID_COMMIT_ERROR_PAGE; @@ -257,8 +257,8 @@ void NavigationHandleImpl::DidCommitNavigation( NavigationThrottle::ThrottleCheckResult NavigationHandleImpl::CheckWillStartRequest() { DCHECK(state_ == WILL_SEND_REQUEST || state_ == DEFERRING_START); - DCHECK_IMPLIES(state_ == WILL_SEND_REQUEST, next_index_ == 0); - DCHECK_IMPLIES(state_ == DEFERRING_START, next_index_ != 0); + DCHECK(state_ != WILL_SEND_REQUEST || next_index_ == 0); + DCHECK(state_ != DEFERRING_START || next_index_ != 0); for (size_t i = next_index_; i < throttles_.size(); ++i) { NavigationThrottle::ThrottleCheckResult result = throttles_[i]->WillStartRequest(); @@ -286,8 +286,8 @@ NavigationHandleImpl::CheckWillStartRequest() { NavigationThrottle::ThrottleCheckResult NavigationHandleImpl::CheckWillRedirectRequest() { DCHECK(state_ == WILL_REDIRECT_REQUEST || state_ == DEFERRING_REDIRECT); - DCHECK_IMPLIES(state_ == WILL_REDIRECT_REQUEST, next_index_ == 0); - DCHECK_IMPLIES(state_ == DEFERRING_REDIRECT, next_index_ != 0); + DCHECK(state_ != WILL_REDIRECT_REQUEST || next_index_ == 0); + DCHECK(state_ != DEFERRING_REDIRECT || next_index_ != 0); for (size_t i = next_index_; i < throttles_.size(); ++i) { NavigationThrottle::ThrottleCheckResult result = throttles_[i]->WillRedirectRequest(); diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc index 171b1b5..4fb2eb9 100644 --- a/content/browser/frame_host/navigation_request.cc +++ b/content/browser/frame_host/navigation_request.cc @@ -158,7 +158,7 @@ NavigationRequest::NavigationRequest( restore_type_(NavigationEntryImpl::RESTORE_NONE), is_view_source_(false), bindings_(NavigationEntryImpl::kInvalidBindings) { - DCHECK_IMPLIES(browser_initiated, entry != nullptr && frame_entry != nullptr); + DCHECK(!browser_initiated || (entry != nullptr && frame_entry != nullptr)); if (browser_initiated) { // TODO(clamy): use the FrameNavigationEntry for the source SiteInstance // once it has been moved from the NavigationEntry. diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc index 06a15f8..a9cd3bf 100644 --- a/content/browser/frame_host/render_frame_host_impl.cc +++ b/content/browser/frame_host/render_frame_host_impl.cc @@ -2073,7 +2073,7 @@ bool RenderFrameHostImpl::IsRenderFrameLive() { bool is_live = GetProcess()->HasConnection() && render_frame_created_; // Sanity check: the RenderView should always be live if the RenderFrame is. - DCHECK_IMPLIES(is_live, render_view_host_->IsRenderViewLive()); + DCHECK(!is_live || render_view_host_->IsRenderViewLive()); return is_live; } diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc index b38cc53..8dc0cca 100644 --- a/content/browser/frame_host/render_frame_host_manager.cc +++ b/content/browser/frame_host/render_frame_host_manager.cc @@ -670,7 +670,7 @@ void RenderFrameHostManager::CommitPendingIfNecessary( RenderFrameHostImpl* render_frame_host, bool was_caused_by_user_gesture) { if (!pending_render_frame_host_ && !speculative_render_frame_host_) { - DCHECK_IMPLIES(should_reuse_web_ui_, web_ui_); + DCHECK(!should_reuse_web_ui_ || web_ui_); // We should only hear this from our current renderer. DCHECK_EQ(render_frame_host_, render_frame_host); @@ -1783,12 +1783,12 @@ scoped_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame( SiteIsolationPolicy::IsSwappedOutStateForbidden(); CHECK(instance); - CHECK_IMPLIES(swapped_out_forbidden, !swapped_out); - CHECK_IMPLIES(!SiteIsolationPolicy::AreCrossProcessFramesPossible(), - frame_tree_node_->IsMainFrame()); + CHECK(!swapped_out_forbidden || !swapped_out); + CHECK(SiteIsolationPolicy::AreCrossProcessFramesPossible() || + frame_tree_node_->IsMainFrame()); // Swapped out views should always be hidden. - DCHECK_IMPLIES(swapped_out, (flags & CREATE_RF_HIDDEN)); + DCHECK(!swapped_out || (flags & CREATE_RF_HIDDEN)); scoped_ptr<RenderFrameHostImpl> new_render_frame_host; bool success = true; diff --git a/content/browser/frame_host/render_frame_proxy_host.cc b/content/browser/frame_host/render_frame_proxy_host.cc index 2ef3d26..8f9e57f 100644 --- a/content/browser/frame_host/render_frame_proxy_host.cc +++ b/content/browser/frame_host/render_frame_proxy_host.cc @@ -57,9 +57,9 @@ RenderFrameProxyHost::RenderFrameProxyHost(SiteInstance* site_instance, std::make_pair( RenderFrameProxyHostID(GetProcess()->GetID(), routing_id_), this)).second); - CHECK_IMPLIES(!render_view_host, - frame_tree_node_->render_manager()->ForInnerDelegate() && - frame_tree_node_->IsMainFrame()); + CHECK(render_view_host || + (frame_tree_node_->render_manager()->ForInnerDelegate() && + frame_tree_node_->IsMainFrame())); if (render_view_host) frame_tree_node_->frame_tree()->AddRenderViewHostRef(render_view_host_); diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index b83800b..850a244 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc @@ -709,7 +709,7 @@ void CompositorImpl::ScheduleComposite() { if (ignore_schedule_composite_ || !host_->visible()) return; - DCHECK_IMPLIES(needs_composite_, WillComposite()); + DCHECK(!needs_composite_ || WillComposite()); needs_composite_ = true; // We currently expect layer tree invalidations at most once per frame // during normal operation and therefore try to composite immediately diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc index 193797b..bea6020 100644 --- a/content/child/web_url_loader_impl.cc +++ b/content/child/web_url_loader_impl.cc @@ -450,10 +450,10 @@ void WebURLLoaderImpl::Context::Start(const WebURLRequest& request, // the WebURLLoader are the ones created by CommitNavigation. Several browser // tests load HTML directly through a data url which will be handled by the // block above. - DCHECK_IMPLIES(base::CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableBrowserSideNavigation), - stream_override_.get() || - request.frameType() == WebURLRequest::FrameTypeNone); + DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableBrowserSideNavigation) || + stream_override_.get() || + request.frameType() == WebURLRequest::FrameTypeNone); GURL referrer_url( request.httpHeaderField(WebString::fromUTF8("Referer")).latin1()); diff --git a/content/common/discardable_shared_memory_heap.cc b/content/common/discardable_shared_memory_heap.cc index bf124f7..61f05d3 100644 --- a/content/common/discardable_shared_memory_heap.cc +++ b/content/common/discardable_shared_memory_heap.cc @@ -176,8 +176,8 @@ DiscardableSharedMemoryHeap::Split(Span* span, size_t blocks) { scoped_ptr<Span> leftover(new Span( span->shared_memory_, span->start_ + blocks, span->length_ - blocks)); - DCHECK_IMPLIES(leftover->length_ > 1, - spans_.find(leftover->start_) == spans_.end()); + DCHECK(leftover->length_ == 1 || + spans_.find(leftover->start_) == spans_.end()); RegisterSpan(leftover.get()); spans_[span->start_ + blocks - 1] = span; span->length_ = blocks; @@ -281,7 +281,7 @@ DiscardableSharedMemoryHeap::Carve(Span* span, size_t blocks) { scoped_ptr<Span> leftover( new Span(serving->shared_memory_, serving->start_ + blocks, extra)); leftover->set_is_locked(false); - DCHECK_IMPLIES(extra > 1, spans_.find(leftover->start_) == spans_.end()); + DCHECK(extra == 1 || spans_.find(leftover->start_) == spans_.end()); RegisterSpan(leftover.get()); // No need to coalesce as the previous span of |leftover| was just split diff --git a/content/common/gpu/client/gl_helper_scaling.cc b/content/common/gpu/client/gl_helper_scaling.cc index 7b7338d..49cab49 100644 --- a/content/common/gpu/client/gl_helper_scaling.cc +++ b/content/common/gpu/client/gl_helper_scaling.cc @@ -870,8 +870,7 @@ void ShaderProgram::Setup(const GLchar* vertex_shader_text, // The only reason fetching these attribute locations should fail is // if the context was spontaneously lost (i.e., because the GPU // process crashed, perhaps deliberately for testing). - DCHECK_IMPLIES(!Initialized(), - gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR); + DCHECK(Initialized() || gl_->GetGraphicsResetStatusKHR() != GL_NO_ERROR); } void ShaderProgram::UseProgram(const gfx::Size& src_size, diff --git a/content/common/gpu/media/vp9_decoder.cc b/content/common/gpu/media/vp9_decoder.cc index 7c25832..c1adc84 100644 --- a/content/common/gpu/media/vp9_decoder.cc +++ b/content/common/gpu/media/vp9_decoder.cc @@ -138,8 +138,7 @@ VP9Decoder::DecodeResult VP9Decoder::Decode() { void VP9Decoder::RefreshReferenceFrames(const scoped_refptr<VP9Picture>& pic) { for (size_t i = 0; i < media::kVp9NumRefFrames; ++i) { - DCHECK_IMPLIES(pic->frame_hdr->IsKeyframe(), - pic->frame_hdr->RefreshFlag(i)); + DCHECK(!pic->frame_hdr->IsKeyframe() || pic->frame_hdr->RefreshFlag(i)); if (pic->frame_hdr->RefreshFlag(i)) ref_frames_[i] = pic; } diff --git a/content/renderer/gpu/mailbox_output_surface.cc b/content/renderer/gpu/mailbox_output_surface.cc index fe6bd6a..a536f99 100644 --- a/content/renderer/gpu/mailbox_output_surface.cc +++ b/content/renderer/gpu/mailbox_output_surface.cc @@ -200,9 +200,9 @@ void MailboxOutputSurface::SwapBuffers(cc::CompositorFrame* frame) { DCHECK(!surface_size_.IsEmpty()); DCHECK(surface_size_ == current_backing_.size); DCHECK(frame->gl_frame_data->size == current_backing_.size); - DCHECK_IMPLIES(current_backing_.mailbox.IsZero(), - context_provider_->ContextGL()->GetGraphicsResetStatusKHR() != - GL_NO_ERROR); + DCHECK(!current_backing_.mailbox.IsZero() || + context_provider_->ContextGL()->GetGraphicsResetStatusKHR() != + GL_NO_ERROR); frame->gl_frame_data->mailbox = current_backing_.mailbox; context_provider_->ContextGL()->Flush(); diff --git a/content/renderer/input/input_handler_proxy.cc b/content/renderer/input/input_handler_proxy.cc index d4d3268..255492f 100644 --- a/content/renderer/input/input_handler_proxy.cc +++ b/content/renderer/input/input_handler_proxy.cc @@ -757,8 +757,8 @@ void InputHandlerProxy::ExtendBoostedFlingTimeout( void InputHandlerProxy::Animate(base::TimeTicks time) { // If using synchronous animate, then only expect Animate attempts started by // the synchronous system. Don't let the InputHandler try to Animate also. - DCHECK_IMPLIES(input_handler_->IsCurrentlyScrollingInnerViewport(), - allow_root_animate_); + DCHECK(!input_handler_->IsCurrentlyScrollingInnerViewport() || + allow_root_animate_); if (scroll_elasticity_controller_) scroll_elasticity_controller_->Animate(time); diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 255684a..9172453 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -644,7 +644,7 @@ void RenderFrameImpl::CreateFrame( replicated_state.sandbox_flags); } render_frame->SetWebFrame(web_frame); - CHECK_IMPLIES(parent_routing_id == MSG_ROUTING_NONE, !web_frame->parent()); + CHECK(parent_routing_id != MSG_ROUTING_NONE || !web_frame->parent()); WebFrame* opener = ResolveOpener(opener_routing_id, nullptr); web_frame->setOpener(opener); @@ -1256,8 +1256,7 @@ void RenderFrameImpl::OnSwapOut( SiteIsolationPolicy::IsSwappedOutStateForbidden(); // This codepath should only be hit for subframes when in --site-per-process. - CHECK_IMPLIES(!is_main_frame_, - SiteIsolationPolicy::AreCrossProcessFramesPossible()); + CHECK(is_main_frame_ || SiteIsolationPolicy::AreCrossProcessFramesPossible()); // Only run unload if we're not swapped out yet, but send the ack either way. if (!is_swapped_out_) { @@ -2677,7 +2676,7 @@ void RenderFrameImpl::didStartProvisionalLoad(blink::WebLocalFrame* frame, DocumentState* document_state = DocumentState::FromDataSource(ds); // We should only navigate to swappedout:// when is_swapped_out_ is true. - CHECK_IMPLIES(ds->request().url() == GURL(kSwappedOutURL), is_swapped_out_) + CHECK(ds->request().url() != GURL(kSwappedOutURL) || is_swapped_out_) << "Heard swappedout:// when not swapped out."; // Update the request time if WebKit has better knowledge of it. @@ -2843,9 +2842,8 @@ void RenderFrameImpl::didCommitProvisionalLoad( // SendUpdateState and update page_id_ even in this case, so that // the current entry gets a state update and so that we don't send a // state update to the wrong entry when we swap back in. - DCHECK_IMPLIES( - navigation_state->common_params().should_replace_current_entry, - render_view_->history_list_length_ > 0); + DCHECK(!navigation_state->common_params().should_replace_current_entry || + render_view_->history_list_length_ > 0); if (GetLoadingUrl() != GURL(kSwappedOutURL) && !navigation_state->common_params().should_replace_current_entry) { // Advance our offset in session history, applying the length limit. @@ -5009,12 +5007,12 @@ void RenderFrameImpl::BeginNavigation(blink::WebURLRequest* request) { GetFetchCredentialsModeForWebURLRequest(*request)); DCHECK(GetFetchRedirectModeForWebURLRequest(*request) == FetchRedirectMode::MANUAL_MODE); - DCHECK_IMPLIES(!frame_->parent(), - GetRequestContextFrameTypeForWebURLRequest(*request) == - REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL); - DCHECK_IMPLIES(frame_->parent(), - GetRequestContextFrameTypeForWebURLRequest(*request) == - REQUEST_CONTEXT_FRAME_TYPE_NESTED); + DCHECK(frame_->parent() || + GetRequestContextFrameTypeForWebURLRequest(*request) == + REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL); + DCHECK(!frame_->parent() || + GetRequestContextFrameTypeForWebURLRequest(*request) == + REQUEST_CONTEXT_FRAME_TYPE_NESTED); Send(new FrameHostMsg_BeginNavigation( routing_id_, diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc index 0c89a13..e785d0a 100644 --- a/content/test/test_render_frame_host.cc +++ b/content/test/test_render_frame_host.cc @@ -321,9 +321,8 @@ void TestRenderFrameHost::NavigateAndCommitRendererInitiated( bool browser_side_navigation = base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableBrowserSideNavigation); - CHECK_IMPLIES(browser_side_navigation, is_loading()); - CHECK_IMPLIES(browser_side_navigation, - !frame_tree_node()->navigation_request()); + CHECK(!browser_side_navigation || is_loading()); + CHECK(!browser_side_navigation || !frame_tree_node()->navigation_request()); SendNavigate(page_id, 0, did_create_new_entry, url); } @@ -397,8 +396,8 @@ void TestRenderFrameHost::PrepareForCommitWithServerRedirect( int32 TestRenderFrameHost::ComputeNextPageID() { const NavigationEntryImpl* entry = static_cast<NavigationEntryImpl*>( frame_tree_node()->navigator()->GetController()->GetPendingEntry()); - DCHECK_IMPLIES(entry && entry->site_instance(), - entry->site_instance() == GetSiteInstance()); + DCHECK(!(entry && entry->site_instance()) || + entry->site_instance() == GetSiteInstance()); // Entry can be null when committing an error page (the pending entry was // cleared during DidFailProvisionalLoad). int page_id = entry ? entry->GetPageID() : -1; diff --git a/content/test/test_web_contents.cc b/content/test/test_web_contents.cc index e69d806..59ef7a5 100644 --- a/content/test/test_web_contents.cc +++ b/content/test/test_web_contents.cc @@ -226,9 +226,9 @@ void TestWebContents::CommitPendingNavigation() { TestRenderFrameHost* rfh = GetPendingMainFrame(); if (!rfh) rfh = old_rfh; - CHECK_IMPLIES(browser_side_navigation, rfh->is_loading()); - CHECK_IMPLIES(browser_side_navigation, - !rfh->frame_tree_node()->navigation_request()); + CHECK(!browser_side_navigation || rfh->is_loading()); + CHECK(!browser_side_navigation || + !rfh->frame_tree_node()->navigation_request()); int page_id = entry->GetPageID(); if (page_id == -1) { diff --git a/content/test/web_contents_observer_sanity_checker.cc b/content/test/web_contents_observer_sanity_checker.cc index 2754dde..1935d2e 100644 --- a/content/test/web_contents_observer_sanity_checker.cc +++ b/content/test/web_contents_observer_sanity_checker.cc @@ -157,16 +157,16 @@ void WebContentsObserverSanityChecker::DidFinishNavigation( NavigationHandle* navigation_handle) { CHECK(NavigationIsOngoing(navigation_handle)); - CHECK_IMPLIES( - navigation_handle->HasCommitted() && !navigation_handle->IsErrorPage(), - navigation_handle->GetNetErrorCode() == net::OK); - CHECK_IMPLIES( - navigation_handle->HasCommitted() && navigation_handle->IsErrorPage(), - navigation_handle->GetNetErrorCode() != net::OK); + CHECK(!(navigation_handle->HasCommitted() && + !navigation_handle->IsErrorPage()) || + navigation_handle->GetNetErrorCode() == net::OK); + CHECK(!(navigation_handle->HasCommitted() && + navigation_handle->IsErrorPage()) || + navigation_handle->GetNetErrorCode() != net::OK); CHECK_EQ(navigation_handle->GetWebContents(), web_contents()); - CHECK_IMPLIES(navigation_handle->HasCommitted(), - navigation_handle->GetRenderFrameHost() != nullptr); + CHECK(!navigation_handle->HasCommitted() || + navigation_handle->GetRenderFrameHost() != nullptr); ongoing_navigations_.erase(navigation_handle); } diff --git a/gpu/command_buffer/service/mailbox_manager_sync.cc b/gpu/command_buffer/service/mailbox_manager_sync.cc index a48d032..94aa1d7 100644 --- a/gpu/command_buffer/service/mailbox_manager_sync.cc +++ b/gpu/command_buffer/service/mailbox_manager_sync.cc @@ -287,7 +287,7 @@ void MailboxManagerSync::UpdateDefinitionLocked( if (definition.Matches(texture)) return; - DCHECK_IMPLIES(image, image_buffer.get()); + DCHECK(!image || image_buffer.get()); if (image && !image_buffer->IsClient(image)) { LOG(ERROR) << "MailboxSync: Incompatible attachment"; return; diff --git a/gpu/command_buffer/service/texture_definition.cc b/gpu/command_buffer/service/texture_definition.cc index ad9fe8a..3f16e85 100644 --- a/gpu/command_buffer/service/texture_definition.cc +++ b/gpu/command_buffer/service/texture_definition.cc @@ -334,7 +334,7 @@ TextureDefinition::TextureDefinition( usage_(texture->usage()), immutable_(texture->IsImmutable()), defined_(texture->IsDefined()) { - DCHECK_IMPLIES(image_buffer_.get(), defined_); + DCHECK(!image_buffer_.get() || defined_); if (!image_buffer_.get() && defined_) { image_buffer_ = NativeImageBuffer::Create(texture->service_id()); DCHECK(image_buffer_.get()); diff --git a/ui/aura/window.cc b/ui/aura/window.cc index c67c0a8..79ef0ce 100644 --- a/ui/aura/window.cc +++ b/ui/aura/window.cc @@ -223,7 +223,7 @@ void Window::Show() { // It is not allowed that a window is visible but the layers alpha is fully // transparent since the window would still be considered to be active but // could not be seen. - DCHECK_IMPLIES(visible_, layer()->GetTargetOpacity() > 0.0f); + DCHECK(!visible_ || layer()->GetTargetOpacity() > 0.0f); SetVisible(true); } diff --git a/ui/events/blink/blink_event_util.cc b/ui/events/blink/blink_event_util.cc index 4b19b3e..659adf3 100644 --- a/ui/events/blink/blink_event_util.cc +++ b/ui/events/blink/blink_event_util.cc @@ -123,7 +123,7 @@ WebTouchPoint CreateWebTouchPoint(const MotionEvent& event, float minor_radius = event.GetTouchMinor(pointer_index) / 2.f; DCHECK_LE(minor_radius, major_radius); - DCHECK_IMPLIES(major_radius, minor_radius); + DCHECK(!major_radius || minor_radius); float orientation_deg = event.GetOrientation(pointer_index) * 180.f / M_PI; DCHECK_GE(major_radius, 0); diff --git a/ui/gl/gl_fence_egl.cc b/ui/gl/gl_fence_egl.cc index 641b8c2..ce6583d 100644 --- a/ui/gl/gl_fence_egl.cc +++ b/ui/gl/gl_fence_egl.cc @@ -44,8 +44,7 @@ void GLFenceEGL::ClientWait() { EGLint flags = 0; EGLTimeKHR time = EGL_FOREVER_KHR; EGLint result = eglClientWaitSyncKHR(display_, sync_, flags, time); - DCHECK_IMPLIES(!g_ignore_egl_sync_failures, - EGL_TIMEOUT_EXPIRED_KHR != result); + DCHECK(g_ignore_egl_sync_failures || EGL_TIMEOUT_EXPIRED_KHR != result); if (result == EGL_FALSE) { LOG(ERROR) << "Failed to wait for EGLSync. error:" << ui::GetLastEGLErrorString(); diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc index ad1e6b9..2ced365 100644 --- a/ui/gl/gl_image_memory.cc +++ b/ui/gl/gl_image_memory.cc @@ -258,8 +258,8 @@ bool GLImageMemory::Initialize(const unsigned char* memory, DCHECK(memory); DCHECK(!memory_); - DCHECK_IMPLIES(IsCompressedFormat(format), size_.width() % 4 == 0); - DCHECK_IMPLIES(IsCompressedFormat(format), size_.height() % 4 == 0); + DCHECK(!IsCompressedFormat(format) || size_.width() % 4 == 0); + DCHECK(!IsCompressedFormat(format) || size_.height() % 4 == 0); memory_ = memory; format_ = format; return true; diff --git a/ui/views/touchui/touch_selection_menu_runner_views.cc b/ui/views/touchui/touch_selection_menu_runner_views.cc index 6f44e52..55b532c 100644 --- a/ui/views/touchui/touch_selection_menu_runner_views.cc +++ b/ui/views/touchui/touch_selection_menu_runner_views.cc @@ -195,7 +195,7 @@ void TouchSelectionMenuRunnerViews::Menu::OnPaint(gfx::Canvas* canvas) { } void TouchSelectionMenuRunnerViews::Menu::WindowClosing() { - DCHECK_IMPLIES(owner_, owner_->menu_ == this); + DCHECK(!owner_ || owner_->menu_ == this); BubbleDelegateView::WindowClosing(); if (owner_) owner_->menu_ = nullptr; diff --git a/ui/views/view.cc b/ui/views/view.cc index 6378432..0fc7559 100644 --- a/ui/views/view.cc +++ b/ui/views/view.cc @@ -742,7 +742,7 @@ void View::Paint(const ui::PaintContext& parent_context) { if (!layer()) { // If the View has a layer() then it is a paint root. Otherwise, we need to // add the offset from the parent into the total offset from the paint root. - DCHECK_IMPLIES(!parent(), bounds().origin() == gfx::Point()); + DCHECK(parent() || bounds().origin() == gfx::Point()); offset_to_parent = GetMirroredPosition().OffsetFromOrigin(); } ui::PaintContext context(parent_context, offset_to_parent); |