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

Side by Side Diff: extensions/renderer/messaging_bindings.h

Issue 2481413004: [Extensions] Make port creation synchronous in unload handlers (Closed)
Patch Set: polish Created 4 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
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 int next_local_id_ = 0;
119 119
120 // The number of ports created in the 'beforeunload' event handler.
121 int ports_created_in_before_unload_ = 0;
lazyboy 2016/11/11 01:39:17 since these are unsigned, can make them unsigned i
Devlin 2016/11/12 01:24:30 Done.
122
123 // The number of ports created in the 'unload' event handler.
124 int ports_created_in_unload_ = 0;
125
126 // The number of ports created during the normal lifetime of the context.
lazyboy 2016/11/11 01:39:17 nit: replace "normal lifetime" with something that
Devlin 2016/11/12 01:24:30 Done.
127 int ports_created_normal_ = 0;
128
120 base::WeakPtrFactory<MessagingBindings> weak_ptr_factory_; 129 base::WeakPtrFactory<MessagingBindings> weak_ptr_factory_;
121 130
122 DISALLOW_COPY_AND_ASSIGN(MessagingBindings); 131 DISALLOW_COPY_AND_ASSIGN(MessagingBindings);
123 }; 132 };
124 133
125 } // namespace extensions 134 } // namespace extensions
126 135
127 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_ 136 #endif // EXTENSIONS_RENDERER_MESSAGING_BINDINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698