OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_ |
7 | 7 |
8 #include "content/public/browser/browser_message_filter.h" | 8 #include "content/public/browser/browser_message_filter.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
11 class RenderWidgetHelper; | 11 class RenderWidgetHelper; |
12 | 12 |
13 // RenderFrameMessageFilter intercepts FrameHost messages on the IO thread | 13 // RenderFrameMessageFilter intercepts FrameHost messages on the IO thread |
14 // that require low-latency processing. The canonical example of this is | 14 // that require low-latency processing. The canonical example of this is |
15 // child-frame creation which is a sync IPC that provides the renderer | 15 // child-frame creation which is a sync IPC that provides the renderer |
16 // with the routing id for a newly created RenderFrame. | 16 // with the routing id for a newly created RenderFrame. |
17 // | 17 // |
18 // This object is created on the UI thread and used on the IO thread. | 18 // This object is created on the UI thread and used on the IO thread. |
19 class RenderFrameMessageFilter : public BrowserMessageFilter { | 19 class RenderFrameMessageFilter : public BrowserMessageFilter { |
20 public: | 20 public: |
21 RenderFrameMessageFilter(int render_process_id, | 21 RenderFrameMessageFilter(int render_process_id, |
22 RenderWidgetHelper* render_widget_helper); | 22 RenderWidgetHelper* render_widget_helper); |
23 | 23 |
24 virtual bool OnMessageReceived(const IPC::Message& message, | 24 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
25 bool* message_was_ok) OVERRIDE; | |
26 | 25 |
27 private: | 26 private: |
28 virtual ~RenderFrameMessageFilter(); | 27 virtual ~RenderFrameMessageFilter(); |
29 | 28 |
30 void OnCreateChildFrame(int parent_routing_id, | 29 void OnCreateChildFrame(int parent_routing_id, |
31 const std::string& frame_name, | 30 const std::string& frame_name, |
32 int* new_render_frame_id); | 31 int* new_render_frame_id); |
33 | 32 |
34 const int render_process_id_; | 33 const int render_process_id_; |
35 | 34 |
36 // Needed for issuing routing ids and surface ids. | 35 // Needed for issuing routing ids and surface ids. |
37 scoped_refptr<RenderWidgetHelper> render_widget_helper_; | 36 scoped_refptr<RenderWidgetHelper> render_widget_helper_; |
38 }; | 37 }; |
39 | 38 |
40 } // namespace content | 39 } // namespace content |
41 | 40 |
42 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_ | 41 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_ |
OLD | NEW |