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

Unified Diff: chrome/browser/resources/workers/index.html

Issue 7714007: Apply content-security-policy directive to chrome://workers page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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: chrome/browser/resources/workers/index.html
===================================================================
--- chrome/browser/resources/workers/index.html (revision 97885)
+++ chrome/browser/resources/workers/index.html (working copy)
@@ -1,4 +1,10 @@
+<!DOCTYPE HTML>
+<!-- Copyright (c) 2011 The Chromium Authors. All rights reserved.
+ Use of this source code is governed by a BSD-style license that can be
+ found in the LICENSE file.
+-->
<html>
+<include src="../content_security_policy.html"/>
<title>Workers</title>
<style>
thead {
@@ -9,57 +15,8 @@
}
</style>
-<script>
-function requestData() {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', 'workers_data.json', false);
- xhr.send(null);
- if (xhr.status === 200)
- return JSON.parse(xhr.responseText);
- return [];
-}
-
-function addColumn(row, value) {
- var column = document.createElement("td");
- column.textContent = value;
- row.appendChild(column);
-}
-
-function openDevTools(workerProcessHostId, workerRouteId) {
- chrome.send("openDevTools",
- [String(workerProcessHostId), String(workerRouteId)]);
-}
-
-function populateWorkerList() {
- var data = requestData();
-
- var worker_properties = ["workerRouteId", "url", "name", "pid"];
-
- var list = document.getElementById("workers-table");
- for (var i = 0; i < data.length; i++) {
- var workerData = data[i];
- var row = document.createElement("tr");
- for (var j = 0; j < worker_properties.length; j++)
- addColumn(row, workerData[worker_properties[j]]);
-
- var column = document.createElement("td");
- var link = document.createElement("a");
- link.setAttribute("href", "#");
- link.textContent = "inspect";
- link.addEventListener(
- "click",
- openDevTools.bind(this,
- workerData.workerProcessHostId,
- workerData.workerRouteId),
- true);
- column.appendChild(link);
- row.appendChild(column);
-
- list.appendChild(row);
- }
-}
-</script>
-<body onload="populateWorkerList()">
+<script src="chrome://workers/workers.js"></script>
+<body>
<h2>Shared workers:</h2>
<table>
<thead>
« no previous file with comments | « no previous file | chrome/browser/resources/workers/workers.js » ('j') | chrome/browser/ui/webui/chrome_web_ui_data_source.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698