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 <limits> | 7 #include <limits> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/allocator/allocator_extension.h" | 10 #include "base/allocator/allocator_extension.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #include "third_party/WebKit/public/web/WebFrame.h" | 45 #include "third_party/WebKit/public/web/WebFrame.h" |
46 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 46 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
47 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 47 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
48 #include "third_party/WebKit/public/web/WebView.h" | 48 #include "third_party/WebKit/public/web/WebView.h" |
49 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" | 49 #include "third_party/mojo/src/mojo/public/cpp/bindings/strong_binding.h" |
50 | 50 |
51 #if defined(ENABLE_EXTENSIONS) | 51 #if defined(ENABLE_EXTENSIONS) |
52 #include "chrome/renderer/extensions/extension_localization_peer.h" | 52 #include "chrome/renderer/extensions/extension_localization_peer.h" |
53 #endif | 53 #endif |
54 | 54 |
| 55 #if !defined(OS_IOS) |
| 56 #include "chrome/common/media/media_resource_provider.h" |
| 57 #include "media/base/media_resources.h" |
| 58 #endif |
| 59 |
55 using blink::WebCache; | 60 using blink::WebCache; |
56 using blink::WebRuntimeFeatures; | 61 using blink::WebRuntimeFeatures; |
57 using blink::WebSecurityPolicy; | 62 using blink::WebSecurityPolicy; |
58 using blink::WebString; | 63 using blink::WebString; |
59 using content::RenderThread; | 64 using content::RenderThread; |
60 | 65 |
61 namespace { | 66 namespace { |
62 | 67 |
63 const int kCacheStatsDelayMS = 2000; | 68 const int kCacheStatsDelayMS = 2000; |
64 | 69 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); | 249 thread->SetResourceDispatcherDelegate(resource_delegate_.get()); |
245 | 250 |
246 content::ServiceRegistry* service_registry = thread->GetServiceRegistry(); | 251 content::ServiceRegistry* service_registry = thread->GetServiceRegistry(); |
247 if (service_registry) { | 252 if (service_registry) { |
248 service_registry->AddService<ResourceUsageReporter>( | 253 service_registry->AddService<ResourceUsageReporter>( |
249 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); | 254 base::Bind(CreateResourceUsageReporter, weak_factory_.GetWeakPtr())); |
250 } | 255 } |
251 | 256 |
252 // Configure modules that need access to resources. | 257 // Configure modules that need access to resources. |
253 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); | 258 net::NetModule::SetResourceProvider(chrome_common_net::NetResourceProvider); |
| 259 #if !defined(OS_IOS) |
| 260 media::SetLocalizedStringProvider( |
| 261 chrome_common_media::LocalizedStringProvider); |
| 262 #endif |
254 | 263 |
255 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(USE_OPENSSL) | 264 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(USE_OPENSSL) |
256 // On platforms where we use system NSS shared libraries, | 265 // On platforms where we use system NSS shared libraries, |
257 // initialize NSS now because it won't be able to load the .so's | 266 // initialize NSS now because it won't be able to load the .so's |
258 // after we engage the sandbox. | 267 // after we engage the sandbox. |
259 if (!command_line.HasSwitch(switches::kSingleProcess)) | 268 if (!command_line.HasSwitch(switches::kSingleProcess)) |
260 crypto::InitNSSSafely(); | 269 crypto::InitNSSSafely(); |
261 #endif | 270 #endif |
262 // Setup initial set of crash dump data for Field Trials in this renderer. | 271 // Setup initial set of crash dump data for Field Trials in this renderer. |
263 variations::SetVariationListCrashKeys(); | 272 variations::SetVariationListCrashKeys(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 ChromeRenderProcessObserver::content_setting_rules() const { | 338 ChromeRenderProcessObserver::content_setting_rules() const { |
330 return &content_setting_rules_; | 339 return &content_setting_rules_; |
331 } | 340 } |
332 | 341 |
333 void ChromeRenderProcessObserver::OnFieldTrialGroupFinalized( | 342 void ChromeRenderProcessObserver::OnFieldTrialGroupFinalized( |
334 const std::string& trial_name, | 343 const std::string& trial_name, |
335 const std::string& group_name) { | 344 const std::string& group_name) { |
336 content::RenderThread::Get()->Send( | 345 content::RenderThread::Get()->Send( |
337 new ChromeViewHostMsg_FieldTrialActivated(trial_name)); | 346 new ChromeViewHostMsg_FieldTrialActivated(trial_name)); |
338 } | 347 } |
OLD | NEW |