| 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> |
| 11 | 11 |
| 12 #include "base/atomic_sequence_num.h" | 12 #include "base/atomic_sequence_num.h" |
| 13 #include "base/containers/hash_tables.h" | 13 #include "base/containers/hash_tables.h" |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
| 16 #include "base/process/process.h" | 16 #include "base/process/process.h" |
| 17 #include "content/common/render_message_filter.mojom.h" |
| 17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/content_browser_client.h" | 19 #include "content/public/browser/content_browser_client.h" |
| 19 #include "content/public/browser/global_request_id.h" | 20 #include "content/public/browser/global_request_id.h" |
| 20 #include "content/public/common/window_container_type.h" | 21 #include "content/public/common/window_container_type.h" |
| 21 #include "third_party/WebKit/public/web/WebPopupType.h" | 22 #include "third_party/WebKit/public/web/WebPopupType.h" |
| 22 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
| 23 | 24 |
| 24 namespace IPC { | 25 namespace IPC { |
| 25 class Message; | 26 class Message; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace base { | 29 namespace base { |
| 29 class TimeDelta; | 30 class TimeDelta; |
| 30 } | 31 } |
| 31 | 32 |
| 32 struct ViewHostMsg_CreateWindow_Params; | |
| 33 | |
| 34 namespace content { | 33 namespace content { |
| 35 class GpuProcessHost; | 34 class GpuProcessHost; |
| 36 class ResourceDispatcherHostImpl; | 35 class ResourceDispatcherHostImpl; |
| 37 class SessionStorageNamespace; | 36 class SessionStorageNamespace; |
| 38 | 37 |
| 39 // Instantiated per RenderProcessHost to provide various optimizations on | 38 // Instantiated per RenderProcessHost to provide various optimizations on |
| 40 // behalf of a RenderWidgetHost. This class bridges between the IO thread | 39 // behalf of a RenderWidgetHost. This class bridges between the IO thread |
| 41 // where the RenderProcessHost's MessageFilter lives and the UI thread where | 40 // where the RenderProcessHost's MessageFilter lives and the UI thread where |
| 42 // the RenderWidgetHost lives. | 41 // the RenderWidgetHost lives. |
| 43 // | 42 // |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 90 |
| 92 // UI THREAD ONLY ----------------------------------------------------------- | 91 // UI THREAD ONLY ----------------------------------------------------------- |
| 93 | 92 |
| 94 // These two functions provide the backend implementation of the | 93 // These two functions provide the backend implementation of the |
| 95 // corresponding functions in RenderProcessHost. See those declarations | 94 // corresponding functions in RenderProcessHost. See those declarations |
| 96 // for documentation. | 95 // for documentation. |
| 97 void ResumeDeferredNavigation(const GlobalRequestID& request_id); | 96 void ResumeDeferredNavigation(const GlobalRequestID& request_id); |
| 98 | 97 |
| 99 // IO THREAD ONLY ----------------------------------------------------------- | 98 // IO THREAD ONLY ----------------------------------------------------------- |
| 100 | 99 |
| 101 void CreateNewWindow(const ViewHostMsg_CreateWindow_Params& params, | 100 void CreateNewWindow(mojom::CreateWindowParamsPtr params, |
| 102 bool no_javascript_access, | 101 bool no_javascript_access, |
| 103 base::ProcessHandle render_process, | 102 base::ProcessHandle render_process, |
| 104 int32_t* route_id, | 103 int32_t* route_id, |
| 105 int32_t* main_frame_route_id, | 104 int32_t* main_frame_route_id, |
| 106 int32_t* main_frame_widget_route_id, | 105 int32_t* main_frame_widget_route_id, |
| 107 SessionStorageNamespace* session_storage_namespace); | 106 SessionStorageNamespace* session_storage_namespace); |
| 108 void CreateNewWidget(int opener_id, | 107 void CreateNewWidget(int opener_id, |
| 109 blink::WebPopupType popup_type, | 108 blink::WebPopupType popup_type, |
| 110 int* route_id); | 109 int* route_id); |
| 111 void CreateNewFullscreenWidget(int opener_id, int* route_id); | 110 void CreateNewFullscreenWidget(int opener_id, int* route_id); |
| 112 | 111 |
| 113 private: | 112 private: |
| 114 friend class base::RefCountedThreadSafe<RenderWidgetHelper>; | 113 friend class base::RefCountedThreadSafe<RenderWidgetHelper>; |
| 115 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; | 114 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>; |
| 116 friend class base::DeleteHelper<RenderWidgetHelper>; | 115 friend class base::DeleteHelper<RenderWidgetHelper>; |
| 117 | 116 |
| 118 ~RenderWidgetHelper(); | 117 ~RenderWidgetHelper(); |
| 119 | 118 |
| 120 // Called on the UI thread to finish creating a window. | 119 // Called on the UI thread to finish creating a window. |
| 121 void OnCreateWindowOnUI(const ViewHostMsg_CreateWindow_Params& params, | 120 void OnCreateWindowOnUI(mojom::CreateWindowParamsPtr params, |
| 122 int32_t route_id, | 121 int32_t route_id, |
| 123 int32_t main_frame_route_id, | 122 int32_t main_frame_route_id, |
| 124 int32_t main_frame_widget_route_id, | 123 int32_t main_frame_widget_route_id, |
| 125 SessionStorageNamespace* session_storage_namespace); | 124 SessionStorageNamespace* session_storage_namespace); |
| 126 | 125 |
| 127 // Called on the UI thread to finish creating a widget. | 126 // Called on the UI thread to finish creating a widget. |
| 128 void OnCreateWidgetOnUI(int32_t opener_id, | 127 void OnCreateWidgetOnUI(int32_t opener_id, |
| 129 int32_t route_id, | 128 int32_t route_id, |
| 130 blink::WebPopupType popup_type); | 129 blink::WebPopupType popup_type); |
| 131 | 130 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 146 base::AtomicSequenceNumber next_routing_id_; | 145 base::AtomicSequenceNumber next_routing_id_; |
| 147 | 146 |
| 148 ResourceDispatcherHostImpl* resource_dispatcher_host_; | 147 ResourceDispatcherHostImpl* resource_dispatcher_host_; |
| 149 | 148 |
| 150 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); | 149 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHelper); |
| 151 }; | 150 }; |
| 152 | 151 |
| 153 } // namespace content | 152 } // namespace content |
| 154 | 153 |
| 155 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ | 154 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HELPER_H_ |
| OLD | NEW |