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

Side by Side Diff: content/browser/frame_host/render_frame_message_filter.h

Issue 1836973003: Move download messages from Renderer to Frame filter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 13 matching lines...) Expand all
24 class GURL; 24 class GURL;
25 25
26 namespace net { 26 namespace net {
27 class URLRequestContext; 27 class URLRequestContext;
28 class URLRequestContextGetter; 28 class URLRequestContextGetter;
29 } 29 }
30 30
31 namespace content { 31 namespace content {
32 class BrowserContext; 32 class BrowserContext;
33 class PluginServiceImpl; 33 class PluginServiceImpl;
34 struct Referrer;
Charlie Reis 2016/05/13 21:50:22 nit: structs after classes, right?
asanka 2016/05/18 16:26:53 Hm. I've also been sorting by identifier ignoring
dcheng 2016/05/24 07:18:08 I also sort it by identifier, ignoring class name.
34 class RenderWidgetHelper; 35 class RenderWidgetHelper;
35 class ResourceContext; 36 class ResourceContext;
36 struct WebPluginInfo; 37 struct WebPluginInfo;
37 38
38 // RenderFrameMessageFilter intercepts FrameHost messages on the IO thread 39 // RenderFrameMessageFilter intercepts FrameHost messages on the IO thread
39 // that require low-latency processing. The canonical example of this is 40 // that require low-latency processing. The canonical example of this is
40 // child-frame creation which is a sync IPC that provides the renderer 41 // child-frame creation which is a sync IPC that provides the renderer
41 // with the routing id for a newly created RenderFrame. 42 // with the routing id for a newly created RenderFrame.
42 // 43 //
43 // This object is created on the UI thread and used on the IO thread. 44 // This object is created on the UI thread and used on the IO thread.
44 class RenderFrameMessageFilter : public BrowserMessageFilter { 45 class RenderFrameMessageFilter : public BrowserMessageFilter {
45 public: 46 public:
46 RenderFrameMessageFilter(int render_process_id, 47 RenderFrameMessageFilter(int render_process_id,
47 PluginServiceImpl* plugin_service, 48 PluginServiceImpl* plugin_service,
48 BrowserContext* browser_context, 49 BrowserContext* browser_context,
49 net::URLRequestContextGetter* request_context, 50 net::URLRequestContextGetter* request_context,
50 RenderWidgetHelper* render_widget_helper); 51 RenderWidgetHelper* render_widget_helper);
51 52
52 // BrowserMessageFilter methods: 53 // BrowserMessageFilter methods:
53 bool OnMessageReceived(const IPC::Message& message) override; 54 bool OnMessageReceived(const IPC::Message& message) override;
54 55
56 protected:
57 // This method will be overridden by TestSaveImageFromDataURL class for test.
58 virtual void DownloadUrl(int render_view_id,
59 int render_frame_id,
60 const GURL& url,
61 const Referrer& referrer,
62 const base::string16& suggested_name,
63 const bool use_prompt) const;
64
55 private: 65 private:
56 class OpenChannelToPpapiPluginCallback; 66 class OpenChannelToPpapiPluginCallback;
57 class OpenChannelToPpapiBrokerCallback; 67 class OpenChannelToPpapiBrokerCallback;
58 68
59 ~RenderFrameMessageFilter() override; 69 ~RenderFrameMessageFilter() override;
60 70
61 void OnCreateChildFrame(const FrameHostMsg_CreateChildFrame_Params& params, 71 void OnCreateChildFrame(const FrameHostMsg_CreateChildFrame_Params& params,
62 int* new_render_frame_id); 72 int* new_render_frame_id);
63 void OnSetCookie(int render_frame_id, 73 void OnSetCookie(int render_frame_id,
64 const GURL& url, 74 const GURL& url,
(...skipping 13 matching lines...) Expand all
78 const GURL& url, 88 const GURL& url,
79 const GURL& first_party_for_cookies, 89 const GURL& first_party_for_cookies,
80 IPC::Message* reply_msg, 90 IPC::Message* reply_msg,
81 const net::CookieList& cookie_list); 91 const net::CookieList& cookie_list);
82 92
83 // Writes the cookies to reply messages, and sends the message. 93 // Writes the cookies to reply messages, and sends the message.
84 // Callback functions for getting cookies from cookie store. 94 // Callback functions for getting cookies from cookie store.
85 void SendGetCookiesResponse(IPC::Message* reply_msg, 95 void SendGetCookiesResponse(IPC::Message* reply_msg,
86 const std::string& cookies); 96 const std::string& cookies);
87 97
98 void OnDownloadUrl(int render_view_id,
99 int render_frame_id,
100 const GURL& url,
101 const Referrer& referrer,
102 const base::string16& suggested_name);
103 void OnSaveImageFromDataURL(int render_view_id,
104 int render_frame_id,
105 const std::string& url_str);
106
88 void OnAre3DAPIsBlocked(int render_frame_id, 107 void OnAre3DAPIsBlocked(int render_frame_id,
89 const GURL& top_origin_url, 108 const GURL& top_origin_url,
90 ThreeDAPIType requester, 109 ThreeDAPIType requester,
91 bool* blocked); 110 bool* blocked);
92 111
93 void OnRenderProcessGone(); 112 void OnRenderProcessGone();
94 113
95 #if defined(ENABLE_PLUGINS) 114 #if defined(ENABLE_PLUGINS)
96 void OnGetPlugins(bool refresh, IPC::Message* reply_msg); 115 void OnGetPlugins(bool refresh, IPC::Message* reply_msg);
97 void GetPluginsCallback(IPC::Message* reply_msg, 116 void GetPluginsCallback(IPC::Message* reply_msg,
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 163
145 // Whether this process is used for incognito contents. 164 // Whether this process is used for incognito contents.
146 bool incognito_; 165 bool incognito_;
147 166
148 const int render_process_id_; 167 const int render_process_id_;
149 }; 168 };
150 169
151 } // namespace content 170 } // namespace content
152 171
153 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_ 172 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_FRAME_MESSAGE_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698