Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/scripts/hosted_mode/server.js |
| diff --git a/third_party/WebKit/Source/devtools/scripts/hosted_mode/server.js b/third_party/WebKit/Source/devtools/scripts/hosted_mode/server.js |
| index 811bf70a5d8387a268cdafb9084cef935ec43d9f..b10bc5947ed3e6925593afe3a1694d1ef19be795 100644 |
| --- a/third_party/WebKit/Source/devtools/scripts/hosted_mode/server.js |
| +++ b/third_party/WebKit/Source/devtools/scripts/hosted_mode/server.js |
| @@ -42,7 +42,7 @@ function requestHandler(request, response) |
| var absoluteFilePath = path.join(process.cwd(), filePath); |
| if (!path.resolve(absoluteFilePath).startsWith(devtoolsFolder)) { |
| console.log(`File requested is outside of devtools folder: ${devtoolsFolder}`); |
| - sendResponse(403, "`403 - Access denied. File requested is outside of devtools folder: ${devtoolsFolder}`"); |
|
chenwilliam
2016/08/10 22:04:55
The surrounding double quotes were causing the pla
|
| + sendResponse(403, `403 - Access denied. File requested is outside of devtools folder: ${devtoolsFolder}`); |
| return; |
| } |
| @@ -93,8 +93,11 @@ function proxy(filePath) |
| { |
| if (!(filePath in proxyFilePathToURL)) |
| return null; |
| + if (process.env.CHROMIUM_COMMIT) |
| + return onProxyFileURL(proxyFilePathToURL[filePath](process.env.CHROMIUM_COMMIT)); |
| return fetch(`http://localhost:${remoteDebuggingPort}/json/version`) |
| - .then(onBrowserMetadata); |
| + .then(onBrowserMetadata) |
| + .then(onProxyFileURL); |
| function onBrowserMetadata(metadata) |
| { |
| @@ -102,8 +105,13 @@ function proxy(filePath) |
| var match = metadataObject["WebKit-Version"].match(/\s\(@(\b[0-9a-f]{5,40}\b)/); |
| var commitHash = match[1]; |
| var proxyFileURL = proxyFilePathToURL[filePath](commitHash); |
| + return proxyFileURL; |
| + } |
| + |
| + function onProxyFileURL(proxyFileURL) |
| + { |
| if (proxyFileCache.has(proxyFileURL)) |
| - return proxyFileCache.get(proxyFileURL); |
| + return Promise.resolve(proxyFileCache.get(proxyFileURL)); |
| return fetch(proxyFileURL) |
| .then(cacheProxyFile.bind(null, proxyFileURL)); |
| } |