OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/extension_resource_protocols.h" | 5 #include "chrome/browser/extensions/extension_resource_protocols.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/common/chrome_paths.h" | 9 #include "chrome/common/chrome_paths.h" |
10 #include "chrome/common/extensions/extension_file_util.h" | 10 #include "chrome/common/extensions/extension_file_util.h" |
11 #include "content/public/browser/browser_thread.h" | 11 #include "content/public/browser/browser_thread.h" |
| 12 #include "net/url_request/url_request_context.h" |
12 #include "net/url_request/url_request_file_job.h" | 13 #include "net/url_request/url_request_file_job.h" |
13 | 14 |
14 namespace { | 15 namespace { |
15 | 16 |
16 class ExtensionResourcesJob : public net::URLRequestFileJob { | 17 class ExtensionResourcesJob : public net::URLRequestFileJob { |
17 public: | 18 public: |
18 explicit ExtensionResourcesJob(net::URLRequest* request) | 19 explicit ExtensionResourcesJob(net::URLRequest* request) |
19 : net::URLRequestFileJob(request, FilePath()), | 20 : net::URLRequestFileJob(request, |
20 thread_id_(content::BrowserThread::UI) { | 21 FilePath(), |
| 22 request->context()->network_delegate()), |
| 23 thread_id_(content::BrowserThread::UI) { |
21 } | 24 } |
22 | 25 |
23 virtual void Start() OVERRIDE; | 26 virtual void Start() OVERRIDE; |
24 | 27 |
25 protected: | 28 protected: |
26 ~ExtensionResourcesJob() {} | 29 ~ExtensionResourcesJob() {} |
27 | 30 |
28 void ResolvePath(); | 31 void ResolvePath(); |
29 void ResolvePathDone(); | 32 void ResolvePathDone(); |
30 | 33 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 net::URLRequest* request) const { | 77 net::URLRequest* request) const { |
75 return new ExtensionResourcesJob(request); | 78 return new ExtensionResourcesJob(request); |
76 } | 79 } |
77 | 80 |
78 } // namespace | 81 } // namespace |
79 | 82 |
80 net::URLRequestJobFactory::ProtocolHandler* | 83 net::URLRequestJobFactory::ProtocolHandler* |
81 CreateExtensionResourceProtocolHandler() { | 84 CreateExtensionResourceProtocolHandler() { |
82 return new ExtensionResourceProtocolHandler(); | 85 return new ExtensionResourceProtocolHandler(); |
83 } | 86 } |
OLD | NEW |