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

Side by Side Diff: content/renderer/renderer_blink_platform_impl.h

Issue 2668663002: Purge memory before suspending timer queues when backgrounded. (Closed)
Patch Set: Add requestPurgeMemory to Platform Created 3 years, 10 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_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ 5 #ifndef CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_
6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ 6 #define CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class WebSecurityOrigin; 43 class WebSecurityOrigin;
44 class WebServiceWorkerCacheStorage; 44 class WebServiceWorkerCacheStorage;
45 } 45 }
46 46
47 namespace service_manager { 47 namespace service_manager {
48 class InterfaceProvider; 48 class InterfaceProvider;
49 } 49 }
50 50
51 namespace content { 51 namespace content {
52 class BlinkInterfaceProviderImpl; 52 class BlinkInterfaceProviderImpl;
53 class ChildMemoryCoordinatorImpl;
53 class LocalStorageCachedAreas; 54 class LocalStorageCachedAreas;
54 class PlatformEventObserverBase; 55 class PlatformEventObserverBase;
55 class QuotaMessageFilter; 56 class QuotaMessageFilter;
56 class RendererClipboardDelegate; 57 class RendererClipboardDelegate;
57 class ThreadSafeSender; 58 class ThreadSafeSender;
58 class WebClipboardImpl; 59 class WebClipboardImpl;
59 class WebDatabaseObserverImpl; 60 class WebDatabaseObserverImpl;
60 61
61 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { 62 class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
62 public: 63 public:
63 RendererBlinkPlatformImpl( 64 RendererBlinkPlatformImpl(
64 blink::scheduler::RendererScheduler* renderer_scheduler, 65 blink::scheduler::RendererScheduler* renderer_scheduler,
65 base::WeakPtr<service_manager::InterfaceProvider> remote_interfaces); 66 base::WeakPtr<service_manager::InterfaceProvider> remote_interfaces,
67 ChildMemoryCoordinatorImpl* memory_coordinator);
66 ~RendererBlinkPlatformImpl() override; 68 ~RendererBlinkPlatformImpl() override;
67 69
68 // Shutdown must be called just prior to shutting down blink. 70 // Shutdown must be called just prior to shutting down blink.
69 void Shutdown(); 71 void Shutdown();
70 72
71 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) { 73 void set_plugin_refresh_allowed(bool plugin_refresh_allowed) {
72 plugin_refresh_allowed_ = plugin_refresh_allowed; 74 plugin_refresh_allowed_ = plugin_refresh_allowed;
73 } 75 }
74 // Platform methods: 76 // Platform methods:
75 blink::WebClipboard* clipboard() override; 77 blink::WebClipboard* clipboard() override;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // is invoked. 227 // is invoked.
226 static void SetMockDeviceOrientationDataForTesting( 228 static void SetMockDeviceOrientationDataForTesting(
227 const blink::WebDeviceOrientationData& data); 229 const blink::WebDeviceOrientationData& data);
228 230
229 WebDatabaseObserverImpl* web_database_observer_impl() { 231 WebDatabaseObserverImpl* web_database_observer_impl() {
230 return web_database_observer_impl_.get(); 232 return web_database_observer_impl_.get();
231 } 233 }
232 234
233 blink::WebURLLoader* createURLLoader() override; 235 blink::WebURLLoader* createURLLoader() override;
234 236
237 void requestPurgeMemory() override;
238
235 private: 239 private:
236 bool CheckPreparsedJsCachingEnabled() const; 240 bool CheckPreparsedJsCachingEnabled() const;
237 241
238 // Factory that takes a type and return PlatformEventObserverBase that matches 242 // Factory that takes a type and return PlatformEventObserverBase that matches
239 // it. 243 // it.
240 static std::unique_ptr<PlatformEventObserverBase> 244 static std::unique_ptr<PlatformEventObserverBase>
241 CreatePlatformEventObserverFromType(blink::WebPlatformEventType type); 245 CreatePlatformEventObserverFromType(blink::WebPlatformEventType type);
242 246
243 // Use the data previously set via SetMockDevice...DataForTesting() and send 247 // Use the data previously set via SetMockDevice...DataForTesting() and send
244 // them to the registered listener. 248 // them to the registered listener.
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 TopLevelBlameContext top_level_blame_context_; 295 TopLevelBlameContext top_level_blame_context_;
292 296
293 WebTrialTokenValidatorImpl trial_token_validator_; 297 WebTrialTokenValidatorImpl trial_token_validator_;
294 298
295 std::unique_ptr<LocalStorageCachedAreas> local_storage_cached_areas_; 299 std::unique_ptr<LocalStorageCachedAreas> local_storage_cached_areas_;
296 300
297 std::unique_ptr<BlinkInterfaceProviderImpl> blink_interface_provider_; 301 std::unique_ptr<BlinkInterfaceProviderImpl> blink_interface_provider_;
298 302
299 mojom::URLLoaderFactoryAssociatedPtr url_loader_factory_; 303 mojom::URLLoaderFactoryAssociatedPtr url_loader_factory_;
300 304
305 ChildMemoryCoordinatorImpl* memory_coordinator_; // NOT OWNED
306
301 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl); 307 DISALLOW_COPY_AND_ASSIGN(RendererBlinkPlatformImpl);
302 }; 308 };
303 309
304 } // namespace content 310 } // namespace content
305 311
306 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_ 312 #endif // CONTENT_RENDERER_RENDERER_BLINK_PLATFORM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698