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

Side by Side Diff: content/browser/renderer_host/pepper/pepper_browser_font_singleton_host.cc

Issue 53153002: Pepper: always delete ResourceMessageFilter objects on the creation thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698