OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <windows.h> | 5 #include <windows.h> |
6 #include <algorithm> | 6 #include <algorithm> |
7 | 7 |
8 #include "chrome/renderer/render_thread.h" | 8 #include "chrome/renderer/render_thread.h" |
9 | 9 |
10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 void RenderThread::AddFilter(IPC::ChannelProxy::MessageFilter* filter) { | 65 void RenderThread::AddFilter(IPC::ChannelProxy::MessageFilter* filter) { |
66 channel_->AddFilter(filter); | 66 channel_->AddFilter(filter); |
67 } | 67 } |
68 | 68 |
69 void RenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { | 69 void RenderThread::RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) { |
70 channel_->RemoveFilter(filter); | 70 channel_->RemoveFilter(filter); |
71 } | 71 } |
72 | 72 |
73 void RenderThread::Resolve(const char* name, size_t length) { | 73 void RenderThread::Resolve(const char* name, size_t length) { |
74 return render_dns_master_->Resolve(name, length); | 74 return render_dns_master_->Resolve(name, length); |
75 } | 75 } |
76 | 76 |
77 void RenderThread::AddRoute(int32 routing_id, | 77 void RenderThread::AddRoute(int32 routing_id, |
78 IPC::Channel::Listener* listener) { | 78 IPC::Channel::Listener* listener) { |
79 DCHECK(MessageLoop::current() == message_loop()); | 79 DCHECK(MessageLoop::current() == message_loop()); |
80 | 80 |
81 // This corresponds to the AddRoute call done in CreateView. | 81 // This corresponds to the AddRoute call done in CreateView. |
82 router_.AddRoute(routing_id, listener); | 82 router_.AddRoute(routing_id, listener); |
83 } | 83 } |
84 | 84 |
85 void RenderThread::RemoveRoute(int32 routing_id) { | 85 void RenderThread::RemoveRoute(int32 routing_id) { |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 RenderView::SetNextPageID(next_page_id); | 192 RenderView::SetNextPageID(next_page_id); |
193 } | 193 } |
194 | 194 |
195 void RenderThread::OnCreateNewView(HWND parent_hwnd, | 195 void RenderThread::OnCreateNewView(HWND parent_hwnd, |
196 HANDLE modal_dialog_event, | 196 HANDLE modal_dialog_event, |
197 const WebPreferences& webkit_prefs, | 197 const WebPreferences& webkit_prefs, |
198 int32 view_id) { | 198 int32 view_id) { |
199 // TODO(darin): once we have a RenderThread per RenderView, this will need to | 199 // TODO(darin): once we have a RenderThread per RenderView, this will need to |
200 // change to assert that we are not creating more than one view. | 200 // change to assert that we are not creating more than one view. |
201 RenderView::Create( | 201 RenderView::Create( |
202 parent_hwnd, modal_dialog_event, MSG_ROUTING_NONE, webkit_prefs, | 202 this, parent_hwnd, modal_dialog_event, MSG_ROUTING_NONE, webkit_prefs, |
203 new SharedRenderViewCounter(0), view_id); | 203 new SharedRenderViewCounter(0), view_id); |
204 } | 204 } |
205 | 205 |
206 void RenderThread::OnSetCacheCapacities(size_t min_dead_capacity, | 206 void RenderThread::OnSetCacheCapacities(size_t min_dead_capacity, |
207 size_t max_dead_capacity, | 207 size_t max_dead_capacity, |
208 size_t capacity) { | 208 size_t capacity) { |
209 CacheManager::SetCapacities(min_dead_capacity, max_dead_capacity, capacity); | 209 CacheManager::SetCapacities(min_dead_capacity, max_dead_capacity, capacity); |
210 } | 210 } |
211 | 211 |
212 void RenderThread::OnGetCacheResourceStats() { | 212 void RenderThread::OnGetCacheResourceStats() { |
(...skipping 11 matching lines...) Expand all Loading... |
224 void RenderThread::InformHostOfCacheStatsLater() { | 224 void RenderThread::InformHostOfCacheStatsLater() { |
225 // Rate limit informing the host of our cache stats. | 225 // Rate limit informing the host of our cache stats. |
226 if (!cache_stats_factory_->empty()) | 226 if (!cache_stats_factory_->empty()) |
227 return; | 227 return; |
228 | 228 |
229 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 229 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
230 cache_stats_factory_->NewRunnableMethod( | 230 cache_stats_factory_->NewRunnableMethod( |
231 &RenderThread::InformHostOfCacheStats), | 231 &RenderThread::InformHostOfCacheStats), |
232 kCacheStatsDelayMS); | 232 kCacheStatsDelayMS); |
233 } | 233 } |
OLD | NEW |