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

Side by Side Diff: content/browser/renderer_host/render_message_filter.h

Issue 518693002: Fix a crash when saving a <canvas> or <img> image which is large. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CONTENT_EXPORT Created 6 years, 3 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 (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 #if defined(OS_WIN) 8 #if defined(OS_WIN)
9 #include <windows.h> 9 #include <windows.h>
10 #endif 10 #endif
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 class MediaInternals; 80 class MediaInternals;
81 class PluginServiceImpl; 81 class PluginServiceImpl;
82 class RenderWidgetHelper; 82 class RenderWidgetHelper;
83 class ResourceContext; 83 class ResourceContext;
84 class ResourceDispatcherHostImpl; 84 class ResourceDispatcherHostImpl;
85 struct Referrer; 85 struct Referrer;
86 struct WebPluginInfo; 86 struct WebPluginInfo;
87 87
88 // This class filters out incoming IPC messages for the renderer process on the 88 // This class filters out incoming IPC messages for the renderer process on the
89 // IPC thread. 89 // IPC thread.
90 class RenderMessageFilter : public BrowserMessageFilter { 90 class CONTENT_EXPORT RenderMessageFilter : public BrowserMessageFilter {
zino 2014/09/17 06:30:44 I think we should expose this class for using in u
91 public: 91 public:
92 // Create the filter. 92 // Create the filter.
93 RenderMessageFilter(int render_process_id, 93 RenderMessageFilter(int render_process_id,
94 PluginServiceImpl * plugin_service, 94 PluginServiceImpl * plugin_service,
95 BrowserContext* browser_context, 95 BrowserContext* browser_context,
96 net::URLRequestContextGetter* request_context, 96 net::URLRequestContextGetter* request_context,
97 RenderWidgetHelper* render_widget_helper, 97 RenderWidgetHelper* render_widget_helper,
98 media::AudioManager* audio_manager, 98 media::AudioManager* audio_manager,
99 MediaInternals* media_internals, 99 MediaInternals* media_internals,
100 DOMStorageContextWrapper* dom_storage_context); 100 DOMStorageContextWrapper* dom_storage_context);
(...skipping 10 matching lines...) Expand all
111 111
112 bool OffTheRecord() const; 112 bool OffTheRecord() const;
113 113
114 int render_process_id() const { return render_process_id_; } 114 int render_process_id() const { return render_process_id_; }
115 115
116 // Returns the correct net::CookieStore depending on what type of url is 116 // Returns the correct net::CookieStore depending on what type of url is
117 // given. 117 // given.
118 // Only call on the IO thread. 118 // Only call on the IO thread.
119 net::CookieStore* GetCookieStoreForURL(const GURL& url); 119 net::CookieStore* GetCookieStoreForURL(const GURL& url);
120 120
121 protected:
122 virtual ~RenderMessageFilter();
123
124 // This method will be overridden by TestSaveImageFromDataURL class for test.
125 virtual void DownloadUrl(int render_view_id,
126 const GURL& url,
127 const Referrer& referrer,
128 const base::string16& suggested_name,
129 const bool use_prompt) const;
130
121 private: 131 private:
122 friend class BrowserThread; 132 friend class BrowserThread;
123 friend class base::DeleteHelper<RenderMessageFilter>; 133 friend class base::DeleteHelper<RenderMessageFilter>;
124 134
125 class OpenChannelToNpapiPluginCallback; 135 class OpenChannelToNpapiPluginCallback;
126 136
127 virtual ~RenderMessageFilter();
128
129 void OnGetProcessMemorySizes(size_t* private_bytes, size_t* shared_bytes); 137 void OnGetProcessMemorySizes(size_t* private_bytes, size_t* shared_bytes);
130 void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params, 138 void OnCreateWindow(const ViewHostMsg_CreateWindow_Params& params,
131 int* route_id, 139 int* route_id,
132 int* main_frame_route_id, 140 int* main_frame_route_id,
133 int* surface_id, 141 int* surface_id,
134 int64* cloned_session_storage_namespace_id); 142 int64* cloned_session_storage_namespace_id);
135 void OnCreateWidget(int opener_id, 143 void OnCreateWidget(int opener_id,
136 blink::WebPopupType popup_type, 144 blink::WebPopupType popup_type,
137 int* route_id, 145 int* route_id,
138 int* surface_id); 146 int* surface_id);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 void OnDidDeleteOutOfProcessPepperInstance(int plugin_child_id, 202 void OnDidDeleteOutOfProcessPepperInstance(int plugin_child_id,
195 int32 pp_instance, 203 int32 pp_instance,
196 bool is_external); 204 bool is_external);
197 void OnOpenChannelToPpapiBroker(int routing_id, 205 void OnOpenChannelToPpapiBroker(int routing_id,
198 const base::FilePath& path); 206 const base::FilePath& path);
199 #endif // defined(ENABLE_PLUGINS) 207 #endif // defined(ENABLE_PLUGINS)
200 void OnGenerateRoutingID(int* route_id); 208 void OnGenerateRoutingID(int* route_id);
201 void OnDownloadUrl(int render_view_id, 209 void OnDownloadUrl(int render_view_id,
202 const GURL& url, 210 const GURL& url,
203 const Referrer& referrer, 211 const Referrer& referrer,
204 const base::string16& suggested_name, 212 const base::string16& suggested_name);
205 const bool use_prompt); 213 void OnSaveImageFromDataURL(int render_view_id, const std::string& url_str);
206 void OnCheckNotificationPermission(const GURL& source_origin, 214 void OnCheckNotificationPermission(const GURL& source_origin,
207 int* permission_level); 215 int* permission_level);
208 216
209 void OnGetCPUUsage(int* cpu_usage); 217 void OnGetCPUUsage(int* cpu_usage);
210 218
211 void OnGetAudioHardwareConfig(media::AudioParameters* input_params, 219 void OnGetAudioHardwareConfig(media::AudioParameters* input_params,
212 media::AudioParameters* output_params); 220 media::AudioParameters* output_params);
213 221
214 #if defined(OS_WIN) 222 #if defined(OS_WIN)
215 // Used to look up the monitor color profile. 223 // Used to look up the monitor color profile.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 #if defined(OS_MACOSX) 347 #if defined(OS_MACOSX)
340 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_; 348 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_;
341 #endif 349 #endif
342 350
343 DISALLOW_COPY_AND_ASSIGN(RenderMessageFilter); 351 DISALLOW_COPY_AND_ASSIGN(RenderMessageFilter);
344 }; 352 };
345 353
346 } // namespace content 354 } // namespace content
347 355
348 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_MESSAGE_FILTER_H_ 356 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_MESSAGE_FILTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698