OLD | NEW |
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/renderer/pepper/pepper_flash_renderer_host.h" | 5 #include "content/renderer/pepper/pepper_flash_renderer_host.h" |
6 | 6 |
7 #include "content/common/view_messages.h" | 7 #include "content/public/renderer/render_thread.h" |
8 #include "content/public/renderer/renderer_ppapi_host.h" | 8 #include "content/public/renderer/renderer_ppapi_host.h" |
9 #include "content/renderer/render_thread_impl.h" | |
10 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
11 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
12 #include "ppapi/c/pp_errors.h" | 11 #include "ppapi/c/pp_errors.h" |
13 #include "ppapi/host/dispatch_host_message.h" | 12 #include "ppapi/host/dispatch_host_message.h" |
14 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
15 #include "ppapi/proxy/resource_message_params.h" | 14 #include "ppapi/proxy/resource_message_params.h" |
16 | 15 |
17 namespace content { | 16 namespace content { |
18 | 17 |
19 PepperFlashRendererHost::PepperFlashRendererHost( | 18 PepperFlashRendererHost::PepperFlashRendererHost( |
(...skipping 15 matching lines...) Expand all Loading... |
35 IPC_END_MESSAGE_MAP() | 34 IPC_END_MESSAGE_MAP() |
36 return PP_ERROR_FAILED; | 35 return PP_ERROR_FAILED; |
37 } | 36 } |
38 | 37 |
39 int32_t PepperFlashRendererHost::OnMsgGetProxyForURL( | 38 int32_t PepperFlashRendererHost::OnMsgGetProxyForURL( |
40 ppapi::host::HostMessageContext* host_context, | 39 ppapi::host::HostMessageContext* host_context, |
41 const std::string& url) { | 40 const std::string& url) { |
42 GURL gurl(url); | 41 GURL gurl(url); |
43 if (!gurl.is_valid()) | 42 if (!gurl.is_valid()) |
44 return PP_ERROR_FAILED; | 43 return PP_ERROR_FAILED; |
45 bool result; | |
46 std::string proxy; | 44 std::string proxy; |
47 RenderThreadImpl::current()->Send( | 45 bool result = RenderThread::Get()->ResolveProxy(gurl, &proxy); |
48 new ViewHostMsg_ResolveProxy(gurl, &result, &proxy)); | |
49 if (!result) | 46 if (!result) |
50 return PP_ERROR_FAILED; | 47 return PP_ERROR_FAILED; |
51 host_context->reply_msg = PpapiPluginMsg_Flash_GetProxyForURLReply(proxy); | 48 host_context->reply_msg = PpapiPluginMsg_Flash_GetProxyForURLReply(proxy); |
52 return PP_OK; | 49 return PP_OK; |
53 } | 50 } |
54 | 51 |
55 } // namespace content | 52 } // namespace content |
OLD | NEW |