| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // Represents the browser side of the browser <--> renderer communication | 5 // Represents the browser side of the browser <--> renderer communication |
| 6 // channel. There will be one RenderProcessHost per renderer process. | 6 // channel. There will be one RenderProcessHost per renderer process. |
| 7 | 7 |
| 8 #include "content/browser/renderer_host/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2638 | 2638 |
| 2639 void RenderProcessHostImpl::OnCloseACK(int old_route_id) { | 2639 void RenderProcessHostImpl::OnCloseACK(int old_route_id) { |
| 2640 SessionStorageHolder* holder = | 2640 SessionStorageHolder* holder = |
| 2641 static_cast<SessionStorageHolder*>(GetUserData(kSessionStorageHolderKey)); | 2641 static_cast<SessionStorageHolder*>(GetUserData(kSessionStorageHolderKey)); |
| 2642 if (!holder) | 2642 if (!holder) |
| 2643 return; | 2643 return; |
| 2644 holder->Release(old_route_id); | 2644 holder->Release(old_route_id); |
| 2645 } | 2645 } |
| 2646 | 2646 |
| 2647 void RenderProcessHostImpl::OnGpuSwitched() { | 2647 void RenderProcessHostImpl::OnGpuSwitched() { |
| 2648 // We are updating all widgets including swapped out ones. | 2648 RecomputeAndUpdateWebKitPreferences(); |
| 2649 scoped_ptr<RenderWidgetHostIterator> widgets( | |
| 2650 RenderWidgetHostImpl::GetAllRenderWidgetHosts()); | |
| 2651 while (RenderWidgetHost* widget = widgets->GetNextHost()) { | |
| 2652 RenderViewHost* rvh = RenderViewHost::From(widget); | |
| 2653 if (!rvh) | |
| 2654 continue; | |
| 2655 | |
| 2656 // Skip widgets in other processes. | |
| 2657 if (rvh->GetProcess()->GetID() != GetID()) | |
| 2658 continue; | |
| 2659 | |
| 2660 rvh->OnWebkitPreferencesChanged(); | |
| 2661 } | |
| 2662 } | 2649 } |
| 2663 | 2650 |
| 2664 #if defined(ENABLE_WEBRTC) | 2651 #if defined(ENABLE_WEBRTC) |
| 2665 void RenderProcessHostImpl::OnRegisterAecDumpConsumer(int id) { | 2652 void RenderProcessHostImpl::OnRegisterAecDumpConsumer(int id) { |
| 2666 BrowserThread::PostTask( | 2653 BrowserThread::PostTask( |
| 2667 BrowserThread::UI, FROM_HERE, | 2654 BrowserThread::UI, FROM_HERE, |
| 2668 base::Bind(&RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread, | 2655 base::Bind(&RenderProcessHostImpl::RegisterAecDumpConsumerOnUIThread, |
| 2669 weak_factory_.GetWeakPtr(), id)); | 2656 weak_factory_.GetWeakPtr(), id)); |
| 2670 } | 2657 } |
| 2671 | 2658 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2795 | 2782 |
| 2796 void RenderProcessHostImpl::GetAudioOutputControllers( | 2783 void RenderProcessHostImpl::GetAudioOutputControllers( |
| 2797 const GetAudioOutputControllersCallback& callback) const { | 2784 const GetAudioOutputControllersCallback& callback) const { |
| 2798 audio_renderer_host()->GetOutputControllers(callback); | 2785 audio_renderer_host()->GetOutputControllers(callback); |
| 2799 } | 2786 } |
| 2800 | 2787 |
| 2801 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { | 2788 BluetoothDispatcherHost* RenderProcessHostImpl::GetBluetoothDispatcherHost() { |
| 2802 return bluetooth_dispatcher_host_.get(); | 2789 return bluetooth_dispatcher_host_.get(); |
| 2803 } | 2790 } |
| 2804 | 2791 |
| 2792 void RenderProcessHostImpl::RecomputeAndUpdateWebKitPreferences() { |
| 2793 // We are updating all widgets including swapped out ones. |
| 2794 scoped_ptr<RenderWidgetHostIterator> widgets( |
| 2795 RenderWidgetHostImpl::GetAllRenderWidgetHosts()); |
| 2796 while (RenderWidgetHost* widget = widgets->GetNextHost()) { |
| 2797 RenderViewHost* rvh = RenderViewHost::From(widget); |
| 2798 if (!rvh) |
| 2799 continue; |
| 2800 |
| 2801 // Skip widgets in other processes. |
| 2802 if (rvh->GetProcess()->GetID() != GetID()) |
| 2803 continue; |
| 2804 |
| 2805 rvh->OnWebkitPreferencesChanged(); |
| 2806 } |
| 2807 } |
| 2808 |
| 2805 } // namespace content | 2809 } // namespace content |
| OLD | NEW |