Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_render_process_observer.h" | 5 #include "chrome/renderer/chrome_render_process_observer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/base_switches.h" | 13 #include "base/base_switches.h" |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
| 17 #include "base/location.h" | 17 #include "base/location.h" |
| 18 #include "base/macros.h" | 18 #include "base/macros.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/metrics/field_trial.h" | 20 #include "base/metrics/field_trial.h" |
| 21 #include "base/metrics/histogram.h" | 21 #include "base/metrics/histogram.h" |
| 22 #include "base/metrics/statistics_recorder.h" | 22 #include "base/metrics/statistics_recorder.h" |
| 23 #include "base/path_service.h" | 23 #include "base/path_service.h" |
| 24 #include "base/single_thread_task_runner.h" | 24 #include "base/single_thread_task_runner.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/thread_task_runner_handle.h" | 26 #include "base/thread_task_runner_handle.h" |
| 27 #include "base/threading/platform_thread.h" | 27 #include "base/threading/platform_thread.h" |
| 28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
| 29 #include "chrome/common/child_process_logging.h" | 29 #include "chrome/common/child_process_logging.h" |
| 30 #include "chrome/common/chrome_features.h" | |
| 30 #include "chrome/common/chrome_paths.h" | 31 #include "chrome/common/chrome_paths.h" |
| 31 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 32 #include "chrome/common/media/media_resource_provider.h" | 33 #include "chrome/common/media/media_resource_provider.h" |
| 33 #include "chrome/common/net/net_resource_provider.h" | 34 #include "chrome/common/net/net_resource_provider.h" |
| 34 #include "chrome/common/render_messages.h" | 35 #include "chrome/common/render_messages.h" |
| 35 #include "chrome/common/resource_usage_reporter.mojom.h" | 36 #include "chrome/common/resource_usage_reporter.mojom.h" |
| 36 #include "chrome/common/resource_usage_reporter_type_converters.h" | 37 #include "chrome/common/resource_usage_reporter_type_converters.h" |
| 37 #include "chrome/common/url_constants.h" | 38 #include "chrome/common/url_constants.h" |
| 38 #include "chrome/renderer/content_settings_observer.h" | 39 #include "chrome/renderer/content_settings_observer.h" |
| 39 #include "chrome/renderer/security_filter_peer.h" | 40 #include "chrome/renderer/security_filter_peer.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 254 if (command_line.HasSwitch(switches::kJavaScriptHarmony)) { | 255 if (command_line.HasSwitch(switches::kJavaScriptHarmony)) { |
| 255 std::string flag("--harmony"); | 256 std::string flag("--harmony"); |
| 256 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); | 257 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); |
| 257 } | 258 } |
| 258 | 259 |
| 259 if (command_line.HasSwitch(switches::kEnableWasm)) { | 260 if (command_line.HasSwitch(switches::kEnableWasm)) { |
| 260 std::string flag("--expose-wasm"); | 261 std::string flag("--expose-wasm"); |
| 261 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); | 262 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); |
| 262 } | 263 } |
| 263 | 264 |
| 265 if (base::FeatureList::IsEnabled(features::kV8Ignition)) { | |
| 266 std::string flag("--ignition"); | |
| 267 v8::V8::SetFlagsFromString(flag.c_str(), static_cast<int>(flag.size())); | |
|
jochen (gone - plz use gerrit)
2016/03/30 16:13:34
you could move this to gin/isolate_holder.cc - the
Alexei Svitkine (slow)
2016/03/30 17:02:44
Unfortunately, this is not possible currently due
| |
| 268 } | |
| 269 | |
| 264 RenderThread* thread = RenderThread::Get(); | 270 RenderThread* thread = RenderThread::Get(); |
| 265 resource_delegate_.reset(new RendererResourceDelegate()); | 271 resource_delegate_.reset(new RendererResourceDelegate()); |
| 266 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); | 272 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); |
| 267 | 273 |
| 268 thread->GetServiceRegistry()->AddService<ResourceUsageReporter>( | 274 thread->GetServiceRegistry()->AddService<ResourceUsageReporter>( |
| 269 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); | 275 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); |
| 270 | 276 |
| 271 // Configure modules that need access to resources. | 277 // Configure modules that need access to resources. |
| 272 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 278 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
| 273 media::SetLocalizedStringProvider( | 279 media::SetLocalizedStringProvider( |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 390 ChromeRenderProcessObserver::content_setting_rules() const { | 396 ChromeRenderProcessObserver::content_setting_rules() const { |
| 391 return &content_setting_rules_; | 397 return &content_setting_rules_; |
| 392 } | 398 } |
| 393 | 399 |
| 394 void ChromeRenderProcessObserver::OnFieldTrialGroupFinalized( | 400 void ChromeRenderProcessObserver::OnFieldTrialGroupFinalized( |
| 395 const std::string& trial_name, | 401 const std::string& trial_name, |
| 396 const std::string& group_name) { | 402 const std::string& group_name) { |
| 397 content::RenderThread::Get()->Send( | 403 content::RenderThread::Get()->Send( |
| 398 new ChromeViewHostMsg_FieldTrialActivated(trial_name)); | 404 new ChromeViewHostMsg_FieldTrialActivated(trial_name)); |
| 399 } | 405 } |
| OLD | NEW |