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

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

Issue 827223002: [mojo] Make HTML viewer load the blink resources from the generated pak file. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding new blink_resource_constants.h file Created 5 years, 11 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/blink_platform_impl.cc
diff --git a/mojo/services/html_viewer/blink_platform_impl.cc b/mojo/services/html_viewer/blink_platform_impl.cc
index d97a5098e1b8ba8a2d2aad6f7fbf5239d701feda..441ca0c182e643a3530d9dcb85f458c76030796b 100644
--- a/mojo/services/html_viewer/blink_platform_impl.cc
+++ b/mojo/services/html_viewer/blink_platform_impl.cc
@@ -11,6 +11,7 @@
#include "base/synchronization/waitable_event.h"
#include "base/threading/platform_thread.h"
#include "base/time/time.h"
+#include "mojo/services/html_viewer/blink_resource_constants.h"
#include "mojo/services/html_viewer/webthread_impl.h"
#include "net/base/data_url.h"
#include "net/base/mime_util.h"
@@ -143,6 +144,20 @@ const unsigned char* BlinkPlatformImpl::getTraceCategoryEnabledFlag(
return buf;
}
+blink::WebData BlinkPlatformImpl::loadResource(const char* resource) {
+ for (size_t i = 0; i < arraysize(kDataResources); ++i) {
+ if (!strcmp(resource, kDataResources[i].name)) {
+ int length;
+ const char* data =
+ blink_resource_map_.GetResource(kDataResources[i].id, &length);
+ CHECK(data != nullptr && length > 0);
+ return blink::WebData(data, length);
+ }
+ }
+ NOTREACHED() << "Requested resource is unavailable!";
+ return blink::WebData();
+}
+
blink::WebURLLoader* BlinkPlatformImpl::createURLLoader() {
return NULL;
}
« no previous file with comments | « mojo/services/html_viewer/blink_platform_impl.h ('k') | mojo/services/html_viewer/blink_resource_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698