Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(725)

Side by Side Diff: chrome/service/service_utility_process_host.cc

Issue 534413002: Use SetAlternateDesktop(false) for service process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Thu Sep 4 11:19:11 PDT 2014 Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/service/DEPS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 would fail to create
56 // ::CreateWindowStation.
cpu_(ooo_6.6-7.5) 2014/09/04 19:04:23 .. and it fails to create a window station.
Vitaly Buka (NO REVIEWS) 2014/09/04 21:15:09 Done.
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
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
OLDNEW
« no previous file with comments | « chrome/service/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698