| 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_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_MESSAGE_FILTER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_MESSAGE_FILTER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/linked_ptr.h" | 16 #include "base/memory/linked_ptr.h" |
| 17 #include "base/memory/shared_memory.h" | 17 #include "base/memory/shared_memory.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/sequenced_task_runner_helpers.h" | 19 #include "base/sequenced_task_runner_helpers.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "build/build_config.h" | 21 #include "build/build_config.h" |
| 22 #include "cc/resources/shared_bitmap_manager.h" | 22 #include "cc/resources/shared_bitmap_manager.h" |
| 23 #include "content/common/cache_storage/cache_storage_types.h" | 23 #include "content/common/cache_storage/cache_storage_types.h" |
| 24 #include "content/common/host_discardable_shared_memory_manager.h" | 24 #include "content/common/host_discardable_shared_memory_manager.h" |
| 25 #include "content/common/host_shared_bitmap_manager.h" | 25 #include "content/common/host_shared_bitmap_manager.h" |
| 26 #include "content/common/render_message_filter.mojom.h" |
| 27 #include "content/public/browser/browser_associated_interface.h" |
| 26 #include "content/public/browser/browser_message_filter.h" | 28 #include "content/public/browser/browser_message_filter.h" |
| 27 #include "gpu/config/gpu_info.h" | 29 #include "gpu/config/gpu_info.h" |
| 28 #include "ipc/message_filter.h" | 30 #include "ipc/message_filter.h" |
| 29 #include "third_party/WebKit/public/web/WebPopupType.h" | 31 #include "third_party/WebKit/public/web/WebPopupType.h" |
| 30 #include "ui/gfx/geometry/rect.h" | 32 #include "ui/gfx/geometry/rect.h" |
| 31 #include "ui/gfx/gpu_memory_buffer.h" | 33 #include "ui/gfx/gpu_memory_buffer.h" |
| 32 #include "ui/gfx/native_widget_types.h" | 34 #include "ui/gfx/native_widget_types.h" |
| 33 #include "ui/surface/transport_dib.h" | 35 #include "ui/surface/transport_dib.h" |
| 34 | 36 |
| 35 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 class CacheStorageContextImpl; | 85 class CacheStorageContextImpl; |
| 84 class CacheStorageCacheHandle; | 86 class CacheStorageCacheHandle; |
| 85 class DOMStorageContextWrapper; | 87 class DOMStorageContextWrapper; |
| 86 class MediaInternals; | 88 class MediaInternals; |
| 87 class RenderWidgetHelper; | 89 class RenderWidgetHelper; |
| 88 class ResourceContext; | 90 class ResourceContext; |
| 89 class ResourceDispatcherHostImpl; | 91 class ResourceDispatcherHostImpl; |
| 90 | 92 |
| 91 // This class filters out incoming IPC messages for the renderer process on the | 93 // This class filters out incoming IPC messages for the renderer process on the |
| 92 // IPC thread. | 94 // IPC thread. |
| 93 class CONTENT_EXPORT RenderMessageFilter : public BrowserMessageFilter { | 95 class CONTENT_EXPORT RenderMessageFilter |
| 96 : public BrowserMessageFilter, |
| 97 public BrowserAssociatedInterface<mojom::RenderMessageFilter>, |
| 98 public mojom::RenderMessageFilter { |
| 94 public: | 99 public: |
| 95 // Create the filter. | 100 // Create the filter. |
| 96 RenderMessageFilter(int render_process_id, | 101 RenderMessageFilter(int render_process_id, |
| 97 BrowserContext* browser_context, | 102 BrowserContext* browser_context, |
| 98 net::URLRequestContextGetter* request_context, | 103 net::URLRequestContextGetter* request_context, |
| 99 RenderWidgetHelper* render_widget_helper, | 104 RenderWidgetHelper* render_widget_helper, |
| 100 MediaInternals* media_internals, | 105 MediaInternals* media_internals, |
| 101 DOMStorageContextWrapper* dom_storage_context, | 106 DOMStorageContextWrapper* dom_storage_context, |
| 102 CacheStorageContextImpl* cache_storage_context); | 107 CacheStorageContextImpl* cache_storage_context); |
| 103 | 108 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 123 blink::WebPopupType popup_type, | 128 blink::WebPopupType popup_type, |
| 124 int* route_id); | 129 int* route_id); |
| 125 void OnCreateFullscreenWidget(int opener_id, int* route_id); | 130 void OnCreateFullscreenWidget(int opener_id, int* route_id); |
| 126 | 131 |
| 127 #if defined(OS_MACOSX) | 132 #if defined(OS_MACOSX) |
| 128 // Messages for OOP font loading. | 133 // Messages for OOP font loading. |
| 129 void OnLoadFont(const FontDescriptor& font, IPC::Message* reply_msg); | 134 void OnLoadFont(const FontDescriptor& font, IPC::Message* reply_msg); |
| 130 void SendLoadFontReply(IPC::Message* reply, FontLoader::Result* result); | 135 void SendLoadFontReply(IPC::Message* reply, FontLoader::Result* result); |
| 131 #endif | 136 #endif |
| 132 | 137 |
| 133 void OnGenerateRoutingID(int* route_id); | 138 // mojom::RenderMessageFilter: |
| 139 void GenerateRoutingID(const GenerateRoutingIDCallback& routing_id) override; |
| 134 | 140 |
| 135 // Message handlers called on the browser IO thread: | 141 // Message handlers called on the browser IO thread: |
| 136 void OnEstablishGpuChannel(IPC::Message* reply); | 142 void OnEstablishGpuChannel(IPC::Message* reply); |
| 137 void OnHasGpuProcess(IPC::Message* reply); | 143 void OnHasGpuProcess(IPC::Message* reply); |
| 138 // Helper callbacks for the message handlers. | 144 // Helper callbacks for the message handlers. |
| 139 void EstablishChannelCallback(std::unique_ptr<IPC::Message> reply, | 145 void EstablishChannelCallback(std::unique_ptr<IPC::Message> reply, |
| 140 const IPC::ChannelHandle& channel, | 146 const IPC::ChannelHandle& channel, |
| 141 const gpu::GPUInfo& gpu_info); | 147 const gpu::GPUInfo& gpu_info); |
| 142 void GetGpuProcessHandlesCallback( | 148 void GetGpuProcessHandlesCallback( |
| 143 std::unique_ptr<IPC::Message> reply, | 149 std::unique_ptr<IPC::Message> reply, |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 CacheStorageContextImpl* cache_storage_context_; | 251 CacheStorageContextImpl* cache_storage_context_; |
| 246 | 252 |
| 247 base::WeakPtrFactory<RenderMessageFilter> weak_ptr_factory_; | 253 base::WeakPtrFactory<RenderMessageFilter> weak_ptr_factory_; |
| 248 | 254 |
| 249 DISALLOW_COPY_AND_ASSIGN(RenderMessageFilter); | 255 DISALLOW_COPY_AND_ASSIGN(RenderMessageFilter); |
| 250 }; | 256 }; |
| 251 | 257 |
| 252 } // namespace content | 258 } // namespace content |
| 253 | 259 |
| 254 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_MESSAGE_FILTER_H_ | 260 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_MESSAGE_FILTER_H_ |
| OLD | NEW |