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

Side by Side Diff: chrome/browser/renderer_host/browser_render_process_host.cc

Issue 113488: Rename RendererSecurityPolicy and move it to browser\. No code change. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 // Represents the browser side of the browser <--> renderer communication 5 // Represents the browser side of the browser <--> renderer communication
6 // channel. There will be one RenderProcessHost per renderer process. 6 // channel. There will be one RenderProcessHost per renderer process.
7 7
8 #include "chrome/browser/renderer_host/browser_render_process_host.h" 8 #include "chrome/browser/renderer_host/browser_render_process_host.h"
9 9
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 11
12 #include <algorithm> 12 #include <algorithm>
13 13
14 #include "app/app_switches.h" 14 #include "app/app_switches.h"
15 #if defined(OS_WIN) 15 #if defined(OS_WIN)
16 #include "app/win_util.h" 16 #include "app/win_util.h"
17 #endif 17 #endif
18 #include "base/command_line.h" 18 #include "base/command_line.h"
19 #include "base/linked_ptr.h" 19 #include "base/linked_ptr.h"
20 #include "base/logging.h" 20 #include "base/logging.h"
21 #include "base/path_service.h" 21 #include "base/path_service.h"
22 #include "base/process_util.h" 22 #include "base/process_util.h"
23 #include "base/rand_util.h" 23 #include "base/rand_util.h"
24 #include "base/scoped_ptr.h" 24 #include "base/scoped_ptr.h"
25 #include "base/shared_memory.h" 25 #include "base/shared_memory.h"
26 #include "base/singleton.h" 26 #include "base/singleton.h"
27 #include "base/string_util.h" 27 #include "base/string_util.h"
28 #include "base/thread.h" 28 #include "base/thread.h"
29 #include "chrome/browser/browser_process.h" 29 #include "chrome/browser/browser_process.h"
30 #include "chrome/browser/child_process_security_policy.h"
30 #include "chrome/browser/extensions/extension_message_service.h" 31 #include "chrome/browser/extensions/extension_message_service.h"
31 #include "chrome/browser/extensions/user_script_master.h" 32 #include "chrome/browser/extensions/user_script_master.h"
32 #include "chrome/browser/history/history.h" 33 #include "chrome/browser/history/history.h"
33 #include "chrome/browser/plugin_service.h" 34 #include "chrome/browser/plugin_service.h"
34 #include "chrome/browser/profile.h" 35 #include "chrome/browser/profile.h"
35 #include "chrome/browser/renderer_host/render_view_host.h" 36 #include "chrome/browser/renderer_host/render_view_host.h"
36 #include "chrome/browser/renderer_host/render_widget_helper.h" 37 #include "chrome/browser/renderer_host/render_widget_helper.h"
37 #include "chrome/browser/renderer_host/render_widget_host.h" 38 #include "chrome/browser/renderer_host/render_widget_host.h"
38 #include "chrome/browser/renderer_host/renderer_security_policy.h"
39 #include "chrome/browser/renderer_host/resource_message_filter.h" 39 #include "chrome/browser/renderer_host/resource_message_filter.h"
40 #include "chrome/browser/renderer_host/web_cache_manager.h" 40 #include "chrome/browser/renderer_host/web_cache_manager.h"
41 #include "chrome/browser/visitedlink_master.h" 41 #include "chrome/browser/visitedlink_master.h"
42 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
43 #include "chrome/common/child_process_info.h" 43 #include "chrome/common/child_process_info.h"
44 #include "chrome/common/logging_chrome.h" 44 #include "chrome/common/logging_chrome.h"
45 #include "chrome/common/notification_service.h" 45 #include "chrome/common/notification_service.h"
46 #include "chrome/common/process_watcher.h" 46 #include "chrome/common/process_watcher.h"
47 #include "chrome/common/render_messages.h" 47 #include "chrome/common/render_messages.h"
48 #include "chrome/common/result_codes.h" 48 #include "chrome/common/result_codes.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 // Note: When we create the BrowserRenderProcessHost, it's technically 149 // Note: When we create the BrowserRenderProcessHost, it's technically
150 // backgrounded, because it has no visible listeners. But the process 150 // backgrounded, because it has no visible listeners. But the process
151 // doesn't actually exist yet, so we'll Background it later, after 151 // doesn't actually exist yet, so we'll Background it later, after
152 // creation. 152 // creation.
153 } 153 }
154 154
155 BrowserRenderProcessHost::~BrowserRenderProcessHost() { 155 BrowserRenderProcessHost::~BrowserRenderProcessHost() {
156 if (pid() >= 0) { 156 if (pid() >= 0) {
157 WebCacheManager::GetInstance()->Remove(pid()); 157 WebCacheManager::GetInstance()->Remove(pid());
158 RendererSecurityPolicy::GetInstance()->Remove(pid()); 158 ChildProcessSecurityPolicy::GetInstance()->Remove(pid());
159 } 159 }
160 160
161 // We may have some unsent messages at this point, but that's OK. 161 // We may have some unsent messages at this point, but that's OK.
162 channel_.reset(); 162 channel_.reset();
163 163
164 // Destroy the AudioRendererHost properly. 164 // Destroy the AudioRendererHost properly.
165 if (audio_renderer_host_.get()) 165 if (audio_renderer_host_.get())
166 audio_renderer_host_->Destroy(); 166 audio_renderer_host_->Destroy();
167 167
168 if (process_.handle() && !run_renderer_in_process()) { 168 if (process_.handle() && !run_renderer_in_process()) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 if (!process) { 335 if (!process) {
336 channel_.reset(); 336 channel_.reset();
337 return false; 337 return false;
338 } 338 }
339 process_.set_handle(process); 339 process_.set_handle(process);
340 SetProcessID(process_.pid()); 340 SetProcessID(process_.pid());
341 } 341 }
342 342
343 resource_message_filter->Init(pid()); 343 resource_message_filter->Init(pid());
344 WebCacheManager::GetInstance()->Add(pid()); 344 WebCacheManager::GetInstance()->Add(pid());
345 RendererSecurityPolicy::GetInstance()->Add(pid()); 345 ChildProcessSecurityPolicy::GetInstance()->Add(pid());
346 346
347 // Now that the process is created, set its backgrounding accordingly. 347 // Now that the process is created, set its backgrounding accordingly.
348 SetBackgrounded(backgrounded_); 348 SetBackgrounded(backgrounded_);
349 349
350 InitVisitedLinks(); 350 InitVisitedLinks();
351 InitUserScripts(); 351 InitUserScripts();
352 InitExtensions(); 352 InitExtensions();
353 353
354 if (max_page_id_ != -1) 354 if (max_page_id_ != -1)
355 channel_->Send(new ViewMsg_SetNextPageID(max_page_id_ + 1)); 355 channel_->Send(new ViewMsg_SetNextPageID(max_page_id_ + 1));
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); 795 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context);
796 ems->AddEventListener(event_name, pid()); 796 ems->AddEventListener(event_name, pid());
797 } 797 }
798 798
799 void BrowserRenderProcessHost::OnExtensionRemoveListener( 799 void BrowserRenderProcessHost::OnExtensionRemoveListener(
800 const std::string& event_name) { 800 const std::string& event_name) {
801 URLRequestContext* context = profile()->GetRequestContext(); 801 URLRequestContext* context = profile()->GetRequestContext();
802 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context); 802 ExtensionMessageService* ems = ExtensionMessageService::GetInstance(context);
803 ems->RemoveEventListener(event_name, pid()); 803 ems->RemoveEventListener(event_name, pid());
804 } 804 }
OLDNEW
« no previous file with comments | « chrome/browser/child_process_security_policy_unittest.cc ('k') | chrome/browser/renderer_host/render_view_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698