OLD | NEW |
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 #include "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 | 1599 |
1600 bool handled = true; | 1600 bool handled = true; |
1601 IPC_BEGIN_MESSAGE_MAP(RenderThreadImpl, msg) | 1601 IPC_BEGIN_MESSAGE_MAP(RenderThreadImpl, msg) |
1602 IPC_MESSAGE_HANDLER(FrameMsg_NewFrame, OnCreateNewFrame) | 1602 IPC_MESSAGE_HANDLER(FrameMsg_NewFrame, OnCreateNewFrame) |
1603 IPC_MESSAGE_HANDLER(FrameMsg_NewFrameProxy, OnCreateNewFrameProxy) | 1603 IPC_MESSAGE_HANDLER(FrameMsg_NewFrameProxy, OnCreateNewFrameProxy) |
1604 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentURL, | 1604 IPC_MESSAGE_HANDLER(ViewMsg_SetZoomLevelForCurrentURL, |
1605 OnSetZoomLevelForCurrentURL) | 1605 OnSetZoomLevelForCurrentURL) |
1606 // TODO(port): removed from render_messages_internal.h; | 1606 // TODO(port): removed from render_messages_internal.h; |
1607 // is there a new non-windows message I should add here? | 1607 // is there a new non-windows message I should add here? |
1608 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) | 1608 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) |
1609 IPC_MESSAGE_HANDLER(ViewMsg_NetworkTypeChanged, OnNetworkTypeChanged) | 1609 IPC_MESSAGE_HANDLER(ViewMsg_NetworkConnectionChanged, |
| 1610 OnNetworkConnectionChanged) |
1610 IPC_MESSAGE_HANDLER(WorkerProcessMsg_CreateWorker, OnCreateNewSharedWorker) | 1611 IPC_MESSAGE_HANDLER(WorkerProcessMsg_CreateWorker, OnCreateNewSharedWorker) |
1611 IPC_MESSAGE_HANDLER(ViewMsg_TimezoneChange, OnUpdateTimezone) | 1612 IPC_MESSAGE_HANDLER(ViewMsg_TimezoneChange, OnUpdateTimezone) |
1612 #if defined(OS_ANDROID) | 1613 #if defined(OS_ANDROID) |
1613 IPC_MESSAGE_HANDLER(ViewMsg_SetWebKitSharedTimersSuspended, | 1614 IPC_MESSAGE_HANDLER(ViewMsg_SetWebKitSharedTimersSuspended, |
1614 OnSetWebKitSharedTimersSuspended) | 1615 OnSetWebKitSharedTimersSuspended) |
1615 #endif | 1616 #endif |
1616 #if defined(OS_MACOSX) | 1617 #if defined(OS_MACOSX) |
1617 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScrollbarTheme, OnUpdateScrollbarTheme) | 1618 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScrollbarTheme, OnUpdateScrollbarTheme) |
1618 #endif | 1619 #endif |
1619 #if defined(ENABLE_PLUGINS) | 1620 #if defined(ENABLE_PLUGINS) |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1754 // refresh temporarily to prevent each renderer process causing the list to be | 1755 // refresh temporarily to prevent each renderer process causing the list to be |
1755 // regenerated. | 1756 // regenerated. |
1756 blink_platform_impl_->set_plugin_refresh_allowed(false); | 1757 blink_platform_impl_->set_plugin_refresh_allowed(false); |
1757 blink::resetPluginCache(reload_pages); | 1758 blink::resetPluginCache(reload_pages); |
1758 blink_platform_impl_->set_plugin_refresh_allowed(true); | 1759 blink_platform_impl_->set_plugin_refresh_allowed(true); |
1759 | 1760 |
1760 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, PluginListChanged()); | 1761 FOR_EACH_OBSERVER(RenderProcessObserver, observers_, PluginListChanged()); |
1761 } | 1762 } |
1762 #endif | 1763 #endif |
1763 | 1764 |
1764 void RenderThreadImpl::OnNetworkTypeChanged( | 1765 void RenderThreadImpl::OnNetworkConnectionChanged( |
1765 net::NetworkChangeNotifier::ConnectionType type) { | 1766 net::NetworkChangeNotifier::ConnectionType type, |
| 1767 double max_bandwidth_mbps) { |
1766 EnsureWebKitInitialized(); | 1768 EnsureWebKitInitialized(); |
1767 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; | 1769 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; |
1768 WebNetworkStateNotifier::setOnLine(online); | 1770 WebNetworkStateNotifier::setOnLine(online); |
1769 FOR_EACH_OBSERVER( | 1771 FOR_EACH_OBSERVER( |
1770 RenderProcessObserver, observers_, NetworkStateChanged(online)); | 1772 RenderProcessObserver, observers_, NetworkStateChanged(online)); |
1771 WebNetworkStateNotifier::setWebConnectionType( | 1773 WebNetworkStateNotifier::setWebConnection( |
1772 NetConnectionTypeToWebConnectionType(type)); | 1774 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps); |
1773 } | 1775 } |
1774 | 1776 |
1775 void RenderThreadImpl::OnUpdateTimezone(const std::string& zone_id) { | 1777 void RenderThreadImpl::OnUpdateTimezone(const std::string& zone_id) { |
1776 if (!blink_platform_impl_) | 1778 if (!blink_platform_impl_) |
1777 return; | 1779 return; |
1778 if (!zone_id.empty()) { | 1780 if (!zone_id.empty()) { |
1779 icu::TimeZone *new_zone = icu::TimeZone::createTimeZone( | 1781 icu::TimeZone *new_zone = icu::TimeZone::createTimeZone( |
1780 icu::UnicodeString::fromUTF8(zone_id)); | 1782 icu::UnicodeString::fromUTF8(zone_id)); |
1781 icu::TimeZone::adoptDefault(new_zone); | 1783 icu::TimeZone::adoptDefault(new_zone); |
1782 VLOG(1) << "ICU default timezone is set to " << zone_id; | 1784 VLOG(1) << "ICU default timezone is set to " << zone_id; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1967 } | 1969 } |
1968 | 1970 |
1969 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1971 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
1970 size_t erased = | 1972 size_t erased = |
1971 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1973 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
1972 routing_id_); | 1974 routing_id_); |
1973 DCHECK_EQ(1u, erased); | 1975 DCHECK_EQ(1u, erased); |
1974 } | 1976 } |
1975 | 1977 |
1976 } // namespace content | 1978 } // namespace content |
OLD | NEW |