Commit 4ef18aaa authored by yzshen@chromium.org's avatar yzshen@chromium.org

Change GetFontListAsync() to use the blocking pool.

PPB_Font_Dev.GetFontFamilies() is a sync operation that waits for GetFontListAsync() to finish on the FILE thread in the browser process.
If the thread is busy, it could hang for quite a while.
Some Pepper Flash hangs are caused by this.

BUG=155931
TEST=None


Review URL: https://chromiumcodereview.appspot.com/11143028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162383 0039d316-1c4b-4281-b951-d872f2087c98
parent 02541a4e
...@@ -20,7 +20,7 @@ void ReturnFontListToOriginalThread( ...@@ -20,7 +20,7 @@ void ReturnFontListToOriginalThread(
callback.Run(result.Pass()); callback.Run(result.Pass());
} }
void GetFontListOnFileThread( void GetFontListInBlockingPool(
BrowserThread::ID calling_thread_id, BrowserThread::ID calling_thread_id,
const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) { const base::Callback<void(scoped_ptr<base::ListValue>)>& callback) {
scoped_ptr<base::ListValue> result(GetFontList_SlowBlocking()); scoped_ptr<base::ListValue> result(GetFontList_SlowBlocking());
...@@ -38,8 +38,8 @@ void GetFontListAsync( ...@@ -38,8 +38,8 @@ void GetFontListAsync(
DCHECK(well_known_thread) DCHECK(well_known_thread)
<< "Can only call GetFontList from a well-known thread."; << "Can only call GetFontList from a well-known thread.";
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, BrowserThread::PostBlockingPoolTask(FROM_HERE,
base::Bind(&GetFontListOnFileThread, id, callback)); base::Bind(&GetFontListInBlockingPool, id, callback));
} }
} // namespace content } // namespace content
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment