Chromium Code Reviews| 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 "chrome/renderer/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 | 93 |
| 94 void RenderThread::SendHistograms() { | 94 void RenderThread::SendHistograms() { |
| 95 return histogram_snapshots_->SendHistograms(); | 95 return histogram_snapshots_->SendHistograms(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 static WebAppCacheContext* CreateAppCacheContextForRenderer() { | 98 static WebAppCacheContext* CreateAppCacheContextForRenderer() { |
| 99 return new AppCacheContextImpl(RenderThread::current()); | 99 return new AppCacheContextImpl(RenderThread::current()); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void RenderThread::Init() { | 102 void RenderThread::Init() { |
| 103 // TODO(darin): Why do we need COM here? This is probably bogus. Perhaps | |
| 104 // this is for InProcessPlugin support? | |
| 105 #if defined(OS_WIN) | 103 #if defined(OS_WIN) |
| 106 // The renderer thread should wind-up COM. | 104 // The renderer thread should wind-up COM, if not in the sandbox. |
|
jam
2009/04/16 03:31:40
nit: I would make the comment (and the one below)
| |
| 107 CoInitialize(0); | 105 if (RenderProcess::InProcessPlugins()) |
| 106 CoInitialize(0); | |
| 108 #endif | 107 #endif |
| 109 | 108 |
| 110 ChildThread::Init(); | 109 ChildThread::Init(); |
| 111 notification_service_.reset(new NotificationService); | 110 notification_service_.reset(new NotificationService); |
| 112 cache_stats_factory_.reset( | 111 cache_stats_factory_.reset( |
| 113 new ScopedRunnableMethodFactory<RenderThread>(this)); | 112 new ScopedRunnableMethodFactory<RenderThread>(this)); |
| 114 | 113 |
| 115 visited_link_slave_.reset(new VisitedLinkSlave()); | 114 visited_link_slave_.reset(new VisitedLinkSlave()); |
| 116 user_script_slave_.reset(new UserScriptSlave()); | 115 user_script_slave_.reset(new UserScriptSlave()); |
| 117 dns_master_.reset(new RenderDnsMaster()); | 116 dns_master_.reset(new RenderDnsMaster()); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 136 } | 135 } |
| 137 | 136 |
| 138 notification_service_.reset(); | 137 notification_service_.reset(); |
| 139 | 138 |
| 140 ChildThread::CleanUp(); | 139 ChildThread::CleanUp(); |
| 141 | 140 |
| 142 // TODO(port) | 141 // TODO(port) |
| 143 #if defined(OS_WIN) | 142 #if defined(OS_WIN) |
| 144 // Clean up plugin channels before this thread goes away. | 143 // Clean up plugin channels before this thread goes away. |
| 145 PluginChannelBase::CleanupChannels(); | 144 PluginChannelBase::CleanupChannels(); |
| 146 #endif | 145 // Don't call COM if the renderer is in the sandbox. |
| 147 | 146 if (RenderProcess::InProcessPlugins()) |
| 148 #if defined(OS_WIN) | 147 CoUninitialize(); |
| 149 CoUninitialize(); | |
| 150 #endif | 148 #endif |
| 151 } | 149 } |
| 152 | 150 |
| 153 void RenderThread::OnUpdateVisitedLinks(base::SharedMemoryHandle table) { | 151 void RenderThread::OnUpdateVisitedLinks(base::SharedMemoryHandle table) { |
| 154 DCHECK(base::SharedMemory::IsHandleValid(table)) << "Bad table handle"; | 152 DCHECK(base::SharedMemory::IsHandleValid(table)) << "Bad table handle"; |
| 155 visited_link_slave_->Init(table); | 153 visited_link_slave_->Init(table); |
| 156 } | 154 } |
| 157 | 155 |
| 158 void RenderThread::OnUpdateUserScripts( | 156 void RenderThread::OnUpdateUserScripts( |
| 159 base::SharedMemoryHandle scripts) { | 157 base::SharedMemoryHandle scripts) { |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 } | 312 } |
| 315 | 313 |
| 316 void RenderThread::OnExtensionHandleConnect(int port_id) { | 314 void RenderThread::OnExtensionHandleConnect(int port_id) { |
| 317 RendererExtensionBindings::HandleConnect(port_id); | 315 RendererExtensionBindings::HandleConnect(port_id); |
| 318 } | 316 } |
| 319 | 317 |
| 320 void RenderThread::OnExtensionHandleMessage(const std::string& message, | 318 void RenderThread::OnExtensionHandleMessage(const std::string& message, |
| 321 int port_id) { | 319 int port_id) { |
| 322 RendererExtensionBindings::HandleMessage(message, port_id); | 320 RendererExtensionBindings::HandleMessage(message, port_id); |
| 323 } | 321 } |
| OLD | NEW |