| OLD | NEW |
| 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/pepper/pepper_browser_font_singleton_hos
t.h" | 5 #include "content/browser/renderer_host/pepper/pepper_browser_font_singleton_hos
t.h" |
| 6 | 6 |
| 7 #include "base/threading/sequenced_worker_pool.h" | 7 #include "base/threading/sequenced_worker_pool.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "content/common/font_list.h" | 9 #include "content/common/font_list.h" |
| 10 #include "content/public/browser/browser_ppapi_host.h" | 10 #include "content/public/browser/browser_ppapi_host.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 virtual ~FontMessageFilter(); | 33 virtual ~FontMessageFilter(); |
| 34 | 34 |
| 35 // Message handler. | 35 // Message handler. |
| 36 int32_t OnHostMsgGetFontFamilies(ppapi::host::HostMessageContext* context); | 36 int32_t OnHostMsgGetFontFamilies(ppapi::host::HostMessageContext* context); |
| 37 | 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(FontMessageFilter); | 38 DISALLOW_COPY_AND_ASSIGN(FontMessageFilter); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 FontMessageFilter::FontMessageFilter() { | 41 FontMessageFilter::FontMessageFilter() |
| 42 : ResourceMessageFilter(DELETE_ON_ANY_THREAD) { |
| 42 } | 43 } |
| 43 | 44 |
| 44 FontMessageFilter::~FontMessageFilter() { | 45 FontMessageFilter::~FontMessageFilter() { |
| 45 } | 46 } |
| 46 | 47 |
| 47 scoped_refptr<base::TaskRunner> FontMessageFilter::OverrideTaskRunnerForMessage( | 48 scoped_refptr<base::TaskRunner> FontMessageFilter::OverrideTaskRunnerForMessage( |
| 48 const IPC::Message& msg) { | 49 const IPC::Message& msg) { |
| 49 // Use the blocking pool to get the font list (currently the only message) | 50 // Use the blocking pool to get the font list (currently the only message) |
| 50 // Since getting the font list is non-threadsafe on Linux (for versions of | 51 // Since getting the font list is non-threadsafe on Linux (for versions of |
| 51 // Pango predating 2013), use a sequenced task runner. | 52 // Pango predating 2013), use a sequenced task runner. |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 PP_Resource resource) | 103 PP_Resource resource) |
| 103 : ResourceHost(host->GetPpapiHost(), instance, resource) { | 104 : ResourceHost(host->GetPpapiHost(), instance, resource) { |
| 104 AddFilter(scoped_refptr<ppapi::host::ResourceMessageFilter>( | 105 AddFilter(scoped_refptr<ppapi::host::ResourceMessageFilter>( |
| 105 new FontMessageFilter())); | 106 new FontMessageFilter())); |
| 106 } | 107 } |
| 107 | 108 |
| 108 PepperBrowserFontSingletonHost::~PepperBrowserFontSingletonHost() { | 109 PepperBrowserFontSingletonHost::~PepperBrowserFontSingletonHost() { |
| 109 } | 110 } |
| 110 | 111 |
| 111 } // namespace content | 112 } // namespace content |
| OLD | NEW |