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

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

Issue 305103003: Fix for 'Simple Adblock' extension crashes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderProcessHost can be a mock in unittests Created 6 years, 6 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 | Annotate | Revision Log
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_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <string> 10 #include <string>
11 11
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "base/process/process.h" 14 #include "base/process/process.h"
15 #include "base/timer/timer.h" 15 #include "base/timer/timer.h"
16 #include "content/browser/child_process_launcher.h" 16 #include "content/browser/child_process_launcher.h"
17 #include "content/browser/power_monitor_message_broadcaster.h" 17 #include "content/browser/power_monitor_message_broadcaster.h"
18 #include "content/common/content_export.h" 18 #include "content/common/content_export.h"
19 #include "content/public/browser/gpu_data_manager_observer.h" 19 #include "content/public/browser/gpu_data_manager_observer.h"
20 #include "content/public/browser/navigation_controller.h"
20 #include "content/public/browser/render_process_host.h" 21 #include "content/public/browser/render_process_host.h"
21 #include "ipc/ipc_channel_proxy.h" 22 #include "ipc/ipc_channel_proxy.h"
22 #include "ipc/ipc_platform_file.h" 23 #include "ipc/ipc_platform_file.h"
23 #include "mojo/public/cpp/bindings/interface_ptr.h" 24 #include "mojo/public/cpp/bindings/interface_ptr.h"
24 25
25 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; 26 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params;
26 27
27 namespace base { 28 namespace base {
28 class CommandLine; 29 class CommandLine;
29 class MessageLoop; 30 class MessageLoop;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void EndFrameSubscription(int route_id); 164 void EndFrameSubscription(int route_id);
164 165
165 #if defined(ENABLE_WEBRTC) 166 #if defined(ENABLE_WEBRTC)
166 // Fires the webrtc log message callback with |message|, if callback is set. 167 // Fires the webrtc log message callback with |message|, if callback is set.
167 void WebRtcLogMessage(const std::string& message); 168 void WebRtcLogMessage(const std::string& message);
168 #endif 169 #endif
169 170
170 scoped_refptr<ScreenOrientationDispatcherHost> 171 scoped_refptr<ScreenOrientationDispatcherHost>
171 screen_orientation_dispatcher_host() const; 172 screen_orientation_dispatcher_host() const;
172 173
174 // Used to extend the lifetime of the sessions until the render view
175 // in the renderer is fully closed.
176 void ReleaseOnCloseAck(const SessionStorageNamespaceMap& sessions,
177 int view_route_id);
178
173 // Register/unregister the host identified by the host id in the global host 179 // Register/unregister the host identified by the host id in the global host
174 // list. 180 // list.
175 static void RegisterHost(int host_id, RenderProcessHost* host); 181 static void RegisterHost(int host_id, RenderProcessHost* host);
176 static void UnregisterHost(int host_id); 182 static void UnregisterHost(int host_id);
177 183
178 // Implementation of FilterURL below that can be shared with the mock class. 184 // Implementation of FilterURL below that can be shared with the mock class.
179 static void FilterURL(RenderProcessHost* rph, bool empty_allowed, GURL* url); 185 static void FilterURL(RenderProcessHost* rph, bool empty_allowed, GURL* url);
180 186
181 // Returns true if |host| is suitable for launching a new view with |site_url| 187 // Returns true if |host| is suitable for launching a new view with |site_url|
182 // in the given |browser_context|. 188 // in the given |browser_context|.
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 279
274 // Creates and adds the IO thread message filters. 280 // Creates and adds the IO thread message filters.
275 void CreateMessageFilters(); 281 void CreateMessageFilters();
276 282
277 // Control message handlers. 283 // Control message handlers.
278 void OnShutdownRequest(); 284 void OnShutdownRequest();
279 void OnDumpHandlesDone(); 285 void OnDumpHandlesDone();
280 void SuddenTerminationChanged(bool enabled); 286 void SuddenTerminationChanged(bool enabled);
281 void OnUserMetricsRecordAction(const std::string& action); 287 void OnUserMetricsRecordAction(const std::string& action);
282 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size); 288 void OnSavedPageAsMHTML(int job_id, int64 mhtml_file_size);
289 void OnCloseACK(int old_route_id);
283 290
284 // CompositorSurfaceBuffersSwapped handler when there's no RWH. 291 // CompositorSurfaceBuffersSwapped handler when there's no RWH.
285 void OnCompositorSurfaceBuffersSwappedNoHost( 292 void OnCompositorSurfaceBuffersSwappedNoHost(
286 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params); 293 const ViewHostMsg_CompositorSurfaceBuffersSwapped_Params& params);
287 294
288 // Generates a command line to be used to spawn a renderer and appends the 295 // Generates a command line to be used to spawn a renderer and appends the
289 // results to |*command_line|. 296 // results to |*command_line|.
290 void AppendRendererCommandLine(base::CommandLine* command_line) const; 297 void AppendRendererCommandLine(base::CommandLine* command_line) const;
291 298
292 // Copies applicable command line switches from the given |browser_cmd| line 299 // Copies applicable command line switches from the given |browser_cmd| line
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 #endif 423 #endif
417 424
418 // Message filter and dispatcher for screen orientation. 425 // Message filter and dispatcher for screen orientation.
419 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_; 426 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_;
420 427
421 int worker_ref_count_; 428 int worker_ref_count_;
422 429
423 // Records the time when the process starts surviving for workers for UMA. 430 // Records the time when the process starts surviving for workers for UMA.
424 base::TimeTicks survive_for_worker_start_time_; 431 base::TimeTicks survive_for_worker_start_time_;
425 432
433 std::map<int, SessionStorageNamespaceMap>
434 session_storage_namespaces_awaiting_close_;
435
426 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 436 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
427 437
428 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 438 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
429 }; 439 };
430 440
431 } // namespace content 441 } // namespace content
432 442
433 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 443 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698