OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 11 matching lines...) Expand all Loading... | |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/task.h" | 23 #include "base/task.h" |
24 #include "base/thread_local.h" | 24 #include "base/thread_local.h" |
25 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
26 #include "base/values.h" | 26 #include "base/values.h" |
27 #include "chrome/common/appcache/appcache_dispatcher.h" | 27 #include "chrome/common/appcache/appcache_dispatcher.h" |
28 #include "chrome/common/child_process_logging.h" | 28 #include "chrome/common/child_process_logging.h" |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/db_message_filter.h" | 30 #include "chrome/common/db_message_filter.h" |
31 #include "chrome/common/dom_storage_common.h" | 31 #include "chrome/common/dom_storage_common.h" |
32 #include "chrome/common/gpu_feature_flags.h" | |
32 #include "chrome/common/plugin_messages.h" | 33 #include "chrome/common/plugin_messages.h" |
33 #include "chrome/common/render_messages.h" | 34 #include "chrome/common/render_messages.h" |
34 #include "chrome/common/render_messages_params.h" | 35 #include "chrome/common/render_messages_params.h" |
35 #include "chrome/common/renderer_preferences.h" | 36 #include "chrome/common/renderer_preferences.h" |
36 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
37 #include "chrome/common/web_database_observer_impl.h" | 38 #include "chrome/common/web_database_observer_impl.h" |
38 #include "chrome/plugin/npobject_util.h" | 39 #include "chrome/plugin/npobject_util.h" |
39 // TODO(port) | 40 // TODO(port) |
40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
41 #include "chrome/plugin/plugin_channel.h" | 42 #include "chrome/plugin/plugin_channel.h" |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1072 | 1073 |
1073 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { | 1074 void RenderThread::OnSpellCheckEnableAutoSpellCorrect(bool enable) { |
1074 spellchecker_->EnableAutoSpellCorrect(enable); | 1075 spellchecker_->EnableAutoSpellCorrect(enable); |
1075 } | 1076 } |
1076 | 1077 |
1077 void RenderThread::OnSetIsIncognitoProcess(bool is_incognito_process) { | 1078 void RenderThread::OnSetIsIncognitoProcess(bool is_incognito_process) { |
1078 is_incognito_process_ = is_incognito_process; | 1079 is_incognito_process_ = is_incognito_process; |
1079 } | 1080 } |
1080 | 1081 |
1081 void RenderThread::OnGpuChannelEstablished( | 1082 void RenderThread::OnGpuChannelEstablished( |
1082 const IPC::ChannelHandle& channel_handle, const GPUInfo& gpu_info) { | 1083 const IPC::ChannelHandle& channel_handle, |
1084 const GPUInfo& gpu_info, | |
1085 const GpuFeatureFlags& gpu_feature_flags) { | |
1083 #if defined(OS_POSIX) | 1086 #if defined(OS_POSIX) |
1084 // If we received a ChannelHandle, register it now. | 1087 // If we received a ChannelHandle, register it now. |
1085 if (channel_handle.socket.fd >= 0) | 1088 if (channel_handle.socket.fd >= 0) |
1086 IPC::AddChannelSocket(channel_handle.name, channel_handle.socket.fd); | 1089 IPC::AddChannelSocket(channel_handle.name, channel_handle.socket.fd); |
1087 #endif | 1090 #endif |
1088 | 1091 |
1089 gpu_channel_->set_gpu_info(gpu_info); | |
1090 | |
1091 if (channel_handle.name.size() != 0) { | 1092 if (channel_handle.name.size() != 0) { |
1092 // Connect to the GPU process if a channel name was received. | 1093 if (gpu_feature_flags.is_accelerated_2d_canvas_blacklisted() || |
vangelis
2010/12/08 00:17:38
It would be worth putting a comment here mentionin
Zhenyao Mo
2010/12/09 00:06:06
Done.
| |
1093 gpu_channel_->Connect(channel_handle.name); | 1094 gpu_feature_flags.is_accelerated_compositing_blacklisted() || |
1095 gpu_feature_flags.is_webgl_blacklisted()) { | |
Ken Russell (switch to Gerrit)
2010/12/08 05:04:16
There's an architectural problem with doing these
| |
1096 // If any GPU feature is blacklisted, cancel the connection. | |
1097 gpu_channel_ = NULL; | |
1098 } else { | |
1099 // Connect to the GPU process if a channel name was received. | |
1100 gpu_channel_->set_gpu_info(gpu_info); | |
1101 gpu_channel_->set_gpu_feature_flags(gpu_feature_flags); | |
1102 gpu_channel_->Connect(channel_handle.name); | |
1103 } | |
1094 } else { | 1104 } else { |
1095 // Otherwise cancel the connection. | 1105 // Otherwise cancel the connection. |
1096 gpu_channel_ = NULL; | 1106 gpu_channel_ = NULL; |
1097 } | 1107 } |
1098 } | 1108 } |
1099 | 1109 |
1100 void RenderThread::OnSetPhishingModel(IPC::PlatformFileForTransit model_file) { | 1110 void RenderThread::OnSetPhishingModel(IPC::PlatformFileForTransit model_file) { |
1101 safe_browsing::Scorer::CreateFromFile( | 1111 safe_browsing::Scorer::CreateFromFile( |
1102 IPC::PlatformFileForTransitToPlatformFile(model_file), | 1112 IPC::PlatformFileForTransitToPlatformFile(model_file), |
1103 GetFileThreadMessageLoopProxy(), | 1113 GetFileThreadMessageLoopProxy(), |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1144 } | 1154 } |
1145 | 1155 |
1146 return false; | 1156 return false; |
1147 } | 1157 } |
1148 | 1158 |
1149 void RenderThread::RegisterExtension(v8::Extension* extension, | 1159 void RenderThread::RegisterExtension(v8::Extension* extension, |
1150 bool restrict_to_extensions) { | 1160 bool restrict_to_extensions) { |
1151 WebScriptController::registerExtension(extension); | 1161 WebScriptController::registerExtension(extension); |
1152 v8_extensions_[extension->name()] = restrict_to_extensions; | 1162 v8_extensions_[extension->name()] = restrict_to_extensions; |
1153 } | 1163 } |
OLD | NEW |