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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 // have to worry about thread-safety. | 191 // have to worry about thread-safety. |
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 base::WaitableEvent* waitable_event = |
| 202 new base::WaitableEvent(modal_dialog_event); |
201 RenderView::Create( | 203 RenderView::Create( |
202 this, parent_hwnd, modal_dialog_event, MSG_ROUTING_NONE, webkit_prefs, | 204 this, parent_hwnd, waitable_event, MSG_ROUTING_NONE, webkit_prefs, |
203 new SharedRenderViewCounter(0), view_id); | 205 new SharedRenderViewCounter(0), view_id); |
204 } | 206 } |
205 | 207 |
206 void RenderThread::OnSetCacheCapacities(size_t min_dead_capacity, | 208 void RenderThread::OnSetCacheCapacities(size_t min_dead_capacity, |
207 size_t max_dead_capacity, | 209 size_t max_dead_capacity, |
208 size_t capacity) { | 210 size_t capacity) { |
209 CacheManager::SetCapacities(min_dead_capacity, max_dead_capacity, capacity); | 211 CacheManager::SetCapacities(min_dead_capacity, max_dead_capacity, capacity); |
210 } | 212 } |
211 | 213 |
212 void RenderThread::OnGetCacheResourceStats() { | 214 void RenderThread::OnGetCacheResourceStats() { |
(...skipping 11 matching lines...) Expand all Loading... |
224 void RenderThread::InformHostOfCacheStatsLater() { | 226 void RenderThread::InformHostOfCacheStatsLater() { |
225 // Rate limit informing the host of our cache stats. | 227 // Rate limit informing the host of our cache stats. |
226 if (!cache_stats_factory_->empty()) | 228 if (!cache_stats_factory_->empty()) |
227 return; | 229 return; |
228 | 230 |
229 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 231 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
230 cache_stats_factory_->NewRunnableMethod( | 232 cache_stats_factory_->NewRunnableMethod( |
231 &RenderThread::InformHostOfCacheStats), | 233 &RenderThread::InformHostOfCacheStats), |
232 kCacheStatsDelayMS); | 234 kCacheStatsDelayMS); |
233 } | 235 } |
OLD | NEW |