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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 // The Instant process can only display the content but not read it. Other | 389 // The Instant process can only display the content but not read it. Other |
390 // processes can't display it or read it. | 390 // processes can't display it or read it. |
391 if (!command_line->HasSwitch(switches::kInstantProcess)) | 391 if (!command_line->HasSwitch(switches::kInstantProcess)) |
392 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme); | 392 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme); |
393 | 393 |
394 WebString dom_distiller_scheme( | 394 WebString dom_distiller_scheme( |
395 ASCIIToUTF16(dom_distiller::kDomDistillerScheme)); | 395 ASCIIToUTF16(dom_distiller::kDomDistillerScheme)); |
396 // TODO(nyquist): Add test to ensure this happens when the flag is set. | 396 // TODO(nyquist): Add test to ensure this happens when the flag is set. |
397 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dom_distiller_scheme); | 397 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dom_distiller_scheme); |
398 | 398 |
399 #if defined(OS_CHROMEOS) | |
400 WebSecurityPolicy::registerURLSchemeAsLocal( | |
401 WebString::fromUTF8(content::kExternalFileScheme)); | |
402 #endif | |
403 | |
404 #if defined(OS_ANDROID) | 399 #if defined(OS_ANDROID) |
405 WebSecurityPolicy::registerURLSchemeAsAllowedForReferrer( | 400 WebSecurityPolicy::registerURLSchemeAsAllowedForReferrer( |
406 WebString::fromUTF8(chrome::kAndroidAppScheme)); | 401 WebString::fromUTF8(chrome::kAndroidAppScheme)); |
407 WebSecurityPolicy::registerURLSchemeAsLocal( | |
408 WebString::fromUTF8(url::kContentScheme)); | |
409 #endif | 402 #endif |
410 | 403 |
411 // chrome-search: pages should not be accessible by bookmarklets | 404 // chrome-search: pages should not be accessible by bookmarklets |
412 // or javascript: URLs typed in the omnibox. | 405 // or javascript: URLs typed in the omnibox. |
413 WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs( | 406 WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs( |
414 chrome_search_scheme); | 407 chrome_search_scheme); |
415 | 408 |
416 // chrome-search: resources shouldn't trigger insecure content warnings. Note | |
417 // that the chrome-extension: scheme is registered by extensions::Dispatcher. | |
418 WebSecurityPolicy::registerURLSchemeAsSecure(chrome_search_scheme); | |
419 | |
420 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 409 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
421 pdf_print_client_.reset(new ChromePDFPrintClient()); | 410 pdf_print_client_.reset(new ChromePDFPrintClient()); |
422 pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); | 411 pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); |
423 #endif | 412 #endif |
424 | 413 |
425 for (auto& origin : GetSecureOriginWhitelist()) { | 414 for (auto& origin : GetSecureOriginWhitelist()) { |
426 WebSecurityPolicy::addOriginTrustworthyWhiteList( | 415 WebSecurityPolicy::addOriginTrustworthyWhiteList( |
427 WebSecurityOrigin::create(origin)); | 416 WebSecurityOrigin::create(origin)); |
428 } | 417 } |
429 | 418 |
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1477 std::vector<base::SchedulerWorkerPoolParams>* params_vector, | 1466 std::vector<base::SchedulerWorkerPoolParams>* params_vector, |
1478 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* | 1467 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* |
1479 index_to_traits_callback) { | 1468 index_to_traits_callback) { |
1480 DCHECK(params_vector); | 1469 DCHECK(params_vector); |
1481 DCHECK(index_to_traits_callback); | 1470 DCHECK(index_to_traits_callback); |
1482 // If this call fails, content will fall back to the default params. | 1471 // If this call fails, content will fall back to the default params. |
1483 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); | 1472 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); |
1484 *index_to_traits_callback = | 1473 *index_to_traits_callback = |
1485 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); | 1474 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); |
1486 } | 1475 } |
OLD | NEW |