| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/guest_view/guest_view_manager.h" | 5 #include "chrome/browser/guest_view/guest_view_manager.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/guest_view/guest_view_base.h" | 9 #include "chrome/browser/guest_view/guest_view_base.h" |
| 10 #include "chrome/browser/guest_view/guest_view_constants.h" | 10 #include "chrome/browser/guest_view/guest_view_constants.h" |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 guest_web_contents_by_instance_id_.find(guest_instance_id); | 240 guest_web_contents_by_instance_id_.find(guest_instance_id); |
| 241 if (it == guest_web_contents_by_instance_id_.end()) | 241 if (it == guest_web_contents_by_instance_id_.end()) |
| 242 return NULL; | 242 return NULL; |
| 243 return it->second; | 243 return it->second; |
| 244 } | 244 } |
| 245 | 245 |
| 246 bool GuestViewManager::CanEmbedderAccessInstanceIDMaybeKill( | 246 bool GuestViewManager::CanEmbedderAccessInstanceIDMaybeKill( |
| 247 int embedder_render_process_id, | 247 int embedder_render_process_id, |
| 248 int guest_instance_id) { | 248 int guest_instance_id) { |
| 249 if (!CanEmbedderAccessInstanceID(embedder_render_process_id, | 249 if (!CanEmbedderAccessInstanceID(embedder_render_process_id, |
| 250 guest_instance_id)) { | 250 guest_instance_id)) { |
| 251 // The embedder process is trying to access a guest it does not own. | 251 // The embedder process is trying to access a guest it does not own. |
| 252 content::RecordAction( | 252 content::RecordAction( |
| 253 base::UserMetricsAction("BadMessageTerminate_BPGM")); | 253 base::UserMetricsAction("BadMessageTerminate_BPGM")); |
| 254 base::KillProcess( | 254 base::KillProcess( |
| 255 content::RenderProcessHost::FromID(embedder_render_process_id)-> | 255 content::RenderProcessHost::FromID(embedder_render_process_id)-> |
| 256 GetHandle(), | 256 GetHandle(), |
| 257 content::RESULT_CODE_KILLED_BAD_MESSAGE, false); | 257 content::RESULT_CODE_KILLED_BAD_MESSAGE, false); |
| 258 return false; | 258 return false; |
| 259 } | 259 } |
| 260 return true; | 260 return true; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 return false; | 302 return false; |
| 303 | 303 |
| 304 return embedder_render_process_id == | 304 return embedder_render_process_id == |
| 305 guest->GetOpener()->embedder_web_contents()->GetRenderProcessHost()-> | 305 guest->GetOpener()->embedder_web_contents()->GetRenderProcessHost()-> |
| 306 GetID(); | 306 GetID(); |
| 307 } | 307 } |
| 308 | 308 |
| 309 return embedder_render_process_id == | 309 return embedder_render_process_id == |
| 310 guest->embedder_web_contents()->GetRenderProcessHost()->GetID(); | 310 guest->embedder_web_contents()->GetRenderProcessHost()->GetID(); |
| 311 } | 311 } |
| OLD | NEW |