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

Unified Diff: content/browser/renderer_host/pepper/pepper_message_filter.cc

Issue 11578038: Convert pepper font list to new resource system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/pepper/pepper_message_filter.cc
diff --git a/content/browser/renderer_host/pepper/pepper_message_filter.cc b/content/browser/renderer_host/pepper/pepper_message_filter.cc
index 3383bba6086d0cfd7d13a09b7cc3f2bec66dab1a..a9c8c628b0954d1bf983462345faf98e5f1161c6 100644
--- a/content/browser/renderer_host/pepper/pepper_message_filter.cc
+++ b/content/browser/renderer_host/pepper/pepper_message_filter.cc
@@ -16,7 +16,6 @@
#include "base/process_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h"
-#include "base/values.h"
#include "build/build_config.h"
#include "content/browser/renderer_host/pepper/pepper_lookup_request.h"
#include "content/browser/renderer_host/pepper/pepper_tcp_server_socket.h"
@@ -28,7 +27,6 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
-#include "content/public/browser/font_list_async.h"
#include "content/public/browser/resource_context.h"
#include "content/public/browser/site_instance.h"
#include "content/public/common/content_client.h"
@@ -140,8 +138,6 @@ bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg,
IPC_BEGIN_MESSAGE_MAP_EX(PepperMessageFilter, msg, *message_was_ok)
IPC_MESSAGE_HANDLER(PepperMsg_GetLocalTimeZoneOffset,
OnGetLocalTimeZoneOffset)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(PpapiHostMsg_PPBInstance_GetFontFamilies,
- OnGetFontFamilies)
// TCP messages.
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTCPSocket_Create, OnTCPCreate)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBTCPSocket_Connect, OnTCPConnect)
@@ -267,12 +263,6 @@ void PepperMessageFilter::OnGetLocalTimeZoneOffset(base::Time t,
}
}
-void PepperMessageFilter::OnGetFontFamilies(IPC::Message* reply_msg) {
- GetFontListAsync(
- base::Bind(&PepperMessageFilter::GetFontFamiliesComplete,
- this, reply_msg));
-}
-
void PepperMessageFilter::OnTCPCreate(int32 routing_id,
uint32 plugin_dispatcher_id,
uint32* socket_id) {
@@ -745,37 +735,6 @@ void PepperMessageFilter::OnGetLocalDataRestrictions(
*restrictions = PP_FLASHLSORESTRICTIONS_NONE;
}
-void PepperMessageFilter::GetFontFamiliesComplete(
- IPC::Message* reply_msg,
- scoped_ptr<base::ListValue> result) {
- std::string output;
- // If this is a NaCl plugin without private permission, we return an empty
- // string in |output|. We must reply to the message.
- if (process_type_ != NACL ||
- permissions_.HasPermission(ppapi::PERMISSION_PRIVATE)) {
- for (size_t i = 0; i < result->GetSize(); i++) {
- base::ListValue* cur_font;
- if (!result->GetList(i, &cur_font))
- continue;
-
- // Each entry is actually a list of (font name, localized name).
- // We only care about the regular name.
- std::string font_name;
- if (!cur_font->GetString(0, &font_name))
- continue;
-
- // Font names are separated with nulls. We also want an explicit null at
- // the end of the string (Pepper strings aren't null terminated so since
- // we specify there will be a null, it should actually be in the string).
- output.append(font_name);
- output.push_back(0);
- }
- }
-
- PpapiHostMsg_PPBInstance_GetFontFamilies::WriteReplyParams(reply_msg, output);
- Send(reply_msg);
-}
-
uint32 PepperMessageFilter::GenerateSocketID() {
// TODO(yzshen): Change to use Pepper resource ID as socket ID.
//

Powered by Google App Engine
This is Rietveld 408576698