OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // store in a scoped_refptr. | 89 // store in a scoped_refptr. |
90 static RenderWidgetHelper* FromProcessHostID(int render_process_host_id); | 90 static RenderWidgetHelper* FromProcessHostID(int render_process_host_id); |
91 | 91 |
92 // UI THREAD ONLY ----------------------------------------------------------- | 92 // UI THREAD ONLY ----------------------------------------------------------- |
93 | 93 |
94 // These two functions provide the backend implementation of the | 94 // These two functions provide the backend implementation of the |
95 // corresponding functions in RenderProcessHost. See those declarations | 95 // corresponding functions in RenderProcessHost. See those declarations |
96 // for documentation. | 96 // for documentation. |
97 void ResumeDeferredNavigation(const GlobalRequestID& request_id); | 97 void ResumeDeferredNavigation(const GlobalRequestID& request_id); |
98 | 98 |
99 // Called to resume the requests for a view after it's ready. The view was | |
100 // created by CreateNewWindow which initially blocked the requests. | |
101 void ResumeRequestsForView(int route_id); | |
102 | |
103 // IO THREAD ONLY ----------------------------------------------------------- | 99 // IO THREAD ONLY ----------------------------------------------------------- |
104 | 100 |
105 void CreateNewWindow(const ViewHostMsg_CreateWindow_Params& params, | 101 void CreateNewWindow(const ViewHostMsg_CreateWindow_Params& params, |
106 bool no_javascript_access, | 102 bool no_javascript_access, |
107 base::ProcessHandle render_process, | 103 base::ProcessHandle render_process, |
108 int32_t* route_id, | 104 int32_t* route_id, |
109 int32_t* main_frame_route_id, | 105 int32_t* main_frame_route_id, |
110 int32_t* main_frame_widget_route_id, | 106 int32_t* main_frame_widget_route_id, |
111 SessionStorageNamespace* session_storage_namespace); | 107 SessionStorageNamespace* session_storage_namespace); |
112 void CreateNewWidget(int opener_id, | 108 void CreateNewWidget(int opener_id, |
113 blink::WebPopupType popup_type, | 109 blink::WebPopupType popup_type, |
114 int* route_id); | 110 int* route_id); |
115 void CreateNewFullscreenWidget(int opener_id, int* route_id); | 111 void CreateNewFullscreenWidget(int opener_id, int* route_id); |
116 | 112 |
117 private: | 113 private: |
118 friend class base::RefCountedThreadSafe<RenderWidgetHelper>; | 114 friend class base::RefCountedThreadSafe<RenderWidgetHelper>; |
119 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 115 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
120 friend class base::DeleteHelper<RenderWidgetHelper>; | 116 friend class base::DeleteHelper<RenderWidgetHelper>; |
121 | 117 |
122 ~RenderWidgetHelper(); | 118 ~RenderWidgetHelper(); |
123 | 119 |
124 // Called on the UI thread to finish creating a window. | 120 // Called on the UI thread to finish creating a window. |
125 void OnCreateWindowOnUI(const ViewHostMsg_CreateWindow_Params& params, | 121 void OnCreateWindowOnUI(const ViewHostMsg_CreateWindow_Params& params, |
126 int32_t route_id, | 122 int32_t route_id, |
127 int32_t main_frame_route_id, | 123 int32_t main_frame_route_id, |
128 int32_t main_frame_widget_route_id, | 124 int32_t main_frame_widget_route_id, |
129 SessionStorageNamespace* session_storage_namespace); | 125 SessionStorageNamespace* session_storage_namespace); |
130 | 126 |
131 // Called on the IO thread after a window was created on the UI thread. | |
132 void OnResumeRequestsForView(int route_id); | |
133 | |
134 // Called on the UI thread to finish creating a widget. | 127 // Called on the UI thread to finish creating a widget. |
135 void OnCreateWidgetOnUI(int32_t opener_id, | 128 void OnCreateWidgetOnUI(int32_t opener_id, |
136 int32_t route_id, | 129 int32_t route_id, |
137 blink::WebPopupType popup_type); | 130 blink::WebPopupType popup_type); |
138 | 131 |
139 // Called on the UI thread to create a fullscreen widget. | 132 // Called on the UI thread to create a fullscreen widget. |
140 void OnCreateFullscreenWidgetOnUI(int32_t opener_id, int32_t route_id); | 133 void OnCreateFullscreenWidgetOnUI(int32_t opener_id, int32_t route_id); |
141 | 134 |
142 // Called on the IO thread to resume a paused navigation in the network | 135 // Called on the IO thread to resume a paused navigation in the network |
143 // stack without transferring it to a new renderer process. | 136 // stack without transferring it to a new renderer process. |
144 void OnResumeDeferredNavigation(const GlobalRequestID& request_id); | 137 void OnResumeDeferredNavigation(const GlobalRequestID& request_id); |
145 | 138 |
146 // Called on the IO thread to resume a navigation paused immediately after | 139 // Called on the IO thread to resume a navigation paused immediately after |
147 // receiving response headers. | 140 // receiving response headers. |
148 void OnResumeResponseDeferredAtStart(const GlobalRequestID& request_id); | 141 void OnResumeResponseDeferredAtStart(const GlobalRequestID& request_id); |
149 | 142 |
150 int render_process_id_; | 143 int render_process_id_; |
151 | 144 |
152 // The next routing id to use. | 145 // The next routing id to use. |
153 base::AtomicSequenceNumber next_routing_id_; | 146 base::AtomicSequenceNumber next_routing_id_; |
154 | 147 |
155 ResourceDispatcherHostImpl* resource_dispatcher_host_; | 148 ResourceDispatcherHostImpl* resource_dispatcher_host_; |
156 | 149 |
157 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 150 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
158 }; | 151 }; |
159 | 152 |
160 } // namespace content | 153 } // namespace content |
161 | 154 |
162 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 155 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
OLD | NEW |