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