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

Side by Side Diff: content/renderer/pepper/pepper_flash_renderer_host.cc

Issue 11415140: Refactor 3 PPB_Flash functions to the new resource model. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/renderer/pepper/pepper_flash_renderer_host.h"
6
7 #include "content/common/view_messages.h"
8 #include "content/public/renderer/renderer_ppapi_host.h"
9 #include "content/renderer/render_thread_impl.h"
10 #include "googleurl/src/gurl.h"
11 #include "ipc/ipc_message_macros.h"
12 #include "ppapi/c/pp_errors.h"
13 #include "ppapi/host/dispatch_host_message.h"
14 #include "ppapi/proxy/ppapi_messages.h"
15 #include "ppapi/proxy/resource_message_params.h"
16
17 namespace content {
18
19 PepperFlashRendererHost::PepperFlashRendererHost(
20 RendererPpapiHost* host,
21 PP_Instance instance,
22 PP_Resource resource)
23 : ResourceHost(host->GetPpapiHost(), instance, resource) {
24 }
25
26 PepperFlashRendererHost::~PepperFlashRendererHost() {
27 }
28
29 int32_t PepperFlashRendererHost::OnResourceMessageReceived(
30 const IPC::Message& msg,
31 ppapi::host::HostMessageContext* context) {
32 IPC_BEGIN_MESSAGE_MAP(PepperFlashRendererHost, msg)
33 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetProxyForURL,
34 OnMsgGetProxyForURL);
35 IPC_END_MESSAGE_MAP()
36 return PP_ERROR_FAILED;
37 }
38
39 int32_t PepperFlashRendererHost::OnMsgGetProxyForURL(
40 ppapi::host::HostMessageContext* host_context,
41 const std::string& url) {
42 bool result;
brettw 2012/11/30 23:29:25 Random nit: I'd put these two out params right abo
raymes 2012/12/03 17:30:31 Done.
43 std::string proxy;
44 GURL gurl(url);
45 if (!gurl.is_valid())
46 return PP_ERROR_FAILED;
47 RenderThreadImpl::current()->Send(
48 new ViewHostMsg_ResolveProxy(gurl, &result, &proxy));
49 if (!result)
50 return PP_ERROR_FAILED;
51 host_context->reply_msg = PpapiPluginMsg_Flash_GetProxyForURLReply(proxy);
52 return PP_OK;
53 }
54
55 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698