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

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

Issue 283623002: Add support for passing an arbitrary parameter to an IPC message handler. The motivation is for Web… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: sync 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 "chrome/renderer/pepper/pepper_flash_renderer_host.h" 5 #include "chrome/renderer/pepper/pepper_flash_renderer_host.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // This object may be destroyed in the middle of a sync message. If that is 146 // This object may be destroyed in the middle of a sync message. If that is
147 // the case, make sure we respond to all the pending navigate calls. 147 // the case, make sure we respond to all the pending navigate calls.
148 std::vector<ppapi::host::ReplyMessageContext>::reverse_iterator it; 148 std::vector<ppapi::host::ReplyMessageContext>::reverse_iterator it;
149 for (it = navigate_replies_.rbegin(); it != navigate_replies_.rend(); ++it) 149 for (it = navigate_replies_.rbegin(); it != navigate_replies_.rend(); ++it)
150 SendReply(*it, IPC::Message()); 150 SendReply(*it, IPC::Message());
151 } 151 }
152 152
153 int32_t PepperFlashRendererHost::OnResourceMessageReceived( 153 int32_t PepperFlashRendererHost::OnResourceMessageReceived(
154 const IPC::Message& msg, 154 const IPC::Message& msg,
155 ppapi::host::HostMessageContext* context) { 155 ppapi::host::HostMessageContext* context) {
156 IPC_BEGIN_MESSAGE_MAP(PepperFlashRendererHost, msg) 156 PPAPI_BEGIN_MESSAGE_MAP(PepperFlashRendererHost, msg)
157 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetProxyForURL, 157 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetProxyForURL,
158 OnGetProxyForURL); 158 OnGetProxyForURL)
159 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_SetInstanceAlwaysOnTop, 159 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_SetInstanceAlwaysOnTop,
160 OnSetInstanceAlwaysOnTop); 160 OnSetInstanceAlwaysOnTop)
161 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_DrawGlyphs, 161 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_DrawGlyphs,
162 OnDrawGlyphs); 162 OnDrawGlyphs)
163 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_Navigate, OnNavigate); 163 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_Navigate, OnNavigate)
164 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_IsRectTopmost, 164 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_IsRectTopmost,
165 OnIsRectTopmost); 165 OnIsRectTopmost)
166 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_InvokePrinting, 166 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_InvokePrinting,
167 OnInvokePrinting); 167 OnInvokePrinting)
168 IPC_END_MESSAGE_MAP() 168 PPAPI_END_MESSAGE_MAP()
169 return PP_ERROR_FAILED; 169 return PP_ERROR_FAILED;
170 } 170 }
171 171
172 int32_t PepperFlashRendererHost::OnGetProxyForURL( 172 int32_t PepperFlashRendererHost::OnGetProxyForURL(
173 ppapi::host::HostMessageContext* host_context, 173 ppapi::host::HostMessageContext* host_context,
174 const std::string& url) { 174 const std::string& url) {
175 GURL gurl(url); 175 GURL gurl(url);
176 if (!gurl.is_valid()) 176 if (!gurl.is_valid())
177 return PP_ERROR_FAILED; 177 return PP_ERROR_FAILED;
178 std::string proxy; 178 std::string proxy;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 rect.point.x, rect.point.y, rect.size.width, rect.size.height))) 372 rect.point.x, rect.point.y, rect.size.width, rect.size.height)))
373 return PP_OK; 373 return PP_OK;
374 return PP_ERROR_FAILED; 374 return PP_ERROR_FAILED;
375 } 375 }
376 376
377 int32_t PepperFlashRendererHost::OnInvokePrinting( 377 int32_t PepperFlashRendererHost::OnInvokePrinting(
378 ppapi::host::HostMessageContext* host_context) { 378 ppapi::host::HostMessageContext* host_context) {
379 PPB_PDF_Impl::InvokePrintingForInstance(pp_instance()); 379 PPB_PDF_Impl::InvokePrintingForInstance(pp_instance());
380 return PP_OK; 380 return PP_OK;
381 } 381 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698