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

Side by Side Diff: chrome/utility/font_cache_handler_win.cc

Issue 1167163002: chrome: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing message_loop.h includes. Created 5 years, 6 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/test/ppapi/ppapi_test.cc ('k') | chrome/utility/image_writer/image_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/utility/font_cache_handler_win.h" 5 #include "chrome/utility/font_cache_handler_win.h"
6 6
7 #include "base/task_runner_util.h" 7 #include "base/task_runner_util.h"
8 #include "base/threading/thread.h" 8 #include "base/threading/thread.h"
9 #include "chrome/common/chrome_utility_messages.h" 9 #include "chrome/common/chrome_utility_messages.h"
10 #include "content/public/common/dwrite_font_platform_win.h" 10 #include "content/public/common/dwrite_font_platform_win.h"
(...skipping 11 matching lines...) Expand all
22 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_BuildDirectWriteFontCache, 22 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_BuildDirectWriteFontCache,
23 OnBuildFontCache) 23 OnBuildFontCache)
24 IPC_MESSAGE_UNHANDLED(handled = false) 24 IPC_MESSAGE_UNHANDLED(handled = false)
25 IPC_END_MESSAGE_MAP() 25 IPC_END_MESSAGE_MAP()
26 return handled; 26 return handled;
27 } 27 }
28 28
29 void FontCacheHandler::OnBuildFontCache(const base::FilePath& full_path) { 29 void FontCacheHandler::OnBuildFontCache(const base::FilePath& full_path) {
30 DCHECK(!cache_thread_); 30 DCHECK(!cache_thread_);
31 31
32 utility_task_runner_ = base::MessageLoop::current()->message_loop_proxy(); 32 utility_task_runner_ = base::MessageLoop::current()->task_runner();
33 33
34 // Create worker thread for building font cache. 34 // Create worker thread for building font cache.
35 cache_thread_.reset(new base::Thread("font_cache_thread")); 35 cache_thread_.reset(new base::Thread("font_cache_thread"));
36 if (!cache_thread_->Start()) { 36 if (!cache_thread_->Start()) {
37 NOTREACHED(); 37 NOTREACHED();
38 return; 38 return;
39 } 39 }
40 cache_thread_->message_loop()->PostTask( 40 cache_thread_->message_loop()->PostTask(
41 FROM_HERE, base::Bind(&FontCacheHandler::StartBuildingFontCache, 41 FROM_HERE, base::Bind(&FontCacheHandler::StartBuildingFontCache,
42 base::Unretained(this), 42 base::Unretained(this),
43 full_path)); 43 full_path));
44 } 44 }
45 45
46 void FontCacheHandler::StartBuildingFontCache(const base::FilePath& full_path) { 46 void FontCacheHandler::StartBuildingFontCache(const base::FilePath& full_path) {
47 content::BuildFontCache(full_path); 47 content::BuildFontCache(full_path);
48 utility_task_runner_->PostTask(FROM_HERE, 48 utility_task_runner_->PostTask(FROM_HERE,
49 base::Bind(&FontCacheHandler::Cleanup, 49 base::Bind(&FontCacheHandler::Cleanup,
50 base::Unretained(this))); 50 base::Unretained(this)));
51 } 51 }
52 52
53 void FontCacheHandler::Cleanup() { 53 void FontCacheHandler::Cleanup() {
54 cache_thread_.reset(); 54 cache_thread_.reset();
55 content::UtilityThread::Get()->ReleaseProcessIfNeeded(); 55 content::UtilityThread::Get()->ReleaseProcessIfNeeded();
56 } 56 }
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_test.cc ('k') | chrome/utility/image_writer/image_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698