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

Side by Side Diff: content/browser/frame_host/render_frame_message_filter.cc

Issue 2069853002: Ignore certain messages in plugin broker process if they are not sent by the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 6 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
« no previous file with comments | « no previous file | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/frame_host/render_frame_message_filter.h" 5 #include "content/browser/frame_host/render_frame_message_filter.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 OpenChannelToPpapiBrokerCallback(RenderFrameMessageFilter* filter, 115 OpenChannelToPpapiBrokerCallback(RenderFrameMessageFilter* filter,
116 int routing_id) 116 int routing_id)
117 : filter_(filter), 117 : filter_(filter),
118 routing_id_(routing_id) { 118 routing_id_(routing_id) {
119 } 119 }
120 120
121 ~OpenChannelToPpapiBrokerCallback() override {} 121 ~OpenChannelToPpapiBrokerCallback() override {}
122 122
123 void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, 123 void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle,
124 int* renderer_id) override { 124 int* renderer_id) override {
125 // base::kNullProcessHandle indicates that the channel will be used by the
126 // browser itself. Make sure we never output that value here.
127 CHECK_NE(base::kNullProcessHandle, filter_->PeerHandle());
125 *renderer_handle = filter_->PeerHandle(); 128 *renderer_handle = filter_->PeerHandle();
126 *renderer_id = filter_->render_process_id_; 129 *renderer_id = filter_->render_process_id_;
127 } 130 }
128 131
129 void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, 132 void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle,
130 base::ProcessId plugin_pid, 133 base::ProcessId plugin_pid,
131 int /* plugin_child_id */) override { 134 int /* plugin_child_id */) override {
132 filter_->Send(new ViewMsg_PpapiBrokerChannelCreated(routing_id_, 135 filter_->Send(new ViewMsg_PpapiBrokerChannelCreated(routing_id_,
133 plugin_pid, 136 plugin_pid,
134 channel_handle)); 137 channel_handle));
(...skipping 13 matching lines...) Expand all
148 public: 151 public:
149 OpenChannelToPpapiPluginCallback(RenderFrameMessageFilter* filter, 152 OpenChannelToPpapiPluginCallback(RenderFrameMessageFilter* filter,
150 ResourceContext* context, 153 ResourceContext* context,
151 IPC::Message* reply_msg) 154 IPC::Message* reply_msg)
152 : RenderMessageCompletionCallback(filter, reply_msg), 155 : RenderMessageCompletionCallback(filter, reply_msg),
153 context_(context) { 156 context_(context) {
154 } 157 }
155 158
156 void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle, 159 void GetPpapiChannelInfo(base::ProcessHandle* renderer_handle,
157 int* renderer_id) override { 160 int* renderer_id) override {
161 // base::kNullProcessHandle indicates that the channel will be used by the
162 // browser itself. Make sure we never output that value here.
163 CHECK_NE(base::kNullProcessHandle, filter()->PeerHandle());
158 *renderer_handle = filter()->PeerHandle(); 164 *renderer_handle = filter()->PeerHandle();
159 *renderer_id = filter()->render_process_id_; 165 *renderer_id = filter()->render_process_id_;
160 } 166 }
161 167
162 void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle, 168 void OnPpapiChannelOpened(const IPC::ChannelHandle& channel_handle,
163 base::ProcessId plugin_pid, 169 base::ProcessId plugin_pid,
164 int plugin_child_id) override { 170 int plugin_child_id) override {
165 FrameHostMsg_OpenChannelToPepperPlugin::WriteReplyParams( 171 FrameHostMsg_OpenChannelToPepperPlugin::WriteReplyParams(
166 reply_msg(), channel_handle, plugin_pid, plugin_child_id); 172 reply_msg(), channel_handle, plugin_pid, plugin_child_id);
167 SendReplyAndDeleteThis(); 173 SendReplyAndDeleteThis();
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 net::URLRequestContext* context = 525 net::URLRequestContext* context =
520 GetContentClient()->browser()->OverrideRequestContextForURL( 526 GetContentClient()->browser()->OverrideRequestContextForURL(
521 url, resource_context_); 527 url, resource_context_);
522 if (!context) 528 if (!context)
523 context = request_context_->GetURLRequestContext(); 529 context = request_context_->GetURLRequestContext();
524 530
525 return context; 531 return context;
526 } 532 }
527 533
528 } // namespace content 534 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/ppapi_plugin_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698