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

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

Issue 2714873002: Fix 2 issues that were hitting dchecks when enabling ModuleDatabase (Closed)
Patch Set: 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
« no previous file with comments | « chrome/browser/conflicts/module_database_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 { 359 {
360 startup_metric_utils::mojom::StartupMetricHostPtr startup_metric_host; 360 startup_metric_utils::mojom::StartupMetricHostPtr startup_metric_host;
361 thread->GetRemoteInterfaces()->GetInterface(&startup_metric_host); 361 thread->GetRemoteInterfaces()->GetInterface(&startup_metric_host);
362 startup_metric_host->RecordRendererMainEntryTime(main_entry_time_); 362 startup_metric_host->RecordRendererMainEntryTime(main_entry_time_);
363 } 363 }
364 364
365 #if defined(OS_WIN) 365 #if defined(OS_WIN)
366 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) { 366 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) {
367 thread->GetRemoteInterfaces()->GetInterface(&module_event_sink_); 367 thread->GetRemoteInterfaces()->GetInterface(&module_event_sink_);
368 368
369 // Rebind the ModuleEventSink so that it can be accessed on the IO thread.
370 module_event_sink_.Bind(module_event_sink_.PassInterface(),
371 thread->GetIOTaskRunner());
372
369 // It is safe to pass an unretained pointer to |module_event_sink_|, as it 373 // It is safe to pass an unretained pointer to |module_event_sink_|, as it
370 // is owned by the process singleton ChromeContentRendererClient, which is 374 // is owned by the process singleton ChromeContentRendererClient, which is
371 // leaked. 375 // leaked.
372 module_watcher_ = ModuleWatcher::Create( 376 module_watcher_ = ModuleWatcher::Create(
373 base::Bind(&OnModuleEvent, thread->GetIOTaskRunner(), 377 base::Bind(&OnModuleEvent, thread->GetIOTaskRunner(),
374 base::Unretained(&module_event_sink_))); 378 base::Unretained(&module_event_sink_)));
375 } 379 }
376 #endif 380 #endif
377 381
378 chrome_observer_.reset(new ChromeRenderThreadObserver()); 382 chrome_observer_.reset(new ChromeRenderThreadObserver());
(...skipping 1131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 std::vector<base::SchedulerWorkerPoolParams>* params_vector, 1514 std::vector<base::SchedulerWorkerPoolParams>* params_vector,
1511 base::TaskScheduler::WorkerPoolIndexForTraitsCallback* 1515 base::TaskScheduler::WorkerPoolIndexForTraitsCallback*
1512 index_to_traits_callback) { 1516 index_to_traits_callback) {
1513 DCHECK(params_vector); 1517 DCHECK(params_vector);
1514 DCHECK(index_to_traits_callback); 1518 DCHECK(index_to_traits_callback);
1515 // If this call fails, content will fall back to the default params. 1519 // If this call fails, content will fall back to the default params.
1516 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams(); 1520 *params_vector = task_scheduler_util::GetRendererWorkerPoolParams();
1517 *index_to_traits_callback = 1521 *index_to_traits_callback =
1518 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits); 1522 base::Bind(&task_scheduler_util::RendererWorkerPoolIndexForTraits);
1519 } 1523 }
OLDNEW
« no previous file with comments | « chrome/browser/conflicts/module_database_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698