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

Side by Side Diff: mojo/application/public/cpp/lib/application_connection.cc

Issue 1254383016: ApplicationConnection lifetime management changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « mojo/application/public/cpp/application_impl.h ('k') | mojo/application/public/cpp/lib/application_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698