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

Side by Side Diff: extensions/browser/extension_host.h

Issue 1169223002: [Extensions] Clean up the handling of ExtensionHostMsg_Request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 6 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
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_BROWSER_EXTENSION_HOST_H_ 5 #ifndef EXTENSIONS_BROWSER_EXTENSION_HOST_H_
6 #define EXTENSIONS_BROWSER_EXTENSION_HOST_H_ 6 #define EXTENSIONS_BROWSER_EXTENSION_HOST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 144
145 private: 145 private:
146 // DeferredStartRenderHost: 146 // DeferredStartRenderHost:
147 void CreateRenderViewNow() override; 147 void CreateRenderViewNow() override;
148 void AddDeferredStartRenderHostObserver( 148 void AddDeferredStartRenderHostObserver(
149 DeferredStartRenderHostObserver* observer) override; 149 DeferredStartRenderHostObserver* observer) override;
150 void RemoveDeferredStartRenderHostObserver( 150 void RemoveDeferredStartRenderHostObserver(
151 DeferredStartRenderHostObserver* observer) override; 151 DeferredStartRenderHostObserver* observer) override;
152 152
153 // Message handlers. 153 // Message handlers.
154 void OnRequest(const ExtensionHostMsg_Request_Params& params);
155 void OnEventAck(int event_id); 154 void OnEventAck(int event_id);
156 void OnIncrementLazyKeepaliveCount(); 155 void OnIncrementLazyKeepaliveCount();
157 void OnDecrementLazyKeepaliveCount(); 156 void OnDecrementLazyKeepaliveCount();
158 157
159 // Records UMA for load events. 158 // Records UMA for load events.
160 void RecordStopLoadingUMA(); 159 void RecordStopLoadingUMA();
161 160
162 // Delegate for functionality that cannot exist in the extensions module. 161 // Delegate for functionality that cannot exist in the extensions module.
163 scoped_ptr<ExtensionHostDelegate> delegate_; 162 scoped_ptr<ExtensionHostDelegate> delegate_;
164 163
(...skipping 21 matching lines...) Expand all
186 185
187 // True if the main frame has finished parsing. 186 // True if the main frame has finished parsing.
188 bool document_element_available_; 187 bool document_element_available_;
189 188
190 // The original URL of the page being hosted. 189 // The original URL of the page being hosted.
191 GURL initial_url_; 190 GURL initial_url_;
192 191
193 // Messages sent out to the renderer that have not been acknowledged yet. 192 // Messages sent out to the renderer that have not been acknowledged yet.
194 std::set<int> unacked_messages_; 193 std::set<int> unacked_messages_;
195 194
196 ExtensionFunctionDispatcher extension_function_dispatcher_;
197
198 // The type of view being hosted. 195 // The type of view being hosted.
199 ViewType extension_host_type_; 196 ViewType extension_host_type_;
200 197
201 // Measures how long since the ExtensionHost object was created. This can be 198 // Measures how long since the ExtensionHost object was created. This can be
202 // used to measure the responsiveness of UI. For example, it's important to 199 // used to measure the responsiveness of UI. For example, it's important to
203 // keep this as low as possible for popups. Contrast this to |load_start_|, 200 // keep this as low as possible for popups. Contrast this to |load_start_|,
204 // for which a low value does not necessarily mean a responsive UI, as 201 // for which a low value does not necessarily mean a responsive UI, as
205 // ExtensionHosts may sit in an ExtensionHostQueue for a long time. 202 // ExtensionHosts may sit in an ExtensionHostQueue for a long time.
206 base::ElapsedTimer create_start_; 203 base::ElapsedTimer create_start_;
207 204
208 // Measures how long since the initial URL started loading. This timer is 205 // Measures how long since the initial URL started loading. This timer is
209 // started only once the ExtensionHost has exited the ExtensionHostQueue. 206 // started only once the ExtensionHost has exited the ExtensionHostQueue.
210 scoped_ptr<base::ElapsedTimer> load_start_; 207 scoped_ptr<base::ElapsedTimer> load_start_;
211 208
212 base::ObserverList<ExtensionHostObserver> observer_list_; 209 base::ObserverList<ExtensionHostObserver> observer_list_;
213 base::ObserverList<DeferredStartRenderHostObserver> 210 base::ObserverList<DeferredStartRenderHostObserver>
214 deferred_start_render_host_observer_list_; 211 deferred_start_render_host_observer_list_;
215 212
216 DISALLOW_COPY_AND_ASSIGN(ExtensionHost); 213 DISALLOW_COPY_AND_ASSIGN(ExtensionHost);
217 }; 214 };
218 215
219 } // namespace extensions 216 } // namespace extensions
220 217
221 #endif // EXTENSIONS_BROWSER_EXTENSION_HOST_H_ 218 #endif // EXTENSIONS_BROWSER_EXTENSION_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698