| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 safe_browsing::ThreatDOMDetails::Create(render_frame); | 512 safe_browsing::ThreatDOMDetails::Create(render_frame); |
| 513 #endif | 513 #endif |
| 514 | 514 |
| 515 #if BUILDFLAG(ENABLE_PRINTING) | 515 #if BUILDFLAG(ENABLE_PRINTING) |
| 516 new printing::PrintWebViewHelper( | 516 new printing::PrintWebViewHelper( |
| 517 render_frame, base::MakeUnique<ChromePrintWebViewHelperDelegate>()); | 517 render_frame, base::MakeUnique<ChromePrintWebViewHelperDelegate>()); |
| 518 #endif | 518 #endif |
| 519 | 519 |
| 520 new NetErrorHelper(render_frame); | 520 new NetErrorHelper(render_frame); |
| 521 | 521 |
| 522 if (render_frame->IsMainFrame()) { | 522 new page_load_metrics::MetricsRenderFrameObserver(render_frame); |
| 523 // Only attach MetricsRenderFrameObserver to the main frame, since | 523 |
| 524 // we only want to log page load metrics for the main frame. | 524 if (!render_frame->IsMainFrame() && |
| 525 new page_load_metrics::MetricsRenderFrameObserver(render_frame); | 525 prerender::PrerenderHelper::IsPrerendering( |
| 526 } else { | 526 render_frame->GetRenderView()->GetMainRenderFrame())) { |
| 527 // Avoid any race conditions from having the browser tell subframes that | 527 // Avoid any race conditions from having the browser tell subframes that |
| 528 // they're prerendering. | 528 // they're prerendering. |
| 529 if (prerender::PrerenderHelper::IsPrerendering( | 529 new prerender::PrerenderHelper(render_frame); |
| 530 render_frame->GetRenderView()->GetMainRenderFrame())) { | |
| 531 new prerender::PrerenderHelper(render_frame); | |
| 532 } | |
| 533 } | 530 } |
| 534 | 531 |
| 535 // Set up a mojo service to test if this page is a distiller page. | 532 // Set up a mojo service to test if this page is a distiller page. |
| 536 new dom_distiller::DistillerJsRenderFrameObserver( | 533 new dom_distiller::DistillerJsRenderFrameObserver( |
| 537 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); | 534 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); |
| 538 | 535 |
| 539 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 536 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 540 if (command_line->HasSwitch(switches::kEnableDistillabilityService)) { | 537 if (command_line->HasSwitch(switches::kEnableDistillabilityService)) { |
| 541 // Create DistillabilityAgent to send distillability updates to | 538 // Create DistillabilityAgent to send distillability updates to |
| 542 // DistillabilityDriver in the browser process. | 539 // DistillabilityDriver in the browser process. |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1514 std::vector<base::SchedulerWorkerPoolParams>* params_vector, | 1511 std::vector<base::SchedulerWorkerPoolParams>* params_vector, |
| 1515 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* | 1512 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* |
| 1516 index_to_traits_callback) { | 1513 index_to_traits_callback) { |
| 1517 DCHECK(params_vector); | 1514 DCHECK(params_vector); |
| 1518 DCHECK(index_to_traits_callback); | 1515 DCHECK(index_to_traits_callback); |
| 1519 // If this call fails, content will fall back to the default params. | 1516 // If this call fails, content will fall back to the default params. |
| 1520 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); | 1517 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); |
| 1521 *index_to_traits_callback = | 1518 *index_to_traits_callback = |
| 1522 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); | 1519 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); |
| 1523 } | 1520 } |
| OLD | NEW |