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 "extensions/browser/extension_protocols.h" | 5 #include "extensions/browser/extension_protocols.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 weak_factory_(this) { | 195 weak_factory_(this) { |
196 if (follow_symlinks_anywhere) { | 196 if (follow_symlinks_anywhere) { |
197 resource_.set_follow_symlinks_anywhere(); | 197 resource_.set_follow_symlinks_anywhere(); |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 void GetResponseInfo(net::HttpResponseInfo* info) override { | 201 void GetResponseInfo(net::HttpResponseInfo* info) override { |
202 *info = response_info_; | 202 *info = response_info_; |
203 } | 203 } |
204 | 204 |
205 // This always returns 200 because a URLRequestExtensionJob will only get | |
206 // created in MaybeCreateJob() if the file exists. | |
207 int GetResponseCode() const override { return 200; } | |
208 | |
209 void Start() override { | 205 void Start() override { |
210 request_timer_.reset(new base::ElapsedTimer()); | 206 request_timer_.reset(new base::ElapsedTimer()); |
211 base::FilePath* read_file_path = new base::FilePath; | 207 base::FilePath* read_file_path = new base::FilePath; |
212 base::Time* last_modified_time = new base::Time(); | 208 base::Time* last_modified_time = new base::Time(); |
213 | 209 |
214 // Inherit task priority from the calling context. | 210 // Inherit task priority from the calling context. |
215 base::PostTaskWithTraitsAndReply( | 211 base::PostTaskWithTraitsAndReply( |
216 FROM_HERE, base::TaskTraits().MayBlock(), | 212 FROM_HERE, base::TaskTraits().MayBlock(), |
217 base::Bind(&ReadResourceFilePathAndLastModifiedTime, resource_, | 213 base::Bind(&ReadResourceFilePathAndLastModifiedTime, resource_, |
218 directory_path_, base::Unretained(read_file_path), | 214 directory_path_, base::Unretained(read_file_path), |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 extensions::InfoMap* extension_info_map) { | 610 extensions::InfoMap* extension_info_map) { |
615 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, | 611 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, |
616 extension_info_map); | 612 extension_info_map); |
617 } | 613 } |
618 | 614 |
619 void SetExtensionProtocolTestHandler(ExtensionProtocolTestHandler* handler) { | 615 void SetExtensionProtocolTestHandler(ExtensionProtocolTestHandler* handler) { |
620 g_test_handler = handler; | 616 g_test_handler = handler; |
621 } | 617 } |
622 | 618 |
623 } // namespace extensions | 619 } // namespace extensions |
OLD | NEW |