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

Unified Diff: sky/framework/inspector/page-agent.sky

Issue 727593004: Wire up the Inspector V8 Debugger (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Actually works 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/framework/inspector/page-agent.sky
diff --git a/sky/framework/inspector/page-agent.sky b/sky/framework/inspector/page-agent.sky
index 31078a574448666eac61224f75538e8d1a984f54..875d5719301ef3179c79eb802451230b75aa9904 100644
--- a/sky/framework/inspector/page-agent.sky
+++ b/sky/framework/inspector/page-agent.sky
@@ -1,5 +1,7 @@
+<import src="/sky/framework/xmlhttprequest.sky" as="XMLHttpRequest" />
<script>
-function Page() {
+function Page(delegate) {
+ this.delegate_ = delegate;
}
Page.prototype.enable = function() {
@@ -17,14 +19,28 @@ Page.prototype.canEmulate = function() {
};
};
+Page.prototype.getResourceContent = function(params, message_id) {
+ var request = new XMLHttpRequest;
+ request.onload = function() {
+ var message = {
+ 'content' : request.responseText,
+ };
+ this.delegate_.sendResponse(message_id, message);
+ }.bind(this);
+ request.open("GET", params.url);
+ request.send();
+
+ return this.delegate_.ASYNC_RESPONSE;
+};
+
Page.prototype.getResourceTree = function() {
// Unclear if this is all needed, but if we don't return something here
// the inspector hits an exception in WebInspector.ResourceTreeModel.
return {
"frameTree": {
"frame": {
- "id": 1,
- "loaderId": 1,
+ "id": "1",
+ "loaderId": "1",
"url": document.URL,
"mimeType": "text/html",
"securityOrigin": document.URL,

Powered by Google App Engine
This is Rietveld 408576698