OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "storage/browser/fileapi/file_system_url_request_job.h" | 5 #include "storage/browser/fileapi/file_system_url_request_job.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 return true; | 82 return true; |
83 } | 83 } |
84 | 84 |
85 class FileSystemURLRequestJobFactory : public net::URLRequestJobFactory { | 85 class FileSystemURLRequestJobFactory : public net::URLRequestJobFactory { |
86 public: | 86 public: |
87 FileSystemURLRequestJobFactory(const std::string& storage_domain, | 87 FileSystemURLRequestJobFactory(const std::string& storage_domain, |
88 FileSystemContext* context) | 88 FileSystemContext* context) |
89 : storage_domain_(storage_domain), file_system_context_(context) { | 89 : storage_domain_(storage_domain), file_system_context_(context) { |
90 } | 90 } |
91 | 91 |
92 virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler( | 92 net::URLRequestJob* MaybeCreateJobWithProtocolHandler( |
93 const std::string& scheme, | 93 const std::string& scheme, |
94 net::URLRequest* request, | 94 net::URLRequest* request, |
95 net::NetworkDelegate* network_delegate) const override { | 95 net::NetworkDelegate* network_delegate) const override { |
96 return new storage::FileSystemURLRequestJob( | 96 return new storage::FileSystemURLRequestJob( |
97 request, network_delegate, storage_domain_, file_system_context_); | 97 request, network_delegate, storage_domain_, file_system_context_); |
98 } | 98 } |
99 | 99 |
100 virtual bool IsHandledProtocol(const std::string& scheme) const override { | 100 bool IsHandledProtocol(const std::string& scheme) const override { |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 virtual bool IsHandledURL(const GURL& url) const override { | 104 bool IsHandledURL(const GURL& url) const override { return true; } |
105 return true; | |
106 } | |
107 | 105 |
108 virtual bool IsSafeRedirectTarget(const GURL& location) const override { | 106 bool IsSafeRedirectTarget(const GURL& location) const override { |
109 return false; | 107 return false; |
110 } | 108 } |
111 | 109 |
112 private: | 110 private: |
113 std::string storage_domain_; | 111 std::string storage_domain_; |
114 FileSystemContext* file_system_context_; | 112 FileSystemContext* file_system_context_; |
115 }; | 113 }; |
116 | 114 |
117 } // namespace | 115 } // namespace |
118 | 116 |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 EXPECT_TRUE(delegate_->request_failed()); | 457 EXPECT_TRUE(delegate_->request_failed()); |
460 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); | 458 EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request_->status().error()); |
461 | 459 |
462 ASSERT_FALSE( | 460 ASSERT_FALSE( |
463 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( | 461 storage::ExternalMountPoints::GetSystemInstance()->RevokeFileSystem( |
464 kValidExternalMountPoint)); | 462 kValidExternalMountPoint)); |
465 } | 463 } |
466 | 464 |
467 } // namespace | 465 } // namespace |
468 } // namespace content | 466 } // namespace content |
OLD | NEW |