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

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

Issue 23444004: Add GetPluginRefererURL to PPB_URLUtil_Dev interface to get the 'Referer' HTTP header value that wa… (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 3 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 "ppapi/proxy/ppb_instance_proxy.h" 5 #include "ppapi/proxy/ppb_instance_proxy.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
10 #include "ppapi/c/pp_time.h" 10 #include "ppapi/c/pp_time.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDocumentURL, 166 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetDocumentURL,
167 OnHostMsgGetDocumentURL) 167 OnHostMsgGetDocumentURL)
168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ResolveRelativeToDocument, 168 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_ResolveRelativeToDocument,
169 OnHostMsgResolveRelativeToDocument) 169 OnHostMsgResolveRelativeToDocument)
170 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanRequest, 170 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanRequest,
171 OnHostMsgDocumentCanRequest) 171 OnHostMsgDocumentCanRequest)
172 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanAccessDocument, 172 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DocumentCanAccessDocument,
173 OnHostMsgDocumentCanAccessDocument) 173 OnHostMsgDocumentCanAccessDocument)
174 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL, 174 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginInstanceURL,
175 OnHostMsgGetPluginInstanceURL) 175 OnHostMsgGetPluginInstanceURL)
176 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_GetPluginRefererURL,
177 OnHostMsgGetPluginRefererURL)
176 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NeedKey, 178 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_NeedKey,
177 OnHostMsgNeedKey) 179 OnHostMsgNeedKey)
178 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded, 180 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyAdded,
179 OnHostMsgKeyAdded) 181 OnHostMsgKeyAdded)
180 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage, 182 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyMessage,
181 OnHostMsgKeyMessage) 183 OnHostMsgKeyMessage)
182 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError, 184 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_KeyError,
183 OnHostMsgKeyError) 185 OnHostMsgKeyError)
184 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock, 186 IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_DeliverBlock,
185 OnHostMsgDeliverBlock) 187 OnHostMsgDeliverBlock)
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 PP_Instance instance, 521 PP_Instance instance,
520 PP_URLComponents_Dev* components) { 522 PP_URLComponents_Dev* components) {
521 ReceiveSerializedVarReturnValue result; 523 ReceiveSerializedVarReturnValue result;
522 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetPluginInstanceURL( 524 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetPluginInstanceURL(
523 API_ID_PPB_INSTANCE, instance, &result)); 525 API_ID_PPB_INSTANCE, instance, &result));
524 return PPB_URLUtil_Shared::ConvertComponentsAndReturnURL( 526 return PPB_URLUtil_Shared::ConvertComponentsAndReturnURL(
525 result.Return(dispatcher()), 527 result.Return(dispatcher()),
526 components); 528 components);
527 } 529 }
528 530
531 PP_Var PPB_Instance_Proxy::GetPluginRefererURL(
532 PP_Instance instance,
533 PP_URLComponents_Dev* components) {
534 ReceiveSerializedVarReturnValue result;
535 dispatcher()->Send(new PpapiHostMsg_PPBInstance_GetPluginRefererURL(
536 API_ID_PPB_INSTANCE, instance, &result));
537 return PPB_URLUtil_Shared::ConvertComponentsAndReturnURL(
538 result.Return(dispatcher()),
539 components);
540 }
541
529 void PPB_Instance_Proxy::NeedKey(PP_Instance instance, 542 void PPB_Instance_Proxy::NeedKey(PP_Instance instance,
530 PP_Var key_system, 543 PP_Var key_system,
531 PP_Var session_id, 544 PP_Var session_id,
532 PP_Var init_data) { 545 PP_Var init_data) {
533 dispatcher()->Send( 546 dispatcher()->Send(
534 new PpapiHostMsg_PPBInstance_NeedKey( 547 new PpapiHostMsg_PPBInstance_NeedKey(
535 API_ID_PPB_INSTANCE, 548 API_ID_PPB_INSTANCE,
536 instance, 549 instance,
537 SerializedVarSendInput(dispatcher(), key_system), 550 SerializedVarSendInput(dispatcher(), key_system),
538 SerializedVarSendInput(dispatcher(), session_id), 551 SerializedVarSendInput(dispatcher(), session_id),
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 SerializedVarReturnValue result) { 1038 SerializedVarReturnValue result) {
1026 if (!dispatcher()->permissions().HasPermission(PERMISSION_DEV)) 1039 if (!dispatcher()->permissions().HasPermission(PERMISSION_DEV))
1027 return; 1040 return;
1028 EnterInstanceNoLock enter(instance); 1041 EnterInstanceNoLock enter(instance);
1029 if (enter.succeeded()) { 1042 if (enter.succeeded()) {
1030 result.Return(dispatcher(), 1043 result.Return(dispatcher(),
1031 enter.functions()->GetPluginInstanceURL(instance, NULL)); 1044 enter.functions()->GetPluginInstanceURL(instance, NULL));
1032 } 1045 }
1033 } 1046 }
1034 1047
1048 void PPB_Instance_Proxy::OnHostMsgGetPluginRefererURL(
1049 PP_Instance instance,
1050 SerializedVarReturnValue result) {
1051 if (!dispatcher()->permissions().HasPermission(PERMISSION_DEV))
1052 return;
1053 EnterInstanceNoLock enter(instance);
1054 if (enter.succeeded()) {
1055 result.Return(dispatcher(),
1056 enter.functions()->GetPluginRefererURL(instance, NULL));
1057 }
1058 }
1059
1035 void PPB_Instance_Proxy::OnHostMsgNeedKey(PP_Instance instance, 1060 void PPB_Instance_Proxy::OnHostMsgNeedKey(PP_Instance instance,
1036 SerializedVarReceiveInput key_system, 1061 SerializedVarReceiveInput key_system,
1037 SerializedVarReceiveInput session_id, 1062 SerializedVarReceiveInput session_id,
1038 SerializedVarReceiveInput init_data) { 1063 SerializedVarReceiveInput init_data) {
1039 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE)) 1064 if (!dispatcher()->permissions().HasPermission(PERMISSION_PRIVATE))
1040 return; 1065 return;
1041 EnterInstanceNoLock enter(instance); 1066 EnterInstanceNoLock enter(instance);
1042 if (enter.succeeded()) { 1067 if (enter.succeeded()) {
1043 enter.functions()->NeedKey(instance, 1068 enter.functions()->NeedKey(instance,
1044 key_system.Get(dispatcher()), 1069 key_system.Get(dispatcher()),
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1268 PP_Instance instance) { 1293 PP_Instance instance) {
1269 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1294 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1270 GetInstanceData(instance); 1295 GetInstanceData(instance);
1271 if (!data) 1296 if (!data)
1272 return; // Instance was probably deleted. 1297 return; // Instance was probably deleted.
1273 data->should_do_request_surrounding_text = false; 1298 data->should_do_request_surrounding_text = false;
1274 } 1299 }
1275 1300
1276 } // namespace proxy 1301 } // namespace proxy
1277 } // namespace ppapi 1302 } // namespace ppapi
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698