| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/renderer_host/browser_render_process_host.h" | 8 #include "content/browser/renderer_host/browser_render_process_host.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 // We may have some unsent messages at this point, but that's OK. | 237 // We may have some unsent messages at this point, but that's OK. |
| 238 channel_.reset(); | 238 channel_.reset(); |
| 239 while (!queued_messages_.empty()) { | 239 while (!queued_messages_.empty()) { |
| 240 delete queued_messages_.front(); | 240 delete queued_messages_.front(); |
| 241 queued_messages_.pop(); | 241 queued_messages_.pop(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 ClearTransportDIBCache(); | 244 ClearTransportDIBCache(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void BrowserRenderProcessHost::PrepareForReuse() { |
| 248 // Reset is_initialized_ so we start queuing up messages passed to Send. |
| 249 is_initialized_ = false; |
| 250 } |
| 251 |
| 247 bool BrowserRenderProcessHost::Init(bool is_accessibility_enabled) { | 252 bool BrowserRenderProcessHost::Init(bool is_accessibility_enabled) { |
| 248 // calling Init() more than once does nothing, this makes it more convenient | 253 // calling Init() more than once does nothing, this makes it more convenient |
| 249 // for the view host which may not be sure in some cases | 254 // for the view host which may not be sure in some cases |
| 250 if (channel_.get()) | 255 if (channel_.get()) |
| 251 return true; | 256 return true; |
| 252 | 257 |
| 253 accessibility_enabled_ = is_accessibility_enabled; | 258 accessibility_enabled_ = is_accessibility_enabled; |
| 254 | 259 |
| 255 CommandLine::StringType renderer_prefix; | 260 CommandLine::StringType renderer_prefix; |
| 256 #if defined(OS_POSIX) | 261 #if defined(OS_POSIX) |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 912 void BrowserRenderProcessHost::OnUserMetricsRecordAction( | 917 void BrowserRenderProcessHost::OnUserMetricsRecordAction( |
| 913 const std::string& action) { | 918 const std::string& action) { |
| 914 UserMetrics::RecordComputedAction(action); | 919 UserMetrics::RecordComputedAction(action); |
| 915 } | 920 } |
| 916 | 921 |
| 917 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { | 922 void BrowserRenderProcessHost::OnRevealFolderInOS(const FilePath& path) { |
| 918 // Only honor the request if appropriate persmissions are granted. | 923 // Only honor the request if appropriate persmissions are granted. |
| 919 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) | 924 if (ChildProcessSecurityPolicy::GetInstance()->CanReadFile(id(), path)) |
| 920 content::GetContentClient()->browser()->RevealFolderInOS(path); | 925 content::GetContentClient()->browser()->RevealFolderInOS(path); |
| 921 } | 926 } |
| OLD | NEW |