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 #include "chrome/service/service_utility_process_host.h" | 5 #include "chrome/service/service_utility_process_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 #include "base/files/file_path.h" | 28 #include "base/files/file_path.h" |
29 #include "base/memory/scoped_ptr.h" | 29 #include "base/memory/scoped_ptr.h" |
30 #include "base/process/launch.h" | 30 #include "base/process/launch.h" |
31 #include "base/win/scoped_handle.h" | 31 #include "base/win/scoped_handle.h" |
32 #include "content/public/common/sandbox_init.h" | 32 #include "content/public/common/sandbox_init.h" |
33 #include "content/public/common/sandboxed_process_launcher_delegate.h" | 33 #include "content/public/common/sandboxed_process_launcher_delegate.h" |
34 #include "printing/emf_win.h" | 34 #include "printing/emf_win.h" |
| 35 #include "sandbox/win/src/sandbox_policy_base.h" |
35 | 36 |
36 namespace { | 37 namespace { |
37 | 38 |
38 // NOTE: changes to this class need to be reviewed by the security team. | 39 // NOTE: changes to this class need to be reviewed by the security team. |
39 class ServiceSandboxedProcessLauncherDelegate | 40 class ServiceSandboxedProcessLauncherDelegate |
40 : public content::SandboxedProcessLauncherDelegate { | 41 : public content::SandboxedProcessLauncherDelegate { |
41 public: | 42 public: |
42 explicit ServiceSandboxedProcessLauncherDelegate( | 43 explicit ServiceSandboxedProcessLauncherDelegate( |
43 const base::FilePath& exposed_dir) | 44 const base::FilePath& exposed_dir) |
44 : exposed_dir_(exposed_dir) { | 45 : exposed_dir_(exposed_dir) { |
45 } | 46 } |
46 | 47 |
47 virtual void PreSandbox(bool* disable_default_policy, | 48 virtual void PreSandbox(bool* disable_default_policy, |
48 base::FilePath* exposed_dir) OVERRIDE { | 49 base::FilePath* exposed_dir) OVERRIDE { |
49 *exposed_dir = exposed_dir_; | 50 *exposed_dir = exposed_dir_; |
50 } | 51 } |
51 | 52 |
| 53 virtual void PreSpawnTarget(sandbox::TargetPolicy* policy, |
| 54 bool* success) OVERRIDE { |
| 55 // Service process may run as windows service and it fails to create a |
| 56 // window station. |
| 57 policy->SetAlternateDesktop(false); |
| 58 } |
| 59 |
52 private: | 60 private: |
53 base::FilePath exposed_dir_; | 61 base::FilePath exposed_dir_; |
54 }; | 62 }; |
55 | 63 |
56 } // namespace | 64 } // namespace |
57 | 65 |
58 #endif // OS_WIN | 66 #endif // OS_WIN |
59 | 67 |
60 using content::ChildProcessHost; | 68 using content::ChildProcessHost; |
61 | 69 |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 if (!metafile.InitFromFile(metafile_path)) { | 391 if (!metafile.InitFromFile(metafile_path)) { |
384 OnRenderPDFPagesToMetafileFailed(); | 392 OnRenderPDFPagesToMetafileFailed(); |
385 } else { | 393 } else { |
386 OnRenderPDFPagesToMetafileSucceeded(metafile, | 394 OnRenderPDFPagesToMetafileSucceeded(metafile, |
387 highest_rendered_page_number, | 395 highest_rendered_page_number, |
388 scale_factor); | 396 scale_factor); |
389 } | 397 } |
390 #endif // defined(OS_WIN) | 398 #endif // defined(OS_WIN) |
391 } | 399 } |
392 | 400 |
OLD | NEW |