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

Side by Side Diff: ppapi/proxy/ppb_font_proxy.cc

Issue 7053022: Use the WebKit default fonts when specifying generic font families. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ppapi/proxy/ppb_font_proxy.h" 5 #include "ppapi/proxy/ppb_font_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ppapi/c/dev/ppb_font_dev.h" 8 #include "ppapi/c/dev/ppb_font_dev.h"
9 #include "ppapi/proxy/plugin_dispatcher.h" 9 #include "ppapi/proxy/plugin_dispatcher.h"
10 #include "ppapi/proxy/ppapi_messages.h" 10 #include "ppapi/proxy/ppapi_messages.h"
11 #include "ppapi/proxy/ppb_image_data_proxy.h" 11 #include "ppapi/proxy/ppb_image_data_proxy.h"
12 #include "ppapi/proxy/serialized_var.h" 12 #include "ppapi/proxy/serialized_var.h"
13 #include "ppapi/shared_impl/ppapi_preferences.h"
13 #include "ppapi/shared_impl/resource_object_base.h" 14 #include "ppapi/shared_impl/resource_object_base.h"
14 #include "ppapi/thunk/enter.h" 15 #include "ppapi/thunk/enter.h"
15 #include "ppapi/thunk/ppb_image_data_api.h" 16 #include "ppapi/thunk/ppb_image_data_api.h"
16 #include "ppapi/thunk/thunk.h" 17 #include "ppapi/thunk/thunk.h"
17 18
18 using ppapi::thunk::PPB_ImageData_API; 19 using ppapi::thunk::PPB_ImageData_API;
19 using ppapi::WebKitForwarding; 20 using ppapi::WebKitForwarding;
20 21
21 namespace pp { 22 namespace pp {
22 namespace proxy { 23 namespace proxy {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 webkit_event_(false, false) { 98 webkit_event_(false, false) {
98 const std::string* face = PluginVarTracker::GetInstance()->GetExistingString( 99 const std::string* face = PluginVarTracker::GetInstance()->GetExistingString(
99 desc.face); 100 desc.face);
100 101
101 WebKitForwarding* forwarding = GetDispatcher()->GetWebKitForwarding(); 102 WebKitForwarding* forwarding = GetDispatcher()->GetWebKitForwarding();
102 103
103 WebKitForwarding::Font* result = NULL; 104 WebKitForwarding::Font* result = NULL;
104 RunOnWebKitThread(base::Bind(&WebKitForwarding::CreateFontForwarding, 105 RunOnWebKitThread(base::Bind(&WebKitForwarding::CreateFontForwarding,
105 base::Unretained(forwarding), 106 base::Unretained(forwarding),
106 &webkit_event_, desc, 107 &webkit_event_, desc,
107 face ? *face : std::string(), &result)); 108 face ? *face : std::string(),
109 GetDispatcher()->preferences(),
110 &result));
108 font_forwarding_.reset(result); 111 font_forwarding_.reset(result);
109 } 112 }
110 113
111 Font::~Font() { 114 Font::~Font() {
112 } 115 }
113 116
114 ppapi::thunk::PPB_Font_API* Font::AsFont_API() { 117 ppapi::thunk::PPB_Font_API* Font::AsFont_API() {
115 return this; 118 return this;
116 } 119 }
117 120
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 return result; 220 return result;
218 } 221 }
219 222
220 void Font::RunOnWebKitThread(const base::Closure& task) { 223 void Font::RunOnWebKitThread(const base::Closure& task) {
221 GetDispatcher()->PostToWebKitThread(FROM_HERE, task); 224 GetDispatcher()->PostToWebKitThread(FROM_HERE, task);
222 webkit_event_.Wait(); 225 webkit_event_.Wait();
223 } 226 }
224 227
225 } // namespace proxy 228 } // namespace proxy
226 } // namespace pp 229 } // namespace pp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698