| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <objbase.h> | 9 #include <objbase.h> |
| 10 #endif | 10 #endif |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "base/scoped_handle.h" | 25 #include "base/scoped_handle.h" |
| 26 #include "chrome/plugin/plugin_channel_base.h" | 26 #include "chrome/plugin/plugin_channel_base.h" |
| 27 #include "webkit/glue/weburlrequest.h" | 27 #include "webkit/glue/weburlrequest.h" |
| 28 #endif | 28 #endif |
| 29 #include "chrome/renderer/net/render_dns_master.h" | 29 #include "chrome/renderer/net/render_dns_master.h" |
| 30 #include "chrome/renderer/render_process.h" | 30 #include "chrome/renderer/render_process.h" |
| 31 #include "chrome/renderer/render_view.h" | 31 #include "chrome/renderer/render_view.h" |
| 32 #include "chrome/renderer/user_script_slave.h" | 32 #include "chrome/renderer/user_script_slave.h" |
| 33 #include "chrome/renderer/visitedlink_slave.h" | 33 #include "chrome/renderer/visitedlink_slave.h" |
| 34 #include "webkit/glue/cache_manager.h" | 34 #include "webkit/glue/cache_manager.h" |
| 35 #include "webkit/glue/webkit_client_impl.h" |
| 35 | 36 |
| 37 #include "WebKit.h" |
| 36 | 38 |
| 37 static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */; | 39 static const unsigned int kCacheStatsDelayMS = 2000 /* milliseconds */; |
| 38 | 40 |
| 39 // V8 needs a 1MB stack size. | 41 // V8 needs a 1MB stack size. |
| 40 static const size_t kStackSize = 1024 * 1024; | 42 static const size_t kStackSize = 1024 * 1024; |
| 41 | 43 |
| 42 //----------------------------------------------------------------------------- | 44 //----------------------------------------------------------------------------- |
| 43 // Methods below are only called on the owner's thread: | 45 // Methods below are only called on the owner's thread: |
| 44 | 46 |
| 45 // When we run plugins in process, we actually run them on the render thread, | 47 // When we run plugins in process, we actually run them on the render thread, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 ChildThread::Init(); | 94 ChildThread::Init(); |
| 93 notification_service_.reset(new NotificationService); | 95 notification_service_.reset(new NotificationService); |
| 94 cache_stats_factory_.reset( | 96 cache_stats_factory_.reset( |
| 95 new ScopedRunnableMethodFactory<RenderThread>(this)); | 97 new ScopedRunnableMethodFactory<RenderThread>(this)); |
| 96 | 98 |
| 97 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
| 98 // The renderer thread should wind-up COM. | 100 // The renderer thread should wind-up COM. |
| 99 CoInitialize(0); | 101 CoInitialize(0); |
| 100 #endif | 102 #endif |
| 101 | 103 |
| 104 webkit_client_impl_.reset(new webkit_glue::WebKitClientImpl); |
| 105 WebKit::initialize(webkit_client_impl_.get()); |
| 106 |
| 102 visited_link_slave_ = new VisitedLinkSlave(); | 107 visited_link_slave_ = new VisitedLinkSlave(); |
| 103 user_script_slave_ = new UserScriptSlave(); | 108 user_script_slave_ = new UserScriptSlave(); |
| 104 render_dns_master_.reset(new RenderDnsMaster()); | 109 render_dns_master_.reset(new RenderDnsMaster()); |
| 105 renderer_histogram_snapshots_.reset(new RendererHistogramSnapshots()); | 110 renderer_histogram_snapshots_.reset(new RendererHistogramSnapshots()); |
| 106 } | 111 } |
| 107 | 112 |
| 108 void RenderThread::CleanUp() { | 113 void RenderThread::CleanUp() { |
| 109 ChildThread::CleanUp(); | 114 ChildThread::CleanUp(); |
| 110 | 115 |
| 111 // TODO(port) | 116 // TODO(port) |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 void RenderThread::InformHostOfCacheStatsLater() { | 243 void RenderThread::InformHostOfCacheStatsLater() { |
| 239 // Rate limit informing the host of our cache stats. | 244 // Rate limit informing the host of our cache stats. |
| 240 if (!cache_stats_factory_->empty()) | 245 if (!cache_stats_factory_->empty()) |
| 241 return; | 246 return; |
| 242 | 247 |
| 243 MessageLoop::current()->PostDelayedTask(FROM_HERE, | 248 MessageLoop::current()->PostDelayedTask(FROM_HERE, |
| 244 cache_stats_factory_->NewRunnableMethod( | 249 cache_stats_factory_->NewRunnableMethod( |
| 245 &RenderThread::InformHostOfCacheStats), | 250 &RenderThread::InformHostOfCacheStats), |
| 246 kCacheStatsDelayMS); | 251 kCacheStatsDelayMS); |
| 247 } | 252 } |
| OLD | NEW |