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

Unified Diff: sky/viewer/platform/platform_impl.cc

Issue 727593004: Wire up the Inspector V8 Debugger (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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: sky/viewer/platform/platform_impl.cc
diff --git a/sky/viewer/platform/platform_impl.cc b/sky/viewer/platform/platform_impl.cc
index 2315c4560d35d921da38259599ef7b6c8fb6c7cd..6a19d908f0e57a79f2fc3923de293fb0a185af47 100644
--- a/sky/viewer/platform/platform_impl.cc
+++ b/sky/viewer/platform/platform_impl.cc
@@ -17,6 +17,9 @@
#include "net/base/net_errors.h"
#include "sky/engine/public/platform/WebConvertableToTraceFormat.h"
#include "sky/viewer/platform/weburlloader_impl.h"
+#include "base/files/file_util.h"
+#include "base/files/file_path.h"
+#include "base/path_service.h"
namespace sky {
namespace {
@@ -235,4 +238,29 @@ void PlatformImpl::updateTraceEventDuration(
category_group_enabled, name, traceEventHandle);
}
+blink::WebData PlatformImpl::loadResource(const char* name)
+{
+ base::FilePath root_dir;
+ PathService::Get(base::DIR_SOURCE_ROOT, &root_dir);
+ base::FilePath engine_dir = root_dir.AppendASCII("sky").AppendASCII("engine");
+ base::FilePath v8_dir = engine_dir.AppendASCII("bindings").AppendASCII("core").AppendASCII("v8");
+ base::FilePath inspector_dir = engine_dir.AppendASCII("core").AppendASCII("inspector");
+
+ base::FilePath path;
+ if (std::string("InjectedScriptSource.js") == name)
+ path = inspector_dir.AppendASCII(name);
+ else if (std::string("DebuggerScript.js") == name)
+ path = v8_dir.AppendASCII(name);
+ else
+ CHECK(false);
+
+ printf("%s\n", path.value().c_str());
+ printf("%s\n", name);
+
+ std::string buffer;
+ base::ReadFileToString(path, &buffer);
+ CHECK(!buffer.empty());
+ return blink::WebData(buffer.data(), buffer.size());
+}
+
} // namespace sky

Powered by Google App Engine
This is Rietveld 408576698