| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "mojo/application/public/cpp/application_connection.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 | |
| 9 namespace mojo { | |
| 10 | |
| 11 ApplicationConnection::ApplicationConnection() : connection_closed_(false) { | |
| 12 } | |
| 13 | |
| 14 void ApplicationConnection::CloseConnection() { | |
| 15 if (connection_closed_) | |
| 16 return; | |
| 17 OnCloseConnection(); | |
| 18 connection_closed_ = true; | |
| 19 delete this; | |
| 20 } | |
| 21 | |
| 22 ApplicationConnection::~ApplicationConnection() { | |
| 23 // If this DCHECK fails then something has tried to delete this object without | |
| 24 // calling CloseConnection. | |
| 25 DCHECK(connection_closed_); | |
| 26 } | |
| 27 | |
| 28 } // namespace mojo | |
| OLD | NEW |