Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 2633253002: Split content script injections into multiple tasks (Closed)
Patch Set: Inject document_idle scripts before window.onload Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1396 render_frame); 1396 render_frame);
1397 // |render_frame| might be dead by now. 1397 // |render_frame| might be dead by now.
1398 #endif 1398 #endif
1399 } 1399 }
1400 1400
1401 void ChromeContentRendererClient::RunScriptsAtDocumentEnd( 1401 void ChromeContentRendererClient::RunScriptsAtDocumentEnd(
1402 content::RenderFrame* render_frame) { 1402 content::RenderFrame* render_frame) {
1403 #if BUILDFLAG(ENABLE_EXTENSIONS) 1403 #if BUILDFLAG(ENABLE_EXTENSIONS)
1404 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( 1404 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd(
1405 render_frame); 1405 render_frame);
1406 // |render_frame| might be dead by now. 1406 // |render_frame| might be dead by now.
Devlin 2017/02/21 18:56:26 Duplicate this comment in the new function.
Kunihiko Sakamoto 2017/02/23 09:49:01 Done.
1407 #endif 1407 #endif
1408 } 1408 }
1409 1409
1410 void ChromeContentRendererClient::RunScriptsAtDocumentIdle(
1411 content::RenderFrame* render_frame) {
1412 #if BUILDFLAG(ENABLE_EXTENSIONS)
1413 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentIdle(
1414 render_frame);
1415 #endif
1416 }
1417
1410 void ChromeContentRendererClient:: 1418 void ChromeContentRendererClient::
1411 DidInitializeServiceWorkerContextOnWorkerThread( 1419 DidInitializeServiceWorkerContextOnWorkerThread(
1412 v8::Local<v8::Context> context, 1420 v8::Local<v8::Context> context,
1413 int64_t service_worker_version_id, 1421 int64_t service_worker_version_id,
1414 const GURL& url) { 1422 const GURL& url) {
1415 #if BUILDFLAG(ENABLE_EXTENSIONS) 1423 #if BUILDFLAG(ENABLE_EXTENSIONS)
1416 ChromeExtensionsRendererClient::GetInstance() 1424 ChromeExtensionsRendererClient::GetInstance()
1417 ->extension_dispatcher() 1425 ->extension_dispatcher()
1418 ->DidInitializeServiceWorkerContextOnWorkerThread( 1426 ->DidInitializeServiceWorkerContextOnWorkerThread(
1419 context, service_worker_version_id, url); 1427 context, service_worker_version_id, url);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 std::vector<base::SchedulerWorkerPoolParams>* params_vector, 1518 std::vector<base::SchedulerWorkerPoolParams>* params_vector,
1511 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* 1519 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
1512 index_to_traits_callback) { 1520 index_to_traits_callback) {
1513 DCHECK(params_vector); 1521 DCHECK(params_vector);
1514 DCHECK(index_to_traits_callback); 1522 DCHECK(index_to_traits_callback);
1515 // If this call fails, content will fall back to the default params. 1523 // If this call fails, content will fall back to the default params.
1516 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); 1524 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams();
1517 *index_to_traits_callback = 1525 *index_to_traits_callback =
1518 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); 1526 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits);
1519 } 1527 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698