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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 #include "content/common/notification_service.h" | 95 #include "content/common/notification_service.h" |
96 #include "content/common/process_watcher.h" | 96 #include "content/common/process_watcher.h" |
97 #include "content/common/resource_messages.h" | 97 #include "content/common/resource_messages.h" |
98 #include "content/common/result_codes.h" | 98 #include "content/common/result_codes.h" |
99 #include "grit/generated_resources.h" | 99 #include "grit/generated_resources.h" |
100 #include "ipc/ipc_logging.h" | 100 #include "ipc/ipc_logging.h" |
101 #include "ipc/ipc_platform_file.h" | 101 #include "ipc/ipc_platform_file.h" |
102 #include "ipc/ipc_switches.h" | 102 #include "ipc/ipc_switches.h" |
103 #include "media/base/media_switches.h" | 103 #include "media/base/media_switches.h" |
104 #include "ui/base/ui_base_switches.h" | 104 #include "ui/base/ui_base_switches.h" |
105 #include "webkit/fileapi/file_system_path_manager.h" | |
106 #include "webkit/glue/resource_type.h" | 105 #include "webkit/glue/resource_type.h" |
107 #include "webkit/plugins/plugin_switches.h" | 106 #include "webkit/plugins/plugin_switches.h" |
| 107 #include "webkit/fileapi/sandbox_mount_point_provider.h" |
108 | 108 |
109 #if defined(OS_WIN) | 109 #if defined(OS_WIN) |
110 #include <objbase.h> | 110 #include <objbase.h> |
111 #include "content/common/section_util_win.h" | 111 #include "content/common/section_util_win.h" |
112 #endif | 112 #endif |
113 | 113 |
114 using WebKit::WebCache; | 114 using WebKit::WebCache; |
115 | 115 |
116 #include "third_party/skia/include/core/SkBitmap.h" | 116 #include "third_party/skia/include/core/SkBitmap.h" |
117 | 117 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 WebCacheManager::GetInstance()->Add(id()); | 301 WebCacheManager::GetInstance()->Add(id()); |
302 ChildProcessSecurityPolicy::GetInstance()->Add(id()); | 302 ChildProcessSecurityPolicy::GetInstance()->Add(id()); |
303 | 303 |
304 // Grant most file permissions to this renderer. | 304 // Grant most file permissions to this renderer. |
305 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and | 305 // PLATFORM_FILE_TEMPORARY, PLATFORM_FILE_HIDDEN and |
306 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API | 306 // PLATFORM_FILE_DELETE_ON_CLOSE are not granted, because no existing API |
307 // requests them. | 307 // requests them. |
308 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( | 308 ChildProcessSecurityPolicy::GetInstance()->GrantPermissionsForFile( |
309 id(), profile->GetPath().Append( | 309 id(), profile->GetPath().Append( |
310 fileapi::FileSystemPathManager::kFileSystemDirectory), | 310 fileapi::SandboxMountPointProvider::kFileSystemDirectory), |
311 base::PLATFORM_FILE_OPEN | | 311 base::PLATFORM_FILE_OPEN | |
312 base::PLATFORM_FILE_CREATE | | 312 base::PLATFORM_FILE_CREATE | |
313 base::PLATFORM_FILE_OPEN_ALWAYS | | 313 base::PLATFORM_FILE_OPEN_ALWAYS | |
314 base::PLATFORM_FILE_CREATE_ALWAYS | | 314 base::PLATFORM_FILE_CREATE_ALWAYS | |
315 base::PLATFORM_FILE_READ | | 315 base::PLATFORM_FILE_READ | |
316 base::PLATFORM_FILE_WRITE | | 316 base::PLATFORM_FILE_WRITE | |
317 base::PLATFORM_FILE_EXCLUSIVE_READ | | 317 base::PLATFORM_FILE_EXCLUSIVE_READ | |
318 base::PLATFORM_FILE_EXCLUSIVE_WRITE | | 318 base::PLATFORM_FILE_EXCLUSIVE_WRITE | |
319 base::PLATFORM_FILE_ASYNC | | 319 base::PLATFORM_FILE_ASYNC | |
320 base::PLATFORM_FILE_TRUNCATE | | 320 base::PLATFORM_FILE_TRUNCATE | |
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 IPC::PlatformFileForTransit file; | 1306 IPC::PlatformFileForTransit file; |
1307 #if defined(OS_POSIX) | 1307 #if defined(OS_POSIX) |
1308 file = base::FileDescriptor(model_file, false); | 1308 file = base::FileDescriptor(model_file, false); |
1309 #elif defined(OS_WIN) | 1309 #elif defined(OS_WIN) |
1310 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, | 1310 ::DuplicateHandle(::GetCurrentProcess(), model_file, GetHandle(), &file, 0, |
1311 false, DUPLICATE_SAME_ACCESS); | 1311 false, DUPLICATE_SAME_ACCESS); |
1312 #endif | 1312 #endif |
1313 Send(new ViewMsg_SetPhishingModel(file)); | 1313 Send(new ViewMsg_SetPhishingModel(file)); |
1314 } | 1314 } |
1315 } | 1315 } |
OLD | NEW |