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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 #endif | 303 #endif |
304 | 304 |
305 // Establish a channel to the GPU process asynchronously if requested. If the | 305 // Establish a channel to the GPU process asynchronously if requested. If the |
306 // channel is established in time, EstablishGpuChannelSync will not block when | 306 // channel is established in time, EstablishGpuChannelSync will not block when |
307 // it is later called. Delays by a fixed period of time to avoid loading the | 307 // it is later called. Delays by a fixed period of time to avoid loading the |
308 // GPU immediately in an attempt to not slow startup time. | 308 // GPU immediately in an attempt to not slow startup time. |
309 scoped_refptr<base::FieldTrial> prelaunch_trial( | 309 scoped_refptr<base::FieldTrial> prelaunch_trial( |
310 new base::FieldTrial("PrelaunchGpuProcessExperiment", 100)); | 310 new base::FieldTrial("PrelaunchGpuProcessExperiment", 100)); |
311 int prelaunch_group = prelaunch_trial->AppendGroup("prelaunch_gpu_process", | 311 int prelaunch_group = prelaunch_trial->AppendGroup("prelaunch_gpu_process", |
312 kPrelauchGpuPercentage); | 312 kPrelauchGpuPercentage); |
| 313 prelaunch_trial->AppendGroup("default_prelaunch_gpu_process", |
| 314 base::FieldTrial::kAllRemainingProbability); |
313 if (prelaunch_group == prelaunch_trial->group() || | 315 if (prelaunch_group == prelaunch_trial->group() || |
314 CommandLine::ForCurrentProcess()->HasSwitch( | 316 CommandLine::ForCurrentProcess()->HasSwitch( |
315 switches::kPrelaunchGpuProcess)) { | 317 switches::kPrelaunchGpuProcess)) { |
316 message_loop()->PostDelayedTask(FROM_HERE, | 318 message_loop()->PostDelayedTask(FROM_HERE, |
317 task_factory_->NewRunnableMethod( | 319 task_factory_->NewRunnableMethod( |
318 &RenderThread::EstablishGpuChannel), | 320 &RenderThread::EstablishGpuChannel), |
319 kPrelauchGpuProcessDelayMS); | 321 kPrelauchGpuProcessDelayMS); |
320 } | 322 } |
321 | 323 |
322 TRACE_EVENT_END("RenderThread::Init", 0, ""); | 324 TRACE_EVENT_END("RenderThread::Init", 0, ""); |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 } | 1152 } |
1151 | 1153 |
1152 return false; | 1154 return false; |
1153 } | 1155 } |
1154 | 1156 |
1155 void RenderThread::RegisterExtension(v8::Extension* extension, | 1157 void RenderThread::RegisterExtension(v8::Extension* extension, |
1156 bool restrict_to_extensions) { | 1158 bool restrict_to_extensions) { |
1157 WebScriptController::registerExtension(extension); | 1159 WebScriptController::registerExtension(extension); |
1158 v8_extensions_[extension->name()] = restrict_to_extensions; | 1160 v8_extensions_[extension->name()] = restrict_to_extensions; |
1159 } | 1161 } |
OLD | NEW |