| 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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 281 |
| 282 private: | 282 private: |
| 283 ~URLRequestExtensionJob() override { | 283 ~URLRequestExtensionJob() override { |
| 284 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.TotalKbRead", bytes_read_ / 1024); | 284 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.TotalKbRead", bytes_read_ / 1024); |
| 285 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.SeekPosition", seek_position_); | 285 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.SeekPosition", seek_position_); |
| 286 if (request_timer_.get()) | 286 if (request_timer_.get()) |
| 287 UMA_HISTOGRAM_TIMES("ExtensionUrlRequest.Latency", | 287 UMA_HISTOGRAM_TIMES("ExtensionUrlRequest.Latency", |
| 288 request_timer_->Elapsed()); | 288 request_timer_->Elapsed()); |
| 289 } | 289 } |
| 290 | 290 |
| 291 // ... |
| 292 bool CanAccessFile(const base::FilePath& original_path, |
| 293 const base::FilePath& absolute_path) override { |
| 294 return true; |
| 295 } |
| 296 |
| 291 void OnFilePathAndLastModifiedTimeRead(base::FilePath* read_file_path, | 297 void OnFilePathAndLastModifiedTimeRead(base::FilePath* read_file_path, |
| 292 base::Time* last_modified_time) { | 298 base::Time* last_modified_time) { |
| 293 file_path_ = *read_file_path; | 299 file_path_ = *read_file_path; |
| 294 response_info_.headers = BuildHttpHeaders( | 300 response_info_.headers = BuildHttpHeaders( |
| 295 content_security_policy_, | 301 content_security_policy_, |
| 296 send_cors_header_, | 302 send_cors_header_, |
| 297 *last_modified_time); | 303 *last_modified_time); |
| 298 URLRequestFileJob::Start(); | 304 URLRequestFileJob::Start(); |
| 299 } | 305 } |
| 300 | 306 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 extensions::InfoMap* extension_info_map) { | 620 extensions::InfoMap* extension_info_map) { |
| 615 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, | 621 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, |
| 616 extension_info_map); | 622 extension_info_map); |
| 617 } | 623 } |
| 618 | 624 |
| 619 void SetExtensionProtocolTestHandler(ExtensionProtocolTestHandler* handler) { | 625 void SetExtensionProtocolTestHandler(ExtensionProtocolTestHandler* handler) { |
| 620 g_test_handler = handler; | 626 g_test_handler = handler; |
| 621 } | 627 } |
| 622 | 628 |
| 623 } // namespace extensions | 629 } // namespace extensions |
| OLD | NEW |