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

Side by Side Diff: mojo/public/bindings/lib/message.cc

Issue 65043004: Add better handle tracking, and optimize Connector::Accept. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update per review feedback Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « mojo/public/bindings/lib/message.h ('k') | mojo/public/bindings/lib/message_queue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/bindings/lib/message.h" 5 #include "mojo/public/bindings/lib/message.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
11 namespace mojo { 11 namespace mojo {
12 12
13 Message::Message() 13 Message::Message()
14 : data(NULL) { 14 : data(NULL) {
15 } 15 }
16 16
17 Message::~Message() { 17 Message::~Message() {
18 free(data); 18 free(data);
19 // TODO(darin): Need to Close any handles so they don't leak. 19 std::for_each(handles.begin(), handles.end(), Close);
20 } 20 }
21 21
22 void Message::Swap(Message* other) { 22 void Message::Swap(Message* other) {
23 std::swap(data, other->data); 23 std::swap(data, other->data);
24 std::swap(handles, other->handles); 24 std::swap(handles, other->handles);
25 } 25 }
26 26
27 } // namespace mojo 27 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/bindings/lib/message.h ('k') | mojo/public/bindings/lib/message_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698