| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/render_process_host_impl.h" | 8 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 sudden_termination_allowed_(true), | 337 sudden_termination_allowed_(true), |
| 338 ignore_input_events_(false), | 338 ignore_input_events_(false), |
| 339 #if defined(OS_ANDROID) | 339 #if defined(OS_ANDROID) |
| 340 dummy_shutdown_event_(false, false), | 340 dummy_shutdown_event_(false, false), |
| 341 #endif | 341 #endif |
| 342 is_guest_(is_guest) { | 342 is_guest_(is_guest) { |
| 343 widget_helper_ = new RenderWidgetHelper(); | 343 widget_helper_ = new RenderWidgetHelper(); |
| 344 | 344 |
| 345 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); | 345 ChildProcessSecurityPolicyImpl::GetInstance()->Add(GetID()); |
| 346 | 346 |
| 347 // Grant most file permissions to this renderer. | |
| 348 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | |
| 349 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | |
| 350 // requests them. | |
| 351 // This is for the filesystem sandbox. | |
| 352 ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( | |
| 353 GetID(), storage_partition_impl->GetPath().Append( | |
| 354 fileapi::SandboxMountPointProvider::kNewFileSystemDirectory), | |
| 355 base::PLATFORM_FILE_OPEN | | |
| 356 base::PLATFORM_FILE_CREATE | | |
| 357 base::PLATFORM_FILE_OPEN_ALWAYS | | |
| 358 base::PLATFORM_FILE_CREATE_ALWAYS | | |
| 359 base::PLATFORM_FILE_OPEN_TRUNCATED | | |
| 360 base::PLATFORM_FILE_READ | | |
| 361 base::PLATFORM_FILE_WRITE | | |
| 362 base::PLATFORM_FILE_EXCLUSIVE_READ | | |
| 363 base::PLATFORM_FILE_EXCLUSIVE_WRITE | | |
| 364 base::PLATFORM_FILE_ASYNC | | |
| 365 base::PLATFORM_FILE_WRITE_ATTRIBUTES | | |
| 366 base::PLATFORM_FILE_ENUMERATE); | |
| 367 // This is so that we can read and move stuff out of the old filesystem | |
| 368 // sandbox. | |
| 369 ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( | |
| 370 GetID(), storage_partition_impl_->GetPath().Append( | |
| 371 fileapi::SandboxMountPointProvider::kOldFileSystemDirectory), | |
| 372 base::PLATFORM_FILE_READ | base::PLATFORM_FILE_WRITE | | |
| 373 base::PLATFORM_FILE_WRITE_ATTRIBUTES | base::PLATFORM_FILE_ENUMERATE); | |
| 374 // This is so that we can rename the old sandbox out of the way so that we | |
| 375 // know we've taken care of it. | |
| 376 ChildProcessSecurityPolicyImpl::GetInstance()->GrantPermissionsForFile( | |
| 377 GetID(), storage_partition_impl_->GetPath().Append( | |
| 378 fileapi::SandboxMountPointProvider::kRenamedOldFileSystemDirectory), | |
| 379 base::PLATFORM_FILE_CREATE | base::PLATFORM_FILE_CREATE_ALWAYS | | |
| 380 base::PLATFORM_FILE_WRITE); | |
| 381 | |
| 382 CHECK(!g_exited_main_message_loop); | 347 CHECK(!g_exited_main_message_loop); |
| 383 RegisterHost(GetID(), this); | 348 RegisterHost(GetID(), this); |
| 384 g_all_hosts.Get().set_check_on_null_data(true); | 349 g_all_hosts.Get().set_check_on_null_data(true); |
| 385 // Initialize |child_process_activity_time_| to a reasonable value. | 350 // Initialize |child_process_activity_time_| to a reasonable value. |
| 386 mark_child_process_activity_time(); | 351 mark_child_process_activity_time(); |
| 387 // Note: When we create the RenderProcessHostImpl, it's technically | 352 // Note: When we create the RenderProcessHostImpl, it's technically |
| 388 // backgrounded, because it has no visible listeners. But the process | 353 // backgrounded, because it has no visible listeners. But the process |
| 389 // doesn't actually exist yet, so we'll Background it later, after | 354 // doesn't actually exist yet, so we'll Background it later, after |
| 390 // creation. | 355 // creation. |
| 391 } | 356 } |
| (...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1594 int32 gpu_process_host_id) { | 1559 int32 gpu_process_host_id) { |
| 1595 TRACE_EVENT0("renderer_host", | 1560 TRACE_EVENT0("renderer_host", |
| 1596 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); | 1561 "RenderWidgetHostImpl::OnCompositorSurfaceBuffersSwappedNoHost"); |
| 1597 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, | 1562 RenderWidgetHostImpl::AcknowledgeBufferPresent(route_id, |
| 1598 gpu_process_host_id, | 1563 gpu_process_host_id, |
| 1599 false, | 1564 false, |
| 1600 0); | 1565 0); |
| 1601 } | 1566 } |
| 1602 | 1567 |
| 1603 } // namespace content | 1568 } // namespace content |
| OLD | NEW |