OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/browser/loader/navigation_url_loader.h" |
| 6 |
| 7 #include "content/browser/loader/navigation_url_loader_factory.h" |
| 8 #include "content/browser/loader/navigation_url_loader_impl.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 static NavigationURLLoaderFactory* g_factory = NULL; |
| 13 |
| 14 NavigationURLLoader* NavigationURLLoader::Create( |
| 15 BrowserContext* browser_context, |
| 16 int64 frame_tree_node_id, |
| 17 const NavigationRequestInfo& request_info, |
| 18 ResourceRequestBody* request_body, |
| 19 Delegate* delegate) { |
| 20 if (g_factory) { |
| 21 return g_factory->CreateLoader( |
| 22 browser_context, frame_tree_node_id, request_info, request_body, |
| 23 delegate); |
| 24 } |
| 25 return new NavigationURLLoaderImpl( |
| 26 browser_context, frame_tree_node_id, request_info, request_body, |
| 27 delegate); |
| 28 } |
| 29 |
| 30 void NavigationURLLoader::SetFactoryForTesting( |
| 31 NavigationURLLoaderFactory* factory) { |
| 32 g_factory = factory; |
| 33 } |
| 34 |
| 35 } // namespace content |
OLD | NEW |