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

Side by Side Diff: webkit/fileapi/local_file_system_operation_write_unittest.cc

Issue 10855209: Refactoring: ProtocolHandler::MaybeCreateJob takes NetworkDelegate as argument (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Latest merge Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « webkit/fileapi/file_writer_delegate_unittest.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webkit/fileapi/file_writer_delegate_unittest.cc ('k') | webkit/tools/test_shell/test_shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698