Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / mojo / application / public / cpp / lib / application_connection.cc
blobc286c85987228681df09df34c42f733c4de45bcc
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.
5 #include "mojo/application/public/cpp/application_connection.h"
7 #include "base/logging.h"
9 namespace mojo {
11 ApplicationConnection::ApplicationConnection() : connection_closed_(false) {
14 void ApplicationConnection::CloseConnection() {
15 if (connection_closed_)
16 return;
17 OnCloseConnection();
18 connection_closed_ = true;
19 delete this;
22 ApplicationConnection::~ApplicationConnection() {
23 // If this DCHECK fails then something has tried to delete this object without
24 // calling CloseConnection.
25 DCHECK(connection_closed_);
28 } // namespace mojo