| 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 <utility> | 10 #include <utility> |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 | 848 |
| 849 GetContentClient()->renderer()->ExposeInterfacesToBrowser( | 849 GetContentClient()->renderer()->ExposeInterfacesToBrowser( |
| 850 GetInterfaceRegistry()); | 850 GetInterfaceRegistry()); |
| 851 | 851 |
| 852 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); | 852 GetInterfaceRegistry()->AddInterface(base::Bind(CreateFrameFactory)); |
| 853 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); | 853 GetInterfaceRegistry()->AddInterface(base::Bind(CreateEmbeddedWorkerSetup)); |
| 854 | 854 |
| 855 GetRemoteInterfaces()->GetInterface( | 855 GetRemoteInterfaces()->GetInterface( |
| 856 mojo::GetProxy(&storage_partition_service_)); | 856 mojo::GetProxy(&storage_partition_service_)); |
| 857 | 857 |
| 858 GetRemoteInterfaces()->GetInterface(mojo::GetProxy(&time_zone_monitor_)); |
| 859 time_zone_monitor_->QueryNextTimeZoneChange( |
| 860 base::Bind(&RenderThreadImpl::OnUpdateTimezone, base::Unretained(this))); |
| 861 |
| 858 is_renderer_suspended_ = false; | 862 is_renderer_suspended_ = false; |
| 859 } | 863 } |
| 860 | 864 |
| 861 RenderThreadImpl::~RenderThreadImpl() { | 865 RenderThreadImpl::~RenderThreadImpl() { |
| 862 } | 866 } |
| 863 | 867 |
| 864 void RenderThreadImpl::Shutdown() { | 868 void RenderThreadImpl::Shutdown() { |
| 865 FOR_EACH_OBSERVER( | 869 FOR_EACH_OBSERVER( |
| 866 RenderThreadObserver, observers_, OnRenderProcessShutdown()); | 870 RenderThreadObserver, observers_, OnRenderProcessShutdown()); |
| 867 | 871 |
| (...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 bool handled = true; | 1648 bool handled = true; |
| 1645 IPC_BEGIN_MESSAGE_MAP(RenderThreadImpl, msg) | 1649 IPC_BEGIN_MESSAGE_MAP(RenderThreadImpl, msg) |
| 1646 IPC_MESSAGE_HANDLER(FrameMsg_NewFrame, OnCreateNewFrame) | 1650 IPC_MESSAGE_HANDLER(FrameMsg_NewFrame, OnCreateNewFrame) |
| 1647 IPC_MESSAGE_HANDLER(FrameMsg_NewFrameProxy, OnCreateNewFrameProxy) | 1651 IPC_MESSAGE_HANDLER(FrameMsg_NewFrameProxy, OnCreateNewFrameProxy) |
| 1648 // TODO(port): removed from render_messages_internal.h; | 1652 // TODO(port): removed from render_messages_internal.h; |
| 1649 // is there a new non-windows message I should add here? | 1653 // is there a new non-windows message I should add here? |
| 1650 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) | 1654 IPC_MESSAGE_HANDLER(ViewMsg_New, OnCreateNewView) |
| 1651 IPC_MESSAGE_HANDLER(ViewMsg_NetworkConnectionChanged, | 1655 IPC_MESSAGE_HANDLER(ViewMsg_NetworkConnectionChanged, |
| 1652 OnNetworkConnectionChanged) | 1656 OnNetworkConnectionChanged) |
| 1653 IPC_MESSAGE_HANDLER(WorkerProcessMsg_CreateWorker, OnCreateNewSharedWorker) | 1657 IPC_MESSAGE_HANDLER(WorkerProcessMsg_CreateWorker, OnCreateNewSharedWorker) |
| 1654 IPC_MESSAGE_HANDLER(ViewMsg_TimezoneChange, OnUpdateTimezone) | |
| 1655 #if defined(OS_ANDROID) | 1658 #if defined(OS_ANDROID) |
| 1656 IPC_MESSAGE_HANDLER(ViewMsg_SetWebKitSharedTimersSuspended, | 1659 IPC_MESSAGE_HANDLER(ViewMsg_SetWebKitSharedTimersSuspended, |
| 1657 OnSetWebKitSharedTimersSuspended) | 1660 OnSetWebKitSharedTimersSuspended) |
| 1658 #endif | 1661 #endif |
| 1659 #if defined(OS_MACOSX) | 1662 #if defined(OS_MACOSX) |
| 1660 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScrollbarTheme, OnUpdateScrollbarTheme) | 1663 IPC_MESSAGE_HANDLER(ViewMsg_UpdateScrollbarTheme, OnUpdateScrollbarTheme) |
| 1661 IPC_MESSAGE_HANDLER(ViewMsg_SystemColorsChanged, OnSystemColorsChanged) | 1664 IPC_MESSAGE_HANDLER(ViewMsg_SystemColorsChanged, OnSystemColorsChanged) |
| 1662 #endif | 1665 #endif |
| 1663 #if defined(ENABLE_PLUGINS) | 1666 #if defined(ENABLE_PLUGINS) |
| 1664 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, OnPurgePluginListCache) | 1667 IPC_MESSAGE_HANDLER(ViewMsg_PurgePluginListCache, OnPurgePluginListCache) |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 double max_bandwidth_mbps) { | 1970 double max_bandwidth_mbps) { |
| 1968 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; | 1971 bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; |
| 1969 WebNetworkStateNotifier::setOnLine(online); | 1972 WebNetworkStateNotifier::setOnLine(online); |
| 1970 FOR_EACH_OBSERVER( | 1973 FOR_EACH_OBSERVER( |
| 1971 RenderThreadObserver, observers_, NetworkStateChanged(online)); | 1974 RenderThreadObserver, observers_, NetworkStateChanged(online)); |
| 1972 WebNetworkStateNotifier::setWebConnection( | 1975 WebNetworkStateNotifier::setWebConnection( |
| 1973 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps); | 1976 NetConnectionTypeToWebConnectionType(type), max_bandwidth_mbps); |
| 1974 } | 1977 } |
| 1975 | 1978 |
| 1976 void RenderThreadImpl::OnUpdateTimezone(const std::string& zone_id) { | 1979 void RenderThreadImpl::OnUpdateTimezone(const std::string& zone_id) { |
| 1980 time_zone_monitor_->QueryNextTimeZoneChange( |
| 1981 base::Bind(&RenderThreadImpl::OnUpdateTimezone, base::Unretained(this))); |
| 1982 |
| 1977 if (!blink_platform_impl_) | 1983 if (!blink_platform_impl_) |
| 1978 return; | 1984 return; |
| 1979 if (!zone_id.empty()) { | 1985 if (!zone_id.empty()) { |
| 1980 icu::TimeZone *new_zone = icu::TimeZone::createTimeZone( | 1986 icu::TimeZone *new_zone = icu::TimeZone::createTimeZone( |
| 1981 icu::UnicodeString::fromUTF8(zone_id)); | 1987 icu::UnicodeString::fromUTF8(zone_id)); |
| 1982 icu::TimeZone::adoptDefault(new_zone); | 1988 icu::TimeZone::adoptDefault(new_zone); |
| 1983 VLOG(1) << "ICU default timezone is set to " << zone_id; | 1989 VLOG(1) << "ICU default timezone is set to " << zone_id; |
| 1984 } | 1990 } |
| 1985 NotifyTimezoneChange(); | 1991 NotifyTimezoneChange(); |
| 1986 } | 1992 } |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2227 if (blink::mainThreadIsolate()) { | 2233 if (blink::mainThreadIsolate()) { |
| 2228 blink::mainThreadIsolate()->MemoryPressureNotification( | 2234 blink::mainThreadIsolate()->MemoryPressureNotification( |
| 2229 v8::MemoryPressureLevel::kCritical); | 2235 v8::MemoryPressureLevel::kCritical); |
| 2230 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2236 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
| 2231 v8::MemoryPressureLevel::kCritical); | 2237 v8::MemoryPressureLevel::kCritical); |
| 2232 } | 2238 } |
| 2233 } | 2239 } |
| 2234 | 2240 |
| 2235 | 2241 |
| 2236 } // namespace content | 2242 } // namespace content |
| OLD | NEW |