| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/browser/layout_test/layout_test_browser_context.h" | 5 #include "content/shell/browser/layout_test/layout_test_browser_context.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 GURL url = request->url(); | 60 GURL url = request->url(); |
| 61 if (!base::EndsWith(url.path(), ".mojom", | 61 if (!base::EndsWith(url.path(), ".mojom", |
| 62 base::CompareCase::INSENSITIVE_ASCII)) { | 62 base::CompareCase::INSENSITIVE_ASCII)) { |
| 63 return nullptr; | 63 return nullptr; |
| 64 } | 64 } |
| 65 if (!GetBuildDirectory(&prefix)) | 65 if (!GetBuildDirectory(&prefix)) |
| 66 return nullptr; | 66 return nullptr; |
| 67 | 67 |
| 68 prefix = prefix.AppendASCII("gen"); | 68 prefix = prefix.AppendASCII("gen"); |
| 69 | 69 |
| 70 base::FilePath path = prefix.AppendASCII(url.path().substr(2) + ".js"); | 70 base::FilePath path = |
| 71 prefix.AppendASCII(url.path().substr(2).as_string() + ".js"); |
| 71 if (path.ReferencesParent()) | 72 if (path.ReferencesParent()) |
| 72 return nullptr; | 73 return nullptr; |
| 73 | 74 |
| 74 return new net::URLRequestFileJob( | 75 return new net::URLRequestFileJob( |
| 75 request, network_delegate, path, | 76 request, network_delegate, path, |
| 76 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); | 77 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE)); |
| 77 } | 78 } |
| 78 }; | 79 }; |
| 79 | 80 |
| 80 } // namespace | 81 } // namespace |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 background_sync_controller_.reset(new MockBackgroundSyncController()); | 133 background_sync_controller_.reset(new MockBackgroundSyncController()); |
| 133 return background_sync_controller_.get(); | 134 return background_sync_controller_.get(); |
| 134 } | 135 } |
| 135 | 136 |
| 136 LayoutTestPermissionManager* | 137 LayoutTestPermissionManager* |
| 137 LayoutTestBrowserContext::GetLayoutTestPermissionManager() { | 138 LayoutTestBrowserContext::GetLayoutTestPermissionManager() { |
| 138 return static_cast<LayoutTestPermissionManager*>(GetPermissionManager()); | 139 return static_cast<LayoutTestPermissionManager*>(GetPermissionManager()); |
| 139 } | 140 } |
| 140 | 141 |
| 141 } // namespace content | 142 } // namespace content |
| OLD | NEW |