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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 2677153002: Use TaskScheduler instead of blocking pool in render_widget_host_impl.cc. (Closed)
Patch Set: ScopedTaskSchedulers 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 "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
11 #include <utility> 11 #include <utility>
12 12
13 #include "base/auto_reset.h" 13 #include "base/auto_reset.h"
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/command_line.h" 15 #include "base/command_line.h"
16 #include "base/containers/hash_tables.h" 16 #include "base/containers/hash_tables.h"
17 #include "base/i18n/rtl.h" 17 #include "base/i18n/rtl.h"
18 #include "base/lazy_instance.h" 18 #include "base/lazy_instance.h"
19 #include "base/location.h" 19 #include "base/location.h"
20 #include "base/macros.h" 20 #include "base/macros.h"
21 #include "base/memory/ptr_util.h" 21 #include "base/memory/ptr_util.h"
22 #include "base/metrics/field_trial.h" 22 #include "base/metrics/field_trial.h"
23 #include "base/metrics/histogram_macros.h" 23 #include "base/metrics/histogram_macros.h"
24 #include "base/single_thread_task_runner.h" 24 #include "base/single_thread_task_runner.h"
25 #include "base/strings/string_number_conversions.h" 25 #include "base/strings/string_number_conversions.h"
26 #include "base/strings/utf_string_conversions.h" 26 #include "base/strings/utf_string_conversions.h"
27 #include "base/task_scheduler/post_task.h"
27 #include "base/threading/thread_task_runner_handle.h" 28 #include "base/threading/thread_task_runner_handle.h"
28 #include "base/trace_event/trace_event.h" 29 #include "base/trace_event/trace_event.h"
29 #include "build/build_config.h" 30 #include "build/build_config.h"
30 #include "cc/base/switches.h" 31 #include "cc/base/switches.h"
31 #include "cc/output/compositor_frame.h" 32 #include "cc/output/compositor_frame.h"
32 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 33 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
33 #include "content/browser/bad_message.h" 34 #include "content/browser/bad_message.h"
34 #include "content/browser/browser_plugin/browser_plugin_guest.h" 35 #include "content/browser/browser_plugin/browser_plugin_guest.h"
35 #include "content/browser/child_process_security_policy_impl.h" 36 #include "content/browser/child_process_security_policy_impl.h"
36 #include "content/browser/gpu/compositor_util.h" 37 #include "content/browser/gpu/compositor_util.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 base::TimeDelta::FromMilliseconds(kNewContentRenderingDelayMs)), 292 base::TimeDelta::FromMilliseconds(kNewContentRenderingDelayMs)),
292 weak_factory_(this) { 293 weak_factory_(this) {
293 CHECK(delegate_); 294 CHECK(delegate_);
294 CHECK_NE(MSG_ROUTING_NONE, routing_id_); 295 CHECK_NE(MSG_ROUTING_NONE, routing_id_);
295 latency_tracker_.SetDelegate(delegate_); 296 latency_tracker_.SetDelegate(delegate_);
296 297
297 #if defined(OS_WIN) 298 #if defined(OS_WIN)
298 // Update the display color profile cache so that it is likely to be up to 299 // Update the display color profile cache so that it is likely to be up to
299 // date when the renderer process requests the color profile. 300 // date when the renderer process requests the color profile.
300 if (gfx::ICCProfile::CachedProfilesNeedUpdate()) { 301 if (gfx::ICCProfile::CachedProfilesNeedUpdate()) {
301 BrowserThread::PostBlockingPoolTask( 302 base::PostTaskWithTraits(
302 FROM_HERE, 303 FROM_HERE, base::TaskTraits().MayBlock().WithPriority(
304 base::TaskPriority::BACKGROUND),
303 base::Bind(&gfx::ICCProfile::UpdateCachedProfilesOnBackgroundThread)); 305 base::Bind(&gfx::ICCProfile::UpdateCachedProfilesOnBackgroundThread));
304 } 306 }
305 #endif 307 #endif
306 308
307 std::pair<RoutingIDWidgetMap::iterator, bool> result = 309 std::pair<RoutingIDWidgetMap::iterator, bool> result =
308 g_routing_id_widget_map.Get().insert(std::make_pair( 310 g_routing_id_widget_map.Get().insert(std::make_pair(
309 RenderWidgetHostID(process->GetID(), routing_id_), this)); 311 RenderWidgetHostID(process->GetID(), routing_id_), this));
310 CHECK(result.second) << "Inserting a duplicate item!"; 312 CHECK(result.second) << "Inserting a duplicate item!";
311 process_->AddRoute(routing_id_, this); 313 process_->AddRoute(routing_id_, this);
312 314
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 // different from the receiver's. 2508 // different from the receiver's.
2507 file_system_file.url = 2509 file_system_file.url =
2508 GURL(storage::GetIsolatedFileSystemRootURIString( 2510 GURL(storage::GetIsolatedFileSystemRootURIString(
2509 file_system_url.origin(), filesystem_id, std::string()) 2511 file_system_url.origin(), filesystem_id, std::string())
2510 .append(register_name)); 2512 .append(register_name));
2511 file_system_file.filesystem_id = filesystem_id; 2513 file_system_file.filesystem_id = filesystem_id;
2512 } 2514 }
2513 } 2515 }
2514 2516
2515 } // namespace content 2517 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/session/audio_focus_manager_unittest.cc ('k') | content/browser/site_instance_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698