[email protected] | 273558fb | 2012-01-12 15:03:51 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | dd924193 | 2010-02-24 19:23:13 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 4 | |
tfarina | 556a723 | 2014-10-05 01:02:09 | [diff] [blame] | 5 | #ifndef CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
| 6 | #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 7 | |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 8 | #include <stddef.h> |
| 9 | #include <stdint.h> |
| 10 | |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 11 | #include <memory> |
Max Morin | f506af59 | 2018-04-17 12:23:32 | [diff] [blame] | 12 | #include <string> |
dcheng | cedca561 | 2016-04-09 01:40:15 | [diff] [blame] | 13 | |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 14 | #include "base/compiler_specific.h" |
Brett Wilson | f976d3f | 2017-08-18 17:23:39 | [diff] [blame] | 15 | #include "base/containers/id_map.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 16 | #include "base/macros.h" |
Yutaka Hirano | b0465f7 | 2018-05-17 05:48:25 | [diff] [blame] | 17 | #include "base/optional.h" |
Gabriel Charette | 1452023 | 2018-04-30 23:27:22 | [diff] [blame] | 18 | #include "base/single_thread_task_runner.h" |
Tsuyoshi Horo | 0a0f7a7 | 2017-06-26 10:19:39 | [diff] [blame] | 19 | #include "base/time/time.h" |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 20 | #include "build/build_config.h" |
[email protected] | 4db58d7 | 2014-03-24 17:05:19 | [diff] [blame] | 21 | #include "content/child/blink_platform_impl.h" |
[email protected] | f3112a5 | 2011-09-30 23:47:49 | [diff] [blame] | 22 | #include "content/common/content_export.h" |
skyostil | b4cce1b | 2016-03-31 17:56:34 | [diff] [blame] | 23 | #include "content/renderer/top_level_blame_context.h" |
Julie Jeongeun Kim | e5e7fd8b | 2019-09-03 16:53:46 | [diff] [blame] | 24 | #include "mojo/public/cpp/bindings/pending_remote.h" |
| 25 | #include "mojo/public/cpp/bindings/shared_remote.h" |
Ken Rockot | 54311e6 | 2018-02-10 19:01:52 | [diff] [blame] | 26 | #include "services/network/public/mojom/url_loader_factory.mojom.h" |
Luciano Pacheco | 626c99e8 | 2018-03-22 01:06:56 | [diff] [blame] | 27 | #include "services/service_manager/public/cpp/interface_provider.h" |
Dmitry Gozman | f361345 | 2018-04-17 20:22:02 | [diff] [blame] | 28 | #include "third_party/blink/public/common/screen_orientation/web_screen_orientation_type.h" |
Mike West | 6e4cbb3 | 2019-02-13 09:40:17 | [diff] [blame] | 29 | #include "third_party/blink/public/common/user_agent/user_agent_metadata.h" |
Richard Li | bcc09eb | 2018-11-30 15:00:35 | [diff] [blame] | 30 | #include "third_party/blink/public/mojom/cache_storage/cache_storage.mojom.h" |
Bill Budge | 24c1dc1a | 2018-09-25 18:51:32 | [diff] [blame] | 31 | #include "third_party/blink/public/mojom/loader/code_cache.mojom.h" |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 32 | |
Dominik Röttsches | ac24004 | 2018-07-06 09:52:40 | [diff] [blame] | 33 | #if defined(OS_LINUX) |
| 34 | #include "components/services/font/public/cpp/font_loader.h" // nogncheck |
| 35 | #include "third_party/skia/include/core/SkRefCnt.h" // nogncheck |
| 36 | #endif |
| 37 | |
[email protected] | 180ef24 | 2013-11-07 06:50:46 | [diff] [blame] | 38 | namespace blink { |
skyostil | 529caa29 | 2016-08-10 17:44:51 | [diff] [blame] | 39 | namespace scheduler { |
Yuta Kitamura | deb91bb | 2018-05-29 05:53:20 | [diff] [blame] | 40 | class WebThreadScheduler; |
skyostil | 529caa29 | 2016-08-10 17:44:51 | [diff] [blame] | 41 | } |
[email protected] | 39604c3 | 2013-05-09 12:40:17 | [diff] [blame] | 42 | class WebGraphicsContext3DProvider; |
guidou | 55e35dc | 2016-02-04 11:06:25 | [diff] [blame] | 43 | class WebSecurityOrigin; |
Luciano Pacheco | 626c99e8 | 2018-03-22 01:06:56 | [diff] [blame] | 44 | } // namespace blink |
[email protected] | 39604c3 | 2013-05-09 12:40:17 | [diff] [blame] | 45 | |
Miyoung Shin | ccbe3323 | 2019-06-19 04:14:30 | [diff] [blame] | 46 | namespace media { |
| 47 | class GpuVideoAcceleratorFactories; |
| 48 | } |
| 49 | |
Matt Falkenhagen | d7e6a562 | 2018-05-25 13:12:48 | [diff] [blame] | 50 | namespace network { |
| 51 | class SharedURLLoaderFactory; |
| 52 | } |
| 53 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 54 | namespace content { |
Yuzhu Shen | 0c1715f | 2018-01-27 03:48:50 | [diff] [blame] | 55 | class ChildURLLoaderFactoryBundle; |
[email protected] | b180a0bb | 2013-03-06 00:36:10 | [diff] [blame] | 56 | class ThreadSafeSender; |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 57 | |
tfarina | 556a723 | 2014-10-05 01:02:09 | [diff] [blame] | 58 | class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 59 | public: |
Reilly Grant | 9944f16 | 2017-08-29 01:22:41 | [diff] [blame] | 60 | explicit RendererBlinkPlatformImpl( |
Yuta Kitamura | deb91bb | 2018-05-29 05:53:20 | [diff] [blame] | 61 | blink::scheduler::WebThreadScheduler* main_thread_scheduler); |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 62 | ~RendererBlinkPlatformImpl() override; |
[email protected] | eb6f2c54 | 2009-10-02 04:53:59 | [diff] [blame] | 63 | |
Hajime Hoshi | 315a61f | 2018-08-14 17:27:28 | [diff] [blame] | 64 | blink::scheduler::WebThreadScheduler* main_thread_scheduler() { |
| 65 | return main_thread_scheduler_; |
| 66 | } |
| 67 | |
rickyz | f2c9306 | 2015-09-15 09:10:57 | [diff] [blame] | 68 | // Shutdown must be called just prior to shutting down blink. |
| 69 | void Shutdown(); |
| 70 | |
[email protected] | 8467ae0d | 2013-02-27 02:02:48 | [diff] [blame] | 71 | // Platform methods: |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 72 | blink::WebSandboxSupport* GetSandboxSupport() override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 73 | blink::WebThemeEngine* ThemeEngine() override; |
[email protected] | 937c4eb | 2013-01-03 00:36:56 | [diff] [blame] | 74 | virtual bool sandboxEnabled(); |
Miyoung Shin | d2dd8bc | 2019-03-11 02:45:40 | [diff] [blame] | 75 | uint64_t VisitedLinkHash(const char* canonicalURL, size_t length) override; |
| 76 | bool IsLinkVisited(uint64_t linkHash) override; |
Yutaka Hirano | b0465f7 | 2018-05-17 05:48:25 | [diff] [blame] | 77 | blink::WebString UserAgent() override; |
Mike West | 6e4cbb3 | 2019-02-13 09:40:17 | [diff] [blame] | 78 | blink::UserAgentMetadata UserAgentMetadata() override; |
Bill Budge | d64546bc | 2018-09-28 16:06:47 | [diff] [blame] | 79 | void CacheMetadata(blink::mojom::CodeCacheType cache_type, |
| 80 | const blink::WebURL&, |
Tsuyoshi Horo | 0a0f7a7 | 2017-06-26 10:19:39 | [diff] [blame] | 81 | base::Time, |
Kenichi Ishibashi | 0265fa3 | 2018-12-26 03:24:19 | [diff] [blame] | 82 | const uint8_t*, |
avi | 1023d01 | 2015-12-25 02:39:14 | [diff] [blame] | 83 | size_t) override; |
Jeremy Roman | 8408375 | 2019-05-07 16:47:01 | [diff] [blame] | 84 | void FetchCachedCode(blink::mojom::CodeCacheType cache_type, |
| 85 | const GURL&, |
| 86 | FetchCachedCodeCallback) override; |
Bill Budge | d64546bc | 2018-09-28 16:06:47 | [diff] [blame] | 87 | void ClearCodeCacheEntry(blink::mojom::CodeCacheType cache_type, |
| 88 | const GURL&) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 89 | void CacheMetadataInCacheStorage( |
horo | 244fe93 | 2016-05-10 02:27:49 | [diff] [blame] | 90 | const blink::WebURL&, |
Tsuyoshi Horo | 0a0f7a7 | 2017-06-26 10:19:39 | [diff] [blame] | 91 | base::Time, |
Kenichi Ishibashi | 0265fa3 | 2018-12-26 03:24:19 | [diff] [blame] | 92 | const uint8_t*, |
horo | 244fe93 | 2016-05-10 02:27:49 | [diff] [blame] | 93 | size_t, |
| 94 | const blink::WebSecurityOrigin& cacheStorageOrigin, |
| 95 | const blink::WebString& cacheStorageCacheName) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 96 | blink::WebString DefaultLocale() override; |
| 97 | void SuddenTerminationChanged(bool enabled) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 98 | blink::WebString DatabaseCreateOriginIdentifier( |
jsbell | 1d0a8a44 | 2016-03-22 20:07:28 | [diff] [blame] | 99 | const blink::WebSecurityOrigin& origin) override; |
Fady Samuel | d5c2618 | 2017-07-12 02:43:33 | [diff] [blame] | 100 | viz::FrameSinkId GenerateFrameSinkId() override; |
Nicolas Pena | 7c7847f | 2018-05-30 01:36:05 | [diff] [blame] | 101 | bool IsLockedToSite() const override; |
jsbell | 1d0a8a44 | 2016-03-22 20:07:28 | [diff] [blame] | 102 | |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 103 | blink::WebString FileSystemCreateOriginIdentifier( |
jsbell | 1d0a8a44 | 2016-03-22 20:07:28 | [diff] [blame] | 104 | const blink::WebSecurityOrigin& origin) override; |
| 105 | |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 106 | bool IsThreadedAnimationEnabled() override; |
danakj | 954b09b | 2017-11-02 17:56:47 | [diff] [blame] | 107 | bool IsGpuCompositingDisabled() override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 108 | double AudioHardwareSampleRate() override; |
| 109 | size_t AudioHardwareBufferSize() override; |
| 110 | unsigned AudioHardwareOutputChannels() override; |
[email protected] | a19efb7 | 2013-01-12 17:05:46 | [diff] [blame] | 111 | |
altimin | eb6bd196 | 2017-05-03 14:52:38 | [diff] [blame] | 112 | std::unique_ptr<blink::WebAudioDevice> CreateAudioDevice( |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 113 | unsigned input_channels, |
| 114 | unsigned channels, |
andrew.macpherson | 4f85155e | 2017-02-13 10:51:01 | [diff] [blame] | 115 | const blink::WebAudioLatencyHint& latency_hint, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 116 | blink::WebAudioDevice::RenderCallback* callback, |
Max Morin | f506af59 | 2018-04-17 12:23:32 | [diff] [blame] | 117 | const blink::WebString& input_device_id) override; |
[email protected] | 8d22e587 | 2013-02-22 20:07:11 | [diff] [blame] | 118 | |
Kinuko Yasuda | 74d1c9e | 2017-05-31 14:08:51 | [diff] [blame] | 119 | bool DecodeAudioFileData(blink::WebAudioBus* destination_bus, |
| 120 | const char* audio_file_data, |
| 121 | size_t data_size) override; |
[email protected] | 99902de | 2013-06-20 23:04:09 | [diff] [blame] | 122 | |
Antonio Gomes | 0de024e9 | 2019-07-06 11:38:02 | [diff] [blame] | 123 | scoped_refptr<media::AudioCapturerSource> NewAudioCapturerSource( |
| 124 | blink::WebLocalFrame* web_frame, |
| 125 | const media::AudioSourceParameters& params) override; |
Antonio Gomes | a5b5ce4 | 2019-07-11 00:15:30 | [diff] [blame] | 126 | viz::ContextProvider* SharedMainThreadContextProvider() override; |
Antonio Gomes | d27b003 | 2019-07-16 17:06:30 | [diff] [blame] | 127 | bool RTCSmoothnessAlgorithmEnabled() override; |
Guido Urdaneta | dde6677e | 2019-03-08 10:58:50 | [diff] [blame] | 128 | base::Optional<double> GetWebRtcMaxCaptureFrameRate() override; |
Antonio Gomes | 0291c2c | 2019-06-27 00:55:51 | [diff] [blame] | 129 | scoped_refptr<media::AudioRendererSink> NewAudioRendererSink( |
| 130 | blink::WebAudioDeviceSourceType source_type, |
| 131 | blink::WebLocalFrame* web_frame, |
| 132 | const media::AudioSinkParameters& params) override; |
| 133 | media::AudioLatency::LatencyType GetAudioSourceLatencyType( |
| 134 | blink::WebAudioDeviceSourceType source_type) override; |
Antonio Gomes | 7743d5b9 | 2019-07-26 13:57:30 | [diff] [blame] | 135 | base::Optional<std::string> GetWebRTCAudioProcessingConfiguration() override; |
Antonio Gomes | f7ed0987 | 2019-09-13 00:30:50 | [diff] [blame] | 136 | bool ShouldEnforceWebRTCRoutingPreferences() override; |
| 137 | bool UsesFakeCodecForPeerConnection() override; |
| 138 | bool IsWebRtcEncryptionEnabled() override; |
Antonio Gomes | 7202754 | 2019-10-08 15:30:10 | [diff] [blame] | 139 | bool IsWebRtcStunOriginEnabled() override; |
Antonio Gomes | f7ed0987 | 2019-09-13 00:30:50 | [diff] [blame] | 140 | base::Optional<std::string> WebRtcStunProbeTrialParameter() override; |
Antonio Gomes | 0dcf8bd | 2019-09-12 18:09:40 | [diff] [blame] | 141 | media::MediaPermission* GetWebRTCMediaPermission( |
| 142 | blink::WebLocalFrame* web_frame) override; |
| 143 | void GetWebRTCRendererPreferences(blink::WebLocalFrame* web_frame, |
| 144 | blink::WebString* ip_handling_policy, |
| 145 | uint16_t* udp_min_port, |
Qingsi Wang | 337dc7a | 2019-10-29 01:02:04 | [diff] [blame] | 146 | uint16_t* udp_max_port, |
| 147 | bool* allow_mdns_obfuscation) override; |
Antonio Gomes | 7743d5b9 | 2019-07-26 13:57:30 | [diff] [blame] | 148 | base::Optional<int> GetAgcStartupMinimumVolume() override; |
Antonio Gomes | 6dfeca35 | 2019-08-28 13:45:03 | [diff] [blame] | 149 | bool IsWebRtcHWH264DecodingEnabled( |
| 150 | webrtc::VideoCodecType video_coded_type) override; |
Antonio Gomes | 92f054a1 | 2019-09-06 02:07:32 | [diff] [blame] | 151 | bool IsWebRtcHWEncodingEnabled() override; |
| 152 | bool IsWebRtcHWDecodingEnabled() override; |
Antonio Gomes | 69b1781 | 2019-10-13 11:48:46 | [diff] [blame] | 153 | bool IsWebRtcSrtpAesGcmEnabled() override; |
| 154 | bool IsWebRtcSrtpEncryptedHeadersEnabled() override; |
Antonio Gomes | af639cd | 2019-09-10 14:17:46 | [diff] [blame] | 155 | bool AllowsLoopbackInPeerConnection() override; |
Antonio Gomes | 92f054a1 | 2019-09-06 02:07:32 | [diff] [blame] | 156 | |
Antonio Gomes | 493550b7 | 2019-07-31 08:12:44 | [diff] [blame] | 157 | blink::WebVideoCaptureImplManager* GetVideoCaptureImplManager() override; |
Guido Urdaneta | dde6677e | 2019-03-08 10:58:50 | [diff] [blame] | 158 | |
altimin | eb6bd196 | 2017-05-03 14:52:38 | [diff] [blame] | 159 | std::unique_ptr<blink::WebGraphicsContext3DProvider> |
| 160 | CreateOffscreenGraphicsContext3DProvider( |
danakj | 6ee20a0 | 2016-04-02 01:08:45 | [diff] [blame] | 161 | const blink::Platform::ContextAttributes& attributes, |
| 162 | const blink::WebURL& top_document_web_url, |
danakj | f079939 | 2016-05-19 21:44:17 | [diff] [blame] | 163 | blink::Platform::GraphicsInfo* gl_info) override; |
altimin | eb6bd196 | 2017-05-03 14:52:38 | [diff] [blame] | 164 | std::unique_ptr<blink::WebGraphicsContext3DProvider> |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 165 | CreateSharedOffscreenGraphicsContext3DProvider() override; |
Kai Ninomiya | 05c1050 | 2018-08-30 20:06:21 | [diff] [blame] | 166 | std::unique_ptr<blink::WebGraphicsContext3DProvider> |
| 167 | CreateWebGPUGraphicsContext3DProvider( |
Austin Eng | 479265de | 2019-11-08 02:05:04 | [diff] [blame] | 168 | const blink::WebURL& top_document_web_url) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 169 | gpu::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 170 | blink::WebString ConvertIDNToUnicode(const blink::WebString& host) override; |
Yuta Kitamura | 88c84377 | 2018-09-28 12:33:54 | [diff] [blame] | 171 | void SetDisplayThreadPriority(base::PlatformThreadId thread_id) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 172 | blink::BlameContext* GetTopLevelBlameContext() override; |
| 173 | void RecordRappor(const char* metric, |
avi | 5c77d21 | 2015-09-25 20:08:25 | [diff] [blame] | 174 | const blink::WebString& sample) override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 175 | void RecordRapporURL(const char* metric, const blink::WebURL& url) override; |
Dean Liao | 0036a65f | 2019-03-27 01:35:44 | [diff] [blame] | 176 | |
Hiroki Nakagawa | 9e2bb27 | 2019-02-12 07:17:43 | [diff] [blame] | 177 | std::unique_ptr<blink::WebDedicatedWorkerHostFactoryClient> |
| 178 | CreateDedicatedWorkerHostFactoryClient( |
| 179 | blink::WebDedicatedWorker*, |
Miyoung Shin | 996cb65 | 2019-11-28 03:27:22 | [diff] [blame] | 180 | const blink::BrowserInterfaceBrokerProxy&) override; |
John Abd-El-Malek | f75a319 | 2017-10-22 14:23:20 | [diff] [blame] | 181 | void DidStartWorkerThread() override; |
| 182 | void WillStopWorkerThread() override; |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 183 | void WorkerContextCreated(const v8::Local<v8::Context>& worker) override; |
Leon Han | b6bd8e6 | 2019-05-29 03:18:20 | [diff] [blame] | 184 | bool IsExcludedHeaderForServiceWorkerFetchEvent( |
| 185 | const blink::WebString& header_name) override; |
iclelland | 5c7359f | 2016-02-10 22:59:35 | [diff] [blame] | 186 | |
Aditya Keerthi | e84331b3 | 2019-03-20 15:25:52 | [diff] [blame] | 187 | void RecordMetricsForBackgroundedRendererPurge() override; |
| 188 | |
Kinuko Yasuda | 017b79e6 | 2017-10-24 17:46:10 | [diff] [blame] | 189 | std::unique_ptr<blink::WebURLLoaderFactory> CreateDefaultURLLoaderFactory() |
| 190 | override; |
Mythri Alle | 8f45f41 | 2018-08-28 10:44:07 | [diff] [blame] | 191 | std::unique_ptr<blink::CodeCacheLoader> CreateCodeCacheLoader() override; |
Bill Budge | 24c1dc1a | 2018-09-25 18:51:32 | [diff] [blame] | 192 | |
Marijn Kruisselbrink | 20c2e29 | 2018-02-09 22:07:57 | [diff] [blame] | 193 | std::unique_ptr<blink::WebURLLoaderFactory> WrapURLLoaderFactory( |
| 194 | mojo::ScopedMessagePipeHandle url_loader_factory_handle) override; |
Matt Falkenhagen | d7e6a562 | 2018-05-25 13:12:48 | [diff] [blame] | 195 | std::unique_ptr<blink::WebURLLoaderFactory> WrapSharedURLLoaderFactory( |
| 196 | scoped_refptr<network::SharedURLLoaderFactory> factory) override; |
tasak | 9971706 | 2017-02-15 06:34:06 | [diff] [blame] | 197 | |
Miyoung Shin | ccbe3323 | 2019-06-19 04:14:30 | [diff] [blame] | 198 | media::GpuVideoAcceleratorFactories* GetGpuFactories() override; |
| 199 | |
Tsuyoshi Horo | e4b17a3 | 2017-08-25 16:01:13 | [diff] [blame] | 200 | // Returns non-null. |
| 201 | // It is invalid to call this in an incomplete env where |
| 202 | // RenderThreadImpl::current() returns nullptr (e.g. in some tests). |
Yuzhu Shen | 0c1715f | 2018-01-27 03:48:50 | [diff] [blame] | 203 | scoped_refptr<ChildURLLoaderFactoryBundle> |
| 204 | CreateDefaultURLLoaderFactoryBundle(); |
Tsuyoshi Horo | e4b17a3 | 2017-08-25 16:01:13 | [diff] [blame] | 205 | |
Julie Jeongeun Kim | 2811b95 | 2019-10-24 00:36:12 | [diff] [blame] | 206 | mojo::PendingRemote<network::mojom::URLLoaderFactory> |
| 207 | CreateNetworkURLLoaderFactory(); |
Kinuko Yasuda | 017b79e6 | 2017-10-24 17:46:10 | [diff] [blame] | 208 | |
Nicolas Pena | 7c7847f | 2018-05-30 01:36:05 | [diff] [blame] | 209 | // Tells this platform that the renderer is locked to a site (i.e., a scheme |
| 210 | // plus eTLD+1, such as https://google.com), or to a more specific origin. |
| 211 | void SetIsLockedToSite(); |
| 212 | |
Yuzhu Shen | 0c1715f | 2018-01-27 03:48:50 | [diff] [blame] | 213 | private: |
[email protected] | b808eb6f | 2010-05-18 17:09:33 | [diff] [blame] | 214 | bool CheckPreparsedJsCachingEnabled() const; |
| 215 | |
Bill Budge | 24c1dc1a | 2018-09-25 18:51:32 | [diff] [blame] | 216 | // Return the mojo interface for making CodeCache calls. |
| 217 | blink::mojom::CodeCacheHost& GetCodeCacheHost(); |
| 218 | |
Chase Phillips | af6f496 | 2018-07-28 00:21:16 | [diff] [blame] | 219 | scoped_refptr<base::SingleThreadTaskRunner> io_runner_; |
rmcilroy | 321f924d | 2014-11-06 00:56:00 | [diff] [blame] | 220 | |
Robert Sesek | 0694f7c | 2018-11-20 16:00:10 | [diff] [blame] | 221 | #if defined(OS_LINUX) || defined(OS_MACOSX) |
| 222 | std::unique_ptr<blink::WebSandboxSupport> sandbox_support_; |
jbroman | bae266e | 2015-03-09 16:52:57 | [diff] [blame] | 223 | #endif |
[email protected] | eb6f2c54 | 2009-10-02 04:53:59 | [diff] [blame] | 224 | |
| 225 | // This counter keeps track of the number of times sudden termination is |
| 226 | // enabled or disabled. It starts at 0 (enabled) and for every disable |
| 227 | // increments by 1, for every enable decrements by 1. When it reaches 0, |
| 228 | // we tell the browser to enable fast termination. |
| 229 | int sudden_termination_disables_; |
[email protected] | ab350536 | 2009-10-30 18:11:47 | [diff] [blame] | 230 | |
Nicolas Pena | 7c7847f | 2018-05-30 01:36:05 | [diff] [blame] | 231 | // If true, the renderer process is locked to a site. |
| 232 | bool is_locked_to_site_; |
| 233 | |
rmcilroy | 321f924d | 2014-11-06 00:56:00 | [diff] [blame] | 234 | scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_; |
[email protected] | b180a0bb | 2013-03-06 00:36:10 | [diff] [blame] | 235 | scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
[email protected] | c29b7ff | 2013-03-06 03:51:04 | [diff] [blame] | 236 | |
Yuta Kitamura | 3331f5c | 2018-04-05 11:12:25 | [diff] [blame] | 237 | // NOT OWNED |
Yuta Kitamura | deb91bb | 2018-05-29 05:53:20 | [diff] [blame] | 238 | blink::scheduler::WebThreadScheduler* main_thread_scheduler_; |
Yuta Kitamura | 3331f5c | 2018-04-05 11:12:25 | [diff] [blame] | 239 | |
skyostil | b4cce1b | 2016-03-31 17:56:34 | [diff] [blame] | 240 | TopLevelBlameContext top_level_blame_context_; |
alexclarke | 8225624 | 2015-11-06 09:26:12 | [diff] [blame] | 241 | |
Julie Jeongeun Kim | e5e7fd8b | 2019-09-03 16:53:46 | [diff] [blame] | 242 | mojo::PendingRemote<blink::mojom::CodeCacheHost> code_cache_host_remote_; |
| 243 | mojo::SharedRemote<blink::mojom::CodeCacheHost> code_cache_host_; |
Bill Budge | 24c1dc1a | 2018-09-25 18:51:32 | [diff] [blame] | 244 | |
Dominik Röttsches | ac24004 | 2018-07-06 09:52:40 | [diff] [blame] | 245 | #if defined(OS_LINUX) |
Dominik Röttsches | ac24004 | 2018-07-06 09:52:40 | [diff] [blame] | 246 | sk_sp<font_service::FontLoader> font_loader_; |
| 247 | #endif |
| 248 | |
danakj | 954b09b | 2017-11-02 17:56:47 | [diff] [blame] | 249 | THREAD_CHECKER(main_thread_checker_); |
| 250 | |
tfarina | 556a723 | 2014-10-05 01:02:09 | [diff] [blame] | 251 | DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 252 | }; |
| 253 | |
[email protected] | e9ff79c | 2012-10-19 21:31:26 | [diff] [blame] | 254 | } // namespace content |
| 255 | |
tfarina | 556a723 | 2014-10-05 01:02:09 | [diff] [blame] | 256 | #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ |