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

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

Issue 23548008: Don't set the request target type to object when navigating from a Pepper plug-in. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check for subframe 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/renderer/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 2739 matching lines...) Expand 10 before | Expand all | Expand 10 after
2750 2750
2751 WebDocument document = container_->element().document(); 2751 WebDocument document = container_->element().document();
2752 WebFrame* frame = document.frame(); 2752 WebFrame* frame = document.frame();
2753 if (!frame) 2753 if (!frame)
2754 return PP_ERROR_FAILED; 2754 return PP_ERROR_FAILED;
2755 2755
2756 ppapi::URLRequestInfoData completed_request = request; 2756 ppapi::URLRequestInfoData completed_request = request;
2757 2757
2758 WebURLRequest web_request; 2758 WebURLRequest web_request;
2759 if (!CreateWebURLRequest(&completed_request, 2759 if (!CreateWebURLRequest(&completed_request,
2760 WebURLRequest::TargetIsMainFrame, 2760 frame->parent() ?
yzshen1 2013/09/03 21:04:26 (forgive me if I misunderstand this) I thought wh
Bernhard Bauer 2013/09/03 21:15:09 Hm, I think we don't have a target in all cases, i
yzshen1 2013/09/03 21:19:42 I don't know the answer. I think we could look int
Bernhard Bauer 2013/09/03 21:59:27 Hm, I think so; see https://code.google.com/p/chro
2761 WebURLRequest::TargetIsSubframe :
2762 WebURLRequest::TargetIsMainFrame,
2761 frame, 2763 frame,
2762 &web_request)) 2764 &web_request)) {
2763 return PP_ERROR_FAILED; 2765 return PP_ERROR_FAILED;
2766 }
2767
2764 web_request.setFirstPartyForCookies(document.firstPartyForCookies()); 2768 web_request.setFirstPartyForCookies(document.firstPartyForCookies());
2765 web_request.setHasUserGesture(from_user_action); 2769 web_request.setHasUserGesture(from_user_action);
2766 2770
2767 GURL gurl(web_request.url()); 2771 GURL gurl(web_request.url());
2768 if (gurl.SchemeIs("javascript")) { 2772 if (gurl.SchemeIs("javascript")) {
2769 // In imitation of the NPAPI implementation, only |target_frame == frame| is 2773 // In imitation of the NPAPI implementation, only |target_frame == frame| is
2770 // allowed for security reasons. 2774 // allowed for security reasons.
2771 WebFrame* target_frame = 2775 WebFrame* target_frame =
2772 frame->view()->findFrameByName(WebString::fromUTF8(target), frame); 2776 frame->view()->findFrameByName(WebString::fromUTF8(target), frame);
2773 if (target_frame != frame) 2777 if (target_frame != frame)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
2909 // Running out-of-process. Initiate an IPC call to notify the plugin 2913 // Running out-of-process. Initiate an IPC call to notify the plugin
2910 // process. 2914 // process.
2911 ppapi::proxy::HostDispatcher* dispatcher = 2915 ppapi::proxy::HostDispatcher* dispatcher =
2912 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance()); 2916 ppapi::proxy::HostDispatcher::GetForInstance(pp_instance());
2913 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad( 2917 dispatcher->Send(new PpapiMsg_PPPInstance_HandleDocumentLoad(
2914 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data)); 2918 ppapi::API_ID_PPP_INSTANCE, pp_instance(), pending_host_id, data));
2915 } 2919 }
2916 } 2920 }
2917 2921
2918 } // namespace content 2922 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698