OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser_plugin/browser_plugin_guest_manager.h" | 5 #include "content/browser/browser_plugin/browser_plugin_guest_manager.h" |
6 | 6 |
7 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 7 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
8 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" | 8 #include "content/browser/browser_plugin/browser_plugin_host_factory.h" |
9 #include "content/browser/renderer_host/render_view_host_impl.h" | 9 #include "content/browser/renderer_host/render_view_host_impl.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 SiteInstance* embedder_site_instance, | 71 SiteInstance* embedder_site_instance, |
72 int instance_id, | 72 int instance_id, |
73 const BrowserPluginHostMsg_Attach_Params& params, | 73 const BrowserPluginHostMsg_Attach_Params& params, |
74 scoped_ptr<base::DictionaryValue> extra_params) { | 74 scoped_ptr<base::DictionaryValue> extra_params) { |
75 RenderProcessHost* embedder_process_host = | 75 RenderProcessHost* embedder_process_host = |
76 embedder_site_instance->GetProcess(); | 76 embedder_site_instance->GetProcess(); |
77 // Validate that the partition id coming from the renderer is valid UTF-8, | 77 // Validate that the partition id coming from the renderer is valid UTF-8, |
78 // since we depend on this in other parts of the code, such as FilePath | 78 // since we depend on this in other parts of the code, such as FilePath |
79 // creation. If the validation fails, treat it as a bad message and kill the | 79 // creation. If the validation fails, treat it as a bad message and kill the |
80 // renderer process. | 80 // renderer process. |
81 if (!IsStringUTF8(params.storage_partition_id)) { | 81 if (!base::IsStringUTF8(params.storage_partition_id)) { |
82 content::RecordAction( | 82 content::RecordAction( |
83 base::UserMetricsAction("BadMessageTerminate_BPGM")); | 83 base::UserMetricsAction("BadMessageTerminate_BPGM")); |
84 base::KillProcess( | 84 base::KillProcess( |
85 embedder_process_host->GetHandle(), | 85 embedder_process_host->GetHandle(), |
86 content::RESULT_CODE_KILLED_BAD_MESSAGE, false); | 86 content::RESULT_CODE_KILLED_BAD_MESSAGE, false); |
87 return NULL; | 87 return NULL; |
88 } | 88 } |
89 | 89 |
90 const GURL& embedder_site_url = embedder_site_instance->GetSiteURL(); | 90 const GURL& embedder_site_url = embedder_site_instance->GetSiteURL(); |
91 const std::string& host = embedder_site_url.host(); | 91 const std::string& host = embedder_site_url.host(); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 bool BrowserPluginGuestManager::ForEachGuest( | 190 bool BrowserPluginGuestManager::ForEachGuest( |
191 WebContents* embedder_web_contents, const GuestCallback& callback) { | 191 WebContents* embedder_web_contents, const GuestCallback& callback) { |
192 if (!GetDelegate()) | 192 if (!GetDelegate()) |
193 return false; | 193 return false; |
194 return GetDelegate()->ForEachGuest(embedder_web_contents, | 194 return GetDelegate()->ForEachGuest(embedder_web_contents, |
195 base::Bind(&BrowserPluginGuestCallback, | 195 base::Bind(&BrowserPluginGuestCallback, |
196 callback)); | 196 callback)); |
197 } | 197 } |
198 | 198 |
199 } // namespace content | 199 } // namespace content |
OLD | NEW |