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 #ifndef CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ | 5 #ifndef CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ |
6 #define CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ | 6 #define CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/metrics/field_trial.h" |
16 #include "base/process/process.h" | 17 #include "base/process/process.h" |
17 #include "base/scoped_native_library.h" | 18 #include "base/scoped_native_library.h" |
18 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "components/variations/child_process_field_trial_syncer.h" |
19 #include "content/child/child_thread_impl.h" | 21 #include "content/child/child_thread_impl.h" |
20 #include "content/public/common/pepper_plugin_info.h" | 22 #include "content/public/common/pepper_plugin_info.h" |
21 #include "ppapi/c/pp_module.h" | 23 #include "ppapi/c/pp_module.h" |
22 #include "ppapi/c/trusted/ppp_broker.h" | 24 #include "ppapi/c/trusted/ppp_broker.h" |
23 #include "ppapi/proxy/connection.h" | 25 #include "ppapi/proxy/connection.h" |
24 #include "ppapi/proxy/plugin_dispatcher.h" | 26 #include "ppapi/proxy/plugin_dispatcher.h" |
25 #include "ppapi/proxy/plugin_globals.h" | 27 #include "ppapi/proxy/plugin_globals.h" |
26 #include "ppapi/proxy/plugin_proxy_delegate.h" | 28 #include "ppapi/proxy/plugin_proxy_delegate.h" |
27 | 29 |
28 #if defined(OS_WIN) | 30 #if defined(OS_WIN) |
(...skipping 14 matching lines...) Expand all Loading... |
43 class PpapiBlinkPlatformImpl; | 45 class PpapiBlinkPlatformImpl; |
44 | 46 |
45 #if defined(COMPILER_MSVC) | 47 #if defined(COMPILER_MSVC) |
46 // See explanation for other RenderViewHostImpl which is the same issue. | 48 // See explanation for other RenderViewHostImpl which is the same issue. |
47 #pragma warning(push) | 49 #pragma warning(push) |
48 #pragma warning(disable: 4250) | 50 #pragma warning(disable: 4250) |
49 #endif | 51 #endif |
50 | 52 |
51 class PpapiThread : public ChildThreadImpl, | 53 class PpapiThread : public ChildThreadImpl, |
52 public ppapi::proxy::PluginDispatcher::PluginDelegate, | 54 public ppapi::proxy::PluginDispatcher::PluginDelegate, |
53 public ppapi::proxy::PluginProxyDelegate { | 55 public ppapi::proxy::PluginProxyDelegate, |
| 56 public base::FieldTrialList::Observer { |
54 public: | 57 public: |
55 PpapiThread(const base::CommandLine& command_line, bool is_broker); | 58 PpapiThread(const base::CommandLine& command_line, bool is_broker); |
56 ~PpapiThread() override; | 59 ~PpapiThread() override; |
57 void Shutdown() override; | 60 void Shutdown() override; |
58 | 61 |
59 private: | 62 private: |
60 // Make sure the enum list in tools/histogram/histograms.xml is updated with | 63 // Make sure the enum list in tools/histogram/histograms.xml is updated with |
61 // any change in this list. | 64 // any change in this list. |
62 enum LoadResult { | 65 enum LoadResult { |
63 LOAD_SUCCESS, | 66 LOAD_SUCCESS, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Message handlers. | 106 // Message handlers. |
104 void OnLoadPlugin(const base::FilePath& path, | 107 void OnLoadPlugin(const base::FilePath& path, |
105 const ppapi::PpapiPermissions& permissions); | 108 const ppapi::PpapiPermissions& permissions); |
106 void OnCreateChannel(base::ProcessId renderer_pid, | 109 void OnCreateChannel(base::ProcessId renderer_pid, |
107 int renderer_child_id, | 110 int renderer_child_id, |
108 bool incognito); | 111 bool incognito); |
109 void OnSetNetworkState(bool online); | 112 void OnSetNetworkState(bool online); |
110 void OnCrash(); | 113 void OnCrash(); |
111 void OnHang(); | 114 void OnHang(); |
112 | 115 |
| 116 // base::FieldTrialList::Observer: |
| 117 void OnFieldTrialGroupFinalized(const std::string& trial_name, |
| 118 const std::string& group_name) override; |
| 119 |
113 // Sets up the channel to the given renderer. If |renderer_pid| is | 120 // Sets up the channel to the given renderer. If |renderer_pid| is |
114 // base::kNullProcessId, the channel is set up to the browser. On success, | 121 // base::kNullProcessId, the channel is set up to the browser. On success, |
115 // returns true and fills the given ChannelHandle with the information from | 122 // returns true and fills the given ChannelHandle with the information from |
116 // the new channel. | 123 // the new channel. |
117 bool SetupChannel(base::ProcessId renderer_pid, | 124 bool SetupChannel(base::ProcessId renderer_pid, |
118 int renderer_child_id, | 125 int renderer_child_id, |
119 bool incognito, | 126 bool incognito, |
120 IPC::ChannelHandle* handle); | 127 IPC::ChannelHandle* handle); |
121 | 128 |
122 // Sets up the name of the plugin for logging using the given path. | 129 // Sets up the name of the plugin for logging using the given path. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 uint32_t next_plugin_dispatcher_id_; | 172 uint32_t next_plugin_dispatcher_id_; |
166 | 173 |
167 // The BlinkPlatformImpl implementation. | 174 // The BlinkPlatformImpl implementation. |
168 std::unique_ptr<PpapiBlinkPlatformImpl> blink_platform_impl_; | 175 std::unique_ptr<PpapiBlinkPlatformImpl> blink_platform_impl_; |
169 | 176 |
170 #if defined(OS_WIN) | 177 #if defined(OS_WIN) |
171 // Caches the handle to the peer process if this is a broker. | 178 // Caches the handle to the peer process if this is a broker. |
172 base::win::ScopedHandle peer_handle_; | 179 base::win::ScopedHandle peer_handle_; |
173 #endif | 180 #endif |
174 | 181 |
| 182 variations::ChildProcessFieldTrialSyncer field_trial_syncer_; |
| 183 |
175 DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread); | 184 DISALLOW_IMPLICIT_CONSTRUCTORS(PpapiThread); |
176 }; | 185 }; |
177 | 186 |
178 #if defined(COMPILER_MSVC) | 187 #if defined(COMPILER_MSVC) |
179 #pragma warning(pop) | 188 #pragma warning(pop) |
180 #endif | 189 #endif |
181 | 190 |
182 } // namespace content | 191 } // namespace content |
183 | 192 |
184 #endif // CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ | 193 #endif // CONTENT_PPAPI_PLUGIN_PPAPI_THREAD_H_ |
OLD | NEW |