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

Unified Diff: mojo/services/html_viewer/html_viewer.cc

Issue 1016493002: Add a DiscardableMemoryShmemeAllocator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: mojo/services/html_viewer/html_viewer.cc
diff --git a/mojo/services/html_viewer/html_viewer.cc b/mojo/services/html_viewer/html_viewer.cc
index 8c71a9f3ab55ab08188141b4208174ff49dc615b..5c737df045b78ba8bd4db923ae75bd6be96f0eeb 100644
--- a/mojo/services/html_viewer/html_viewer.cc
+++ b/mojo/services/html_viewer/html_viewer.cc
@@ -11,6 +11,7 @@
#include "gin/public/isolate_holder.h"
#include "mojo/application/application_runner_chromium.h"
#include "mojo/services/html_viewer/html_document.h"
+#include "mojo/services/html_viewer/html_viewer_discardable_memory_shmem_allocator.h"
#include "mojo/services/html_viewer/mojo_blink_platform_impl.h"
#include "mojo/services/html_viewer/webmediaplayer_factory.h"
#include "mojo/services/network/public/interfaces/network_service.mojom.h"
@@ -168,6 +169,9 @@ class HTMLViewer : public mojo::ApplicationDelegate,
private:
// Overridden from ApplicationDelegate:
void Initialize(mojo::ApplicationImpl* app) override {
+ base::DiscardableMemoryShmemAllocator::SetInstance(
+ &discardable_memory_allocator_);
+
blink_platform_.reset(new MojoBlinkPlatformImpl(app));
#if defined(V8_USE_EXTERNAL_STARTUP_DATA)
// Note: this requires file system access.
@@ -234,6 +238,11 @@ class HTMLViewer : public mojo::ApplicationDelegate,
&request);
}
+ // TODO(erg): Skia requires that we have one of these. However, all the
jamesr 2015/03/16 23:47:25 what's the action item of the TODO here?
+ // fancy, non-testing versions of this look like they won't work out of the
+ // box with mojo.
+ HtmlViewerDiscardableMemoryShmemAllocator discardable_memory_allocator_;
+
scoped_ptr<MojoBlinkPlatformImpl> blink_platform_;
base::Thread compositor_thread_;
scoped_ptr<WebMediaPlayerFactory> web_media_player_factory_;

Powered by Google App Engine
This is Rietveld 408576698