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

Side by Side Diff: content/browser/browser_child_process_host_impl.h

Issue 2365273004: Initial implementation for sharing field trial state (win) (Closed)
Patch Set: Remove windows macro causing compilation issue Created 4 years, 2 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
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 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_
6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
11 #include <memory> 11 #include <memory>
12 12
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
15 #include "base/memory/shared_memory.h"
15 #include "base/memory/weak_ptr.h" 16 #include "base/memory/weak_ptr.h"
16 #include "base/process/process.h" 17 #include "base/process/process.h"
17 #include "base/single_thread_task_runner.h" 18 #include "base/single_thread_task_runner.h"
18 #include "base/synchronization/waitable_event_watcher.h" 19 #include "base/synchronization/waitable_event_watcher.h"
19 #include "build/build_config.h" 20 #include "build/build_config.h"
20 #include "content/browser/child_process_launcher.h" 21 #include "content/browser/child_process_launcher.h"
21 #include "content/browser/power_monitor_message_broadcaster.h" 22 #include "content/browser/power_monitor_message_broadcaster.h"
22 #include "content/public/browser/browser_child_process_host.h" 23 #include "content/public/browser/browser_child_process_host.h"
23 #include "content/public/browser/child_process_data.h" 24 #include "content/public/browser/child_process_data.h"
24 #include "content/public/common/child_process_host_delegate.h" 25 #include "content/public/common/child_process_host_delegate.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 const std::string& service_name); 59 const std::string& service_name);
59 ~BrowserChildProcessHostImpl() override; 60 ~BrowserChildProcessHostImpl() override;
60 61
61 // Terminates all child processes and deletes each BrowserChildProcessHost 62 // Terminates all child processes and deletes each BrowserChildProcessHost
62 // instance. 63 // instance.
63 static void TerminateAll(); 64 static void TerminateAll();
64 65
65 // Copies kEnableFeatures and kDisableFeatures to the command line. Generates 66 // Copies kEnableFeatures and kDisableFeatures to the command line. Generates
66 // them from the FeatureList override state, to take into account overrides 67 // them from the FeatureList override state, to take into account overrides
67 // from FieldTrials. 68 // from FieldTrials.
69 #if defined(OS_WIN)
70 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line,
71 base::SharedMemory* shared_memory);
72 #else
68 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line); 73 static void CopyFeatureAndFieldTrialFlags(base::CommandLine* cmd_line);
74 #endif
69 75
70 // BrowserChildProcessHost implementation: 76 // BrowserChildProcessHost implementation:
71 bool Send(IPC::Message* message) override; 77 bool Send(IPC::Message* message) override;
72 void Launch(SandboxedProcessLauncherDelegate* delegate, 78 void Launch(SandboxedProcessLauncherDelegate* delegate,
79 base::SharedMemory* field_trial_state,
73 base::CommandLine* cmd_line, 80 base::CommandLine* cmd_line,
74 bool terminate_on_shutdown) override; 81 bool terminate_on_shutdown) override;
75 const ChildProcessData& GetData() const override; 82 const ChildProcessData& GetData() const override;
76 ChildProcessHost* GetHost() const override; 83 ChildProcessHost* GetHost() const override;
77 base::TerminationStatus GetTerminationStatus(bool known_dead, 84 base::TerminationStatus GetTerminationStatus(bool known_dead,
78 int* exit_code) override; 85 int* exit_code) override;
79 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator() 86 std::unique_ptr<base::SharedPersistentMemoryAllocator> TakeMetricsAllocator()
80 override; 87 override;
81 void SetName(const base::string16& name) override; 88 void SetName(const base::string16& name) override;
82 void SetHandle(base::ProcessHandle handle) override; 89 void SetHandle(base::ProcessHandle handle) override;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 178
172 bool is_channel_connected_; 179 bool is_channel_connected_;
173 bool notify_child_disconnected_; 180 bool notify_child_disconnected_;
174 181
175 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; 182 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_;
176 }; 183 };
177 184
178 } // namespace content 185 } // namespace content
179 186
180 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ 187 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698