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 "chrome/browser/renderer_host/browser_render_process_host.h" | 8 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 #include "content/common/child_process_info.h" | 92 #include "content/common/child_process_info.h" |
93 #include "content/common/child_process_messages.h" | 93 #include "content/common/child_process_messages.h" |
94 #include "content/common/notification_service.h" | 94 #include "content/common/notification_service.h" |
95 #include "content/common/resource_messages.h" | 95 #include "content/common/resource_messages.h" |
96 #include "grit/generated_resources.h" | 96 #include "grit/generated_resources.h" |
97 #include "ipc/ipc_logging.h" | 97 #include "ipc/ipc_logging.h" |
98 #include "ipc/ipc_platform_file.h" | 98 #include "ipc/ipc_platform_file.h" |
99 #include "ipc/ipc_switches.h" | 99 #include "ipc/ipc_switches.h" |
100 #include "media/base/media_switches.h" | 100 #include "media/base/media_switches.h" |
101 #include "ui/base/ui_base_switches.h" | 101 #include "ui/base/ui_base_switches.h" |
102 #include "webkit/fileapi/file_system_path_manager.h" | |
103 #include "webkit/plugins/plugin_switches.h" | 102 #include "webkit/plugins/plugin_switches.h" |
| 103 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
104 | 104 |
105 #if defined(OS_WIN) | 105 #if defined(OS_WIN) |
106 #include <objbase.h> | 106 #include <objbase.h> |
107 #include "chrome/common/section_util_win.h" | 107 #include "chrome/common/section_util_win.h" |
108 #endif | 108 #endif |
109 | 109 |
110 using WebKit::WebCache; | 110 using WebKit::WebCache; |
111 | 111 |
112 #include "third_party/skia/include/core/SkBitmap.h" | 112 #include "third_party/skia/include/core/SkBitmap.h" |
113 | 113 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 WebCacheManager::GetInstance()->Add(id()); | 295 WebCacheManager::GetInstance()->Add(id()); |
296 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 296 ChildProcessSecurityPolicy::GetInstance()->Add(id()); |
297 | 297 |
298 // Grant most file permissions to this renderer. | 298 // Grant most file permissions to this renderer. |
299 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | 299 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and |
300 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | 300 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API |
301 // requests them. | 301 // requests them. |
302 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 302 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
303 id(), profile->GetPath().Append( | 303 id(), profile->GetPath().Append( |
304 fileapi::FileSystemPathManager::kFileSystemDirectory), | 304 fileapi::SandboxMountPointProvider::kFileSystemDirectory), |
305 base::PLATFORM_FILE_OPEN | | 305 base::PLATFORM_FILE_OPEN | |
306 base::PLATFORM_FILE_CREATE | | 306 base::PLATFORM_FILE_CREATE | |
307 base::PLATFORM_FILE_OPEN_ALWAYS | | 307 base::PLATFORM_FILE_OPEN_ALWAYS | |
308 base::PLATFORM_FILE_CREATE_ALWAYS | | 308 base::PLATFORM_FILE_CREATE_ALWAYS | |
309 base::PLATFORM_FILE_READ | | 309 base::PLATFORM_FILE_READ | |
310 base::PLATFORM_FILE_WRITE | | 310 base::PLATFORM_FILE_WRITE | |
311 base::PLATFORM_FILE_EXCLUSIVE_READ | | 311 base::PLATFORM_FILE_EXCLUSIVE_READ | |
312 base::PLATFORM_FILE_EXCLUSIVE_WRITE | | 312 base::PLATFORM_FILE_EXCLUSIVE_WRITE | |
313 base::PLATFORM_FILE_ASYNC | | 313 base::PLATFORM_FILE_ASYNC | |
314 base::PLATFORM_FILE_TRUNCATE | | 314 base::PLATFORM_FILE_TRUNCATE | |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1294 IPC::PlatformFileForTransit file; | 1294 IPC::PlatformFileForTransit file; |
1295 #if defined(OS_POSIX) | 1295 #if defined(OS_POSIX) |
1296 file = base::FileDescriptor(model_file, false); | 1296 file = base::FileDescriptor(model_file, false); |
1297 #elif defined(OS_WIN) | 1297 #elif defined(OS_WIN) |
1298 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1298 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
1299 false, DUPLICATE_SAME_ACCESS); | 1299 false, DUPLICATE_SAME_ACCESS); |
1300 #endif | 1300 #endif |
1301 Send(new ViewMsg_SetPhishingModel(file)); | 1301 Send(new ViewMsg_SetPhishingModel(file)); |
1302 } | 1302 } |
1303 } | 1303 } |
OLD | NEW |