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

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

Issue 281803003: Add PPAPI_BEGIN_MESSAGE_MAP and PPAPI_END_MESSAGE_MAP to be used when dispatching IPCs using PPAPI_… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 | 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 // Since getting the font list is non-threadsafe on Linux (for versions of 48 // Since getting the font list is non-threadsafe on Linux (for versions of
49 // Pango predating 2013), use a sequenced task runner. 49 // Pango predating 2013), use a sequenced task runner.
50 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); 50 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool();
51 return pool->GetSequencedTaskRunner( 51 return pool->GetSequencedTaskRunner(
52 pool->GetNamedSequenceToken(kFontListSequenceToken)); 52 pool->GetNamedSequenceToken(kFontListSequenceToken));
53 } 53 }
54 54
55 int32_t FontMessageFilter::OnResourceMessageReceived( 55 int32_t FontMessageFilter::OnResourceMessageReceived(
56 const IPC::Message& msg, 56 const IPC::Message& msg,
57 ppapi::host::HostMessageContext* context) { 57 ppapi::host::HostMessageContext* context) {
58 IPC_BEGIN_MESSAGE_MAP(FontMessageFilter, msg) 58 PPAPI_BEGIN_MESSAGE_MAP(FontMessageFilter, msg)
59 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( 59 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(
60 PpapiHostMsg_BrowserFontSingleton_GetFontFamilies, 60 PpapiHostMsg_BrowserFontSingleton_GetFontFamilies,
61 OnHostMsgGetFontFamilies) 61 OnHostMsgGetFontFamilies)
62 IPC_END_MESSAGE_MAP() 62 PPAPI_END_MESSAGE_MAP()
63 return PP_ERROR_FAILED; 63 return PP_ERROR_FAILED;
64 } 64 }
65 65
66 int32_t FontMessageFilter::OnHostMsgGetFontFamilies( 66 int32_t FontMessageFilter::OnHostMsgGetFontFamilies(
67 ppapi::host::HostMessageContext* context) { 67 ppapi::host::HostMessageContext* context) {
68 // OK to use "slow blocking" version since we're on the blocking pool. 68 // OK to use "slow blocking" version since we're on the blocking pool.
69 scoped_ptr<base::ListValue> list(GetFontList_SlowBlocking()); 69 scoped_ptr<base::ListValue> list(GetFontList_SlowBlocking());
70 70
71 std::string output; 71 std::string output;
72 for (size_t i = 0; i < list->GetSize(); i++) { 72 for (size_t i = 0; i < list->GetSize(); i++) {
(...skipping 26 matching lines...) Expand all
99 PP_Instance instance, 99 PP_Instance instance,
100 PP_Resource resource) 100 PP_Resource resource)
101 : ResourceHost(host->GetPpapiHost(), instance, resource) { 101 : ResourceHost(host->GetPpapiHost(), instance, resource) {
102 AddFilter(scoped_refptr<ppapi::host::ResourceMessageFilter>( 102 AddFilter(scoped_refptr<ppapi::host::ResourceMessageFilter>(
103 new FontMessageFilter())); 103 new FontMessageFilter()));
104 } 104 }
105 105
106 PepperBrowserFontSingletonHost::~PepperBrowserFontSingletonHost() {} 106 PepperBrowserFontSingletonHost::~PepperBrowserFontSingletonHost() {}
107 107
108 } // namespace content 108 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698