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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { | 154 class TestProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { |
155 public: | 155 public: |
156 explicit TestProtocolHandler( | 156 explicit TestProtocolHandler( |
157 webkit_blob::BlobStorageController* blob_storage_controller) | 157 webkit_blob::BlobStorageController* blob_storage_controller) |
158 : blob_storage_controller_(blob_storage_controller) {} | 158 : blob_storage_controller_(blob_storage_controller) {} |
159 | 159 |
160 virtual ~TestProtocolHandler() {} | 160 virtual ~TestProtocolHandler() {} |
161 | 161 |
162 virtual net::URLRequestJob* MaybeCreateJob( | 162 virtual net::URLRequestJob* MaybeCreateJob( |
163 net::URLRequest* request) const OVERRIDE { | 163 net::URLRequest* request, |
| 164 net::NetworkDelegate* network_delegate) const OVERRIDE { |
164 return new webkit_blob::BlobURLRequestJob( | 165 return new webkit_blob::BlobURLRequestJob( |
165 request, | 166 request, |
| 167 network_delegate, |
166 blob_storage_controller_->GetBlobDataFromUrl(request->url()), | 168 blob_storage_controller_->GetBlobDataFromUrl(request->url()), |
167 base::MessageLoopProxy::current()); | 169 base::MessageLoopProxy::current()); |
168 } | 170 } |
169 | 171 |
170 private: | 172 private: |
171 webkit_blob::BlobStorageController* const blob_storage_controller_; | 173 webkit_blob::BlobStorageController* const blob_storage_controller_; |
172 | 174 |
173 DISALLOW_COPY_AND_ASSIGN(TestProtocolHandler); | 175 DISALLOW_COPY_AND_ASSIGN(TestProtocolHandler); |
174 }; | 176 }; |
175 | 177 |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 // so nothing should have happen. | 401 // so nothing should have happen. |
400 EXPECT_EQ(0, bytes_written()); | 402 EXPECT_EQ(0, bytes_written()); |
401 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); | 403 EXPECT_EQ(base::PLATFORM_FILE_ERROR_ABORT, status()); |
402 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); | 404 EXPECT_EQ(base::PLATFORM_FILE_OK, cancel_status()); |
403 EXPECT_TRUE(complete()); | 405 EXPECT_TRUE(complete()); |
404 } | 406 } |
405 | 407 |
406 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. | 408 // TODO(ericu,dmikurube,kinuko): Add more tests for cancel cases. |
407 | 409 |
408 } // namespace fileapi | 410 } // namespace fileapi |
OLD | NEW |