Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: extensions/browser/extension_protocols.cc

Issue 2786583002: chromeos: Check both original and absolute paths for file: scheme (Closed)
Patch Set: address comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 277
278 private: 278 private:
279 ~URLRequestExtensionJob() override { 279 ~URLRequestExtensionJob() override {
280 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.TotalKbRead", bytes_read_ / 1024); 280 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.TotalKbRead", bytes_read_ / 1024);
281 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.SeekPosition", seek_position_); 281 UMA_HISTOGRAM_COUNTS("ExtensionUrlRequest.SeekPosition", seek_position_);
282 if (request_timer_.get()) 282 if (request_timer_.get())
283 UMA_HISTOGRAM_TIMES("ExtensionUrlRequest.Latency", 283 UMA_HISTOGRAM_TIMES("ExtensionUrlRequest.Latency",
284 request_timer_->Elapsed()); 284 request_timer_->Elapsed());
285 } 285 }
286 286
287 // Returns true to disable the file patch checking for file: scheme in
288 // URLRequestFileJob, that's not relevant for this class.
289 bool CanAccessFile(const base::FilePath& original_path,
290 const base::FilePath& absolute_path) override {
291 return true;
Devlin 2017/05/25 15:06:30 What do |original_path| and |absolute_path| here l
satorux1 2017/05/25 21:14:50 If the original_path is a symlink in the user's Do
Devlin 2017/05/26 00:55:36 Unfortunately, I think we do allow sym links in ex
satorux1 2017/05/26 03:28:38 Done. I'm going to run try bots.
satorux1 2017/05/26 05:00:40 I got this error: [ RUN ] ExtensionProtocols
satorux1 2017/05/29 03:36:16 Changed to |original_path| but still the test fail
292 }
293
287 void OnFilePathAndLastModifiedTimeRead(base::FilePath* read_file_path, 294 void OnFilePathAndLastModifiedTimeRead(base::FilePath* read_file_path,
288 base::Time* last_modified_time) { 295 base::Time* last_modified_time) {
289 file_path_ = *read_file_path; 296 file_path_ = *read_file_path;
290 response_info_.headers = BuildHttpHeaders( 297 response_info_.headers = BuildHttpHeaders(
291 content_security_policy_, 298 content_security_policy_,
292 send_cors_header_, 299 send_cors_header_,
293 *last_modified_time); 300 *last_modified_time);
294 URLRequestFileJob::Start(); 301 URLRequestFileJob::Start();
295 } 302 }
296 303
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 extensions::InfoMap* extension_info_map) { 617 extensions::InfoMap* extension_info_map) {
611 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito, 618 return base::MakeUnique<ExtensionProtocolHandler>(is_incognito,
612 extension_info_map); 619 extension_info_map);
613 } 620 }
614 621
615 void SetExtensionProtocolTestHandler(ExtensionProtocolTestHandler* handler) { 622 void SetExtensionProtocolTestHandler(ExtensionProtocolTestHandler* handler) {
616 g_test_handler = handler; 623 g_test_handler = handler;
617 } 624 }
618 625
619 } // namespace extensions 626 } // namespace extensions
OLDNEW
« no previous file with comments | « content/shell/browser/shell_network_delegate.cc ('k') | headless/lib/browser/headless_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698