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_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 #if defined(ENABLE_WEBRTC) | 110 #if defined(ENABLE_WEBRTC) |
111 #include "chrome/renderer/media/webrtc_logging_message_filter.h" | 111 #include "chrome/renderer/media/webrtc_logging_message_filter.h" |
112 #endif | 112 #endif |
113 | 113 |
114 #if defined(ENABLE_SPELLCHECK) | 114 #if defined(ENABLE_SPELLCHECK) |
115 #include "chrome/renderer/spellchecker/spellcheck.h" | 115 #include "chrome/renderer/spellchecker/spellcheck.h" |
116 #include "chrome/renderer/spellchecker/spellcheck_provider.h" | 116 #include "chrome/renderer/spellchecker/spellcheck_provider.h" |
117 #endif | 117 #endif |
118 | 118 |
119 #if defined(OS_WIN) | |
120 #include "chrome_elf/blacklist/blacklist.h" | |
121 #endif // OS_WIN | |
122 | |
123 using autofill::AutofillAgent; | 119 using autofill::AutofillAgent; |
124 using autofill::PasswordAutofillAgent; | 120 using autofill::PasswordAutofillAgent; |
125 using autofill::PasswordGenerationAgent; | 121 using autofill::PasswordGenerationAgent; |
126 using base::ASCIIToUTF16; | 122 using base::ASCIIToUTF16; |
127 using base::UserMetricsAction; | 123 using base::UserMetricsAction; |
128 using content::RenderThread; | 124 using content::RenderThread; |
129 using content::WebPluginInfo; | 125 using content::WebPluginInfo; |
130 using extensions::Extension; | 126 using extensions::Extension; |
131 using blink::WebCache; | 127 using blink::WebCache; |
132 using blink::WebConsoleMessage; | 128 using blink::WebConsoleMessage; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 | 346 |
351 // chrome-extension: resources should bypass Content Security Policy checks | 347 // chrome-extension: resources should bypass Content Security Policy checks |
352 // when included in protected resources. | 348 // when included in protected resources. |
353 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( | 349 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( |
354 extension_scheme); | 350 extension_scheme); |
355 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( | 351 WebSecurityPolicy::registerURLSchemeAsBypassingContentSecurityPolicy( |
356 extension_resource_scheme); | 352 extension_resource_scheme); |
357 | 353 |
358 extensions::ExtensionsClient::Set( | 354 extensions::ExtensionsClient::Set( |
359 extensions::ChromeExtensionsClient::GetInstance()); | 355 extensions::ChromeExtensionsClient::GetInstance()); |
360 | |
361 #if defined(OS_WIN) | |
362 // Report if the renderer process has been patched by chrome_elf. | |
363 // TODO(csharp): Remove once the renderer is no longer getting | |
364 // patched this way. | |
365 typedef bool(*IsBlacklistInitializedFunc)(); | |
366 IsBlacklistInitializedFunc is_blacklist_initialized = | |
367 reinterpret_cast<IsBlacklistInitializedFunc>( | |
368 GetProcAddress(GetModuleHandle(L"chrome_elf.dll"), | |
369 "IsBlacklistInitialized")); | |
370 if (is_blacklist_initialized()) | |
371 UMA_HISTOGRAM_BOOLEAN("Blacklist.PatchedInRenderer", true); | |
372 #endif | |
373 } | 356 } |
374 | 357 |
375 void ChromeContentRendererClient::RenderFrameCreated( | 358 void ChromeContentRendererClient::RenderFrameCreated( |
376 content::RenderFrame* render_frame) { | 359 content::RenderFrame* render_frame) { |
377 new ChromeRenderFrameObserver(render_frame); | 360 new ChromeRenderFrameObserver(render_frame); |
378 | 361 |
379 ContentSettingsObserver* content_settings = | 362 ContentSettingsObserver* content_settings = |
380 new ContentSettingsObserver(render_frame, extension_dispatcher_.get()); | 363 new ContentSettingsObserver(render_frame, extension_dispatcher_.get()); |
381 if (chrome_observer_.get()) { | 364 if (chrome_observer_.get()) { |
382 content_settings->SetContentSettingRules( | 365 content_settings->SetContentSettingRules( |
(...skipping 1051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1417 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
1435 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); | 1418 return !command_line->HasSwitch(extensions::switches::kExtensionProcess); |
1436 } | 1419 } |
1437 | 1420 |
1438 blink::WebWorkerPermissionClientProxy* | 1421 blink::WebWorkerPermissionClientProxy* |
1439 ChromeContentRendererClient::CreateWorkerPermissionClientProxy( | 1422 ChromeContentRendererClient::CreateWorkerPermissionClientProxy( |
1440 content::RenderFrame* render_frame, | 1423 content::RenderFrame* render_frame, |
1441 blink::WebFrame* frame) { | 1424 blink::WebFrame* frame) { |
1442 return new WorkerPermissionClientProxy(render_frame, frame); | 1425 return new WorkerPermissionClientProxy(render_frame, frame); |
1443 } | 1426 } |
OLD | NEW |