| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ | 5 #ifndef EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ |
| 6 #define EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ | 6 #define EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 int GetNextLocalId(); | 108 int GetNextLocalId(); |
| 109 | 109 |
| 110 // Active ports, mapped by local port id. | 110 // Active ports, mapped by local port id. |
| 111 PortMap ports_; | 111 PortMap ports_; |
| 112 | 112 |
| 113 // Ports which are disconnected, but haven't been fully initialized. Once | 113 // Ports which are disconnected, but haven't been fully initialized. Once |
| 114 // initialized and any pending messages are sent, these ports are removed. | 114 // initialized and any pending messages are sent, these ports are removed. |
| 115 PortMap disconnected_ports_; | 115 PortMap disconnected_ports_; |
| 116 | 116 |
| 117 // The next available local id for a port. | 117 // The next available local id for a port. |
| 118 int next_local_id_ = 0; | 118 size_t next_local_id_ = 0; |
| 119 |
| 120 // The number of ports created in the 'beforeunload' event handler. |
| 121 size_t ports_created_in_before_unload_ = 0; |
| 122 |
| 123 // The number of ports created in the 'unload' event handler. |
| 124 size_t ports_created_in_unload_ = 0; |
| 125 |
| 126 // The number of ports created during during any time that isn't in the unload |
| 127 // or beforeunload handlers. |
| 128 int ports_created_normal_ = 0; |
| 119 | 129 |
| 120 base::WeakPtrFactory<MessagingBindings> weak_ptr_factory_; | 130 base::WeakPtrFactory<MessagingBindings> weak_ptr_factory_; |
| 121 | 131 |
| 122 DISALLOW_COPY_AND_ASSIGN(MessagingBindings); | 132 DISALLOW_COPY_AND_ASSIGN(MessagingBindings); |
| 123 }; | 133 }; |
| 124 | 134 |
| 125 } // namespace extensions | 135 } // namespace extensions |
| 126 | 136 |
| 127 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ | 137 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ |
| OLD | NEW |