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

Side by Side Diff: runtime/bin/eventhandler.h

Issue 12646007: Fix file descriptor leak in event handler implementation. When shutting down an isolate, we did not… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « pkg/pkg.status ('k') | runtime/bin/eventhandler_linux.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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef BIN_EVENTHANDLER_H_ 5 #ifndef BIN_EVENTHANDLER_H_
6 #define BIN_EVENTHANDLER_H_ 6 #define BIN_EVENTHANDLER_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/isolate_data.h" 9 #include "bin/isolate_data.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void SendData(intptr_t id, Dart_Port dart_port, int64_t data) { 43 void SendData(intptr_t id, Dart_Port dart_port, int64_t data) {
44 delegate_.SendData(id, dart_port, data); 44 delegate_.SendData(id, dart_port, data);
45 } 45 }
46 46
47 void Shutdown() { 47 void Shutdown() {
48 delegate_.Shutdown(); 48 delegate_.Shutdown();
49 } 49 }
50 50
51 static EventHandler* Start() { 51 static EventHandler* Start() {
52 EventHandler* handler = new EventHandler(); 52 EventHandler* handler = new EventHandler();
53 handler->delegate_.Start(); 53 handler->delegate_.Start(handler);
54 IsolateData* isolate_data = 54 IsolateData* isolate_data =
55 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData()); 55 reinterpret_cast<IsolateData*>(Dart_CurrentIsolateData());
56 isolate_data->event_handler = handler; 56 isolate_data->event_handler = handler;
57 return handler; 57 return handler;
58 } 58 }
59 59
60 private: 60 private:
61 friend class EventHandlerImplementation;
61 EventHandlerImplementation delegate_; 62 EventHandlerImplementation delegate_;
62 }; 63 };
63 64
64 65
65 #endif // BIN_EVENTHANDLER_H_ 66 #endif // BIN_EVENTHANDLER_H_
OLDNEW
« no previous file with comments | « pkg/pkg.status ('k') | runtime/bin/eventhandler_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698