Skip to content

Commit

Permalink
Mojo: Remove some debugging CHECKs
Browse files Browse the repository at this point in the history
Convincing evidence of external memory stomping obviates the
need for these checks.

BUG=740044

Change-Id: If614e20f9f6417600603b54acb01bd47a9eef6d0
Reviewed-on: https://chromium-review.googlesource.com/676752
Reviewed-by: Jay Civelli <jcivelli@chromium.org>
Commit-Queue: Ken Rockot <rockot@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503543}
  • Loading branch information
krockot authored and Commit Bot committed Sep 21, 2017
1 parent c113b64 commit 266baf9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 33 deletions.
5 changes: 1 addition & 4 deletions mojo/edk/system/message_pipe_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,7 @@ scoped_refptr<Dispatcher> MessagePipeDispatcher::Deserialize(
state->pipe_id, state->endpoint);
}

MessagePipeDispatcher::~MessagePipeDispatcher() {
// TODO(crbug.com/740044): Remove this CHECK.
CHECK(port_closed_ && !in_transit_);
}
MessagePipeDispatcher::~MessagePipeDispatcher() = default;

MojoResult MessagePipeDispatcher::CloseNoLock() {
signal_lock_.AssertAcquired();
Expand Down
8 changes: 1 addition & 7 deletions mojo/edk/system/ports/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,8 @@ int Node::CreateUninitializedPort(PortRef* port_ref) {

scoped_refptr<Port> port(new Port(kInitialSequenceNum, kInitialSequenceNum));
int rv = AddPortWithName(port_name, port);
if (rv != OK) {
// TODO(crbug.com/725605): Remove this CHECK. This is testing whether or not
// random port name generation is somehow resulting in insufficiently random
// and thus colliding names in the wild, which would be one explanation for
// some of the weird behavior we're seeing.
CHECK(false);
if (rv != OK)
return rv;
}

*port_ref = PortRef(port_name, std::move(port));
return OK;
Expand Down
20 changes: 1 addition & 19 deletions mojo/edk/system/watcher_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ void WatcherDispatcher::NotifyHandleState(Dispatcher* dispatcher,
if (it == watched_handles_.end())
return;

// TODO(crbug.com/740044): Remove this.
uint32_t sentinel = sentinel_value_for_debugging_;
base::debug::Alias(&sentinel);
CHECK_EQ(0x12345678u, sentinel);

// Maybe fire a notification to the watch associated with this dispatcher,
// provided we're armed and it cares about the new state.
if (it->second->NotifyState(state, armed_)) {
Expand Down Expand Up @@ -58,11 +53,6 @@ void WatcherDispatcher::NotifyHandleClosed(Dispatcher* dispatcher) {
watched_handles_.erase(it);
}

// TODO(crbug.com/740044): Remove this.
uint32_t sentinel = sentinel_value_for_debugging_;
base::debug::Alias(&sentinel);
CHECK_EQ(0x12345678u, sentinel);

// NOTE: It's important that this is called outside of |lock_| since it
// acquires internal Watch locks.
watch->Cancel();
Expand Down Expand Up @@ -184,11 +174,6 @@ MojoResult WatcherDispatcher::CancelWatch(uintptr_t context) {
watches_.erase(it);
}

// TODO(crbug.com/740044): Remove this.
uint32_t sentinel = sentinel_value_for_debugging_;
base::debug::Alias(&sentinel);
CHECK_EQ(0x12345678u, sentinel);

// Mark the watch as cancelled so no further notifications get through.
watch->Cancel();

Expand Down Expand Up @@ -268,10 +253,7 @@ MojoResult WatcherDispatcher::Arm(
return MOJO_RESULT_FAILED_PRECONDITION;
}

WatcherDispatcher::~WatcherDispatcher() {
// TODO(crbug.com/740044): Remove this.
sentinel_value_for_debugging_ = 0x87654321;
}
WatcherDispatcher::~WatcherDispatcher() = default;

} // namespace edk
} // namespace mojo
3 changes: 0 additions & 3 deletions mojo/edk/system/watcher_dispatcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ class WatcherDispatcher : public Dispatcher {
// an invalid object. It must therefore never be dereferenced.
const Watch* last_watch_to_block_arming_ = nullptr;

// TODO(crbug.com/740044): Remove this.
uint32_t sentinel_value_for_debugging_ = 0x12345678;

DISALLOW_COPY_AND_ASSIGN(WatcherDispatcher);
};

Expand Down

0 comments on commit 266baf9

Please sign in to comment.