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

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

Issue 2312633002: For debugging, split worker ref count into service worker and shared worker counts (Closed)
Patch Set: separate checks Created 4 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PROCESS_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 void NotifyTimezoneChange(const std::string& timezone) override; 166 void NotifyTimezoneChange(const std::string& timezone) override;
167 shell::InterfaceProvider* GetRemoteInterfaces() override; 167 shell::InterfaceProvider* GetRemoteInterfaces() override;
168 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() 168 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator()
169 override; 169 override;
170 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override; 170 const base::TimeTicks& GetInitTimeForNavigationMetrics() const override;
171 #if defined(ENABLE_BROWSER_CDMS) 171 #if defined(ENABLE_BROWSER_CDMS)
172 scoped_refptr<media::MediaKeys> GetCdm(int render_frame_id, 172 scoped_refptr<media::MediaKeys> GetCdm(int render_frame_id,
173 int cdm_id) const override; 173 int cdm_id) const override;
174 #endif 174 #endif
175 bool IsProcessBackgrounded() const override; 175 bool IsProcessBackgrounded() const override;
176 void IncrementWorkerRefCount() override; 176 void IncrementServiceWorkerRefCount() override;
177 void DecrementWorkerRefCount() override; 177 void DecrementServiceWorkerRefCount() override;
178 void IncrementSharedWorkerRefCount() override;
179 void DecrementSharedWorkerRefCount() override;
178 void PurgeAndSuspend() override; 180 void PurgeAndSuspend() override;
179 181
180 // IPC::Sender via RenderProcessHost. 182 // IPC::Sender via RenderProcessHost.
181 bool Send(IPC::Message* msg) override; 183 bool Send(IPC::Message* msg) override;
182 184
183 // IPC::Listener via RenderProcessHost. 185 // IPC::Listener via RenderProcessHost.
184 bool OnMessageReceived(const IPC::Message& msg) override; 186 bool OnMessageReceived(const IPC::Message& msg) override;
185 void OnChannelConnected(int32_t peer_pid) override; 187 void OnChannelConnected(int32_t peer_pid) override;
186 void OnChannelError() override; 188 void OnChannelError() override;
187 void OnBadMessageReceived(const IPC::Message& message) override; 189 void OnBadMessageReceived(const IPC::Message& message) override;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 // started to swap these in, so the renderer process should not exit if 307 // started to swap these in, so the renderer process should not exit if
306 // this count is non-zero. 308 // this count is non-zero.
307 int32_t pending_views_; 309 int32_t pending_views_;
308 310
309 private: 311 private:
310 friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test; 312 friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test;
311 friend class VisitRelayingRenderProcessHost; 313 friend class VisitRelayingRenderProcessHost;
312 class ConnectionFilterController; 314 class ConnectionFilterController;
313 class ConnectionFilterImpl; 315 class ConnectionFilterImpl;
314 316
317 int worker_ref_count() {
318 return service_worker_ref_count_ + shared_worker_ref_count_;
319 }
320
315 std::unique_ptr<IPC::ChannelProxy> CreateChannelProxy( 321 std::unique_ptr<IPC::ChannelProxy> CreateChannelProxy(
316 const std::string& channel_id); 322 const std::string& channel_id);
317 323
318 // Creates and adds the IO thread message filters. 324 // Creates and adds the IO thread message filters.
319 void CreateMessageFilters(); 325 void CreateMessageFilters();
320 326
321 // Registers Mojo interfaces to be exposed to the renderer. 327 // Registers Mojo interfaces to be exposed to the renderer.
322 void RegisterMojoInterfaces(); 328 void RegisterMojoInterfaces();
323 329
324 void CreateStoragePartitionService( 330 void CreateStoragePartitionService(
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 std::string child_token_; 416 std::string child_token_;
411 417
412 std::unique_ptr<MojoChildConnection> mojo_child_connection_; 418 std::unique_ptr<MojoChildConnection> mojo_child_connection_;
413 int connection_filter_id_ = MojoShellConnection::kInvalidConnectionFilterId; 419 int connection_filter_id_ = MojoShellConnection::kInvalidConnectionFilterId;
414 scoped_refptr<ConnectionFilterController> connection_filter_controller_; 420 scoped_refptr<ConnectionFilterController> connection_filter_controller_;
415 shell::mojom::ServicePtr test_service_; 421 shell::mojom::ServicePtr test_service_;
416 #if defined(OS_ANDROID) 422 #if defined(OS_ANDROID)
417 std::unique_ptr<InterfaceRegistryAndroid> interface_registry_android_; 423 std::unique_ptr<InterfaceRegistryAndroid> interface_registry_android_;
418 #endif 424 #endif
419 425
426 int service_worker_ref_count_;
jochen (gone - plz use gerrit) 2016/09/05 09:45:15 what about making them size_t while touching this?
falken 2016/09/05 12:06:45 Done.
427 int shared_worker_ref_count_;
428
420 // The registered IPC listener objects. When this list is empty, we should 429 // The registered IPC listener objects. When this list is empty, we should
421 // delete ourselves. 430 // delete ourselves.
422 IDMap<IPC::Listener> listeners_; 431 IDMap<IPC::Listener> listeners_;
423 432
424 // The count of currently visible widgets. Since the host can be a container 433 // The count of currently visible widgets. Since the host can be a container
425 // for multiple widgets, it uses this count to determine when it should be 434 // for multiple widgets, it uses this count to determine when it should be
426 // backgrounded. 435 // backgrounded.
427 int32_t visible_widgets_; 436 int32_t visible_widgets_;
428 437
429 // Whether this process currently has backgrounded priority. Tracked so that 438 // Whether this process currently has backgrounded priority. Tracked so that
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 540
532 WebRTCEventLogHost webrtc_eventlog_host_; 541 WebRTCEventLogHost webrtc_eventlog_host_;
533 #endif 542 #endif
534 543
535 // Forwards messages between WebRTCInternals in the browser process 544 // Forwards messages between WebRTCInternals in the browser process
536 // and PeerConnectionTracker in the renderer process. 545 // and PeerConnectionTracker in the renderer process.
537 // It holds a raw pointer to webrtc_eventlog_host_, and therefore should be 546 // It holds a raw pointer to webrtc_eventlog_host_, and therefore should be
538 // defined below it so it is destructed first. 547 // defined below it so it is destructed first.
539 scoped_refptr<PeerConnectionTrackerHost> peer_connection_tracker_host_; 548 scoped_refptr<PeerConnectionTrackerHost> peer_connection_tracker_host_;
540 549
541 int worker_ref_count_;
542
543 // Records the time when the process starts surviving for workers for UMA. 550 // Records the time when the process starts surviving for workers for UMA.
544 base::TimeTicks survive_for_worker_start_time_; 551 base::TimeTicks survive_for_worker_start_time_;
545 552
546 // Records the maximum # of workers simultaneously hosted in this process 553 // Records the maximum # of workers simultaneously hosted in this process
547 // for UMA. 554 // for UMA.
548 int max_worker_count_; 555 int max_worker_count_;
549 556
550 // Context shared for each mojom::PermissionService instance created for this 557 // Context shared for each mojom::PermissionService instance created for this
551 // RPH. 558 // RPH.
552 std::unique_ptr<PermissionServiceContext> permission_service_context_; 559 std::unique_ptr<PermissionServiceContext> permission_service_context_;
(...skipping 21 matching lines...) Expand all
574 instance_weak_factory_; 581 instance_weak_factory_;
575 582
576 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 583 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
577 584
578 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 585 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
579 }; 586 };
580 587
581 } // namespace content 588 } // namespace content
582 589
583 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_ 590 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_process_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698