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 "content/browser/storage_partition_impl_map.h" | 5 #include "content/browser/storage_partition_impl_map.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file_enumerator.h" | 9 #include "base/files/file_enumerator.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 // A derivative that knows about Streams too. | 51 // A derivative that knows about Streams too. |
52 class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { | 52 class BlobProtocolHandler : public net::URLRequestJobFactory::ProtocolHandler { |
53 public: | 53 public: |
54 BlobProtocolHandler(ChromeBlobStorageContext* blob_storage_context, | 54 BlobProtocolHandler(ChromeBlobStorageContext* blob_storage_context, |
55 StreamContext* stream_context, | 55 StreamContext* stream_context, |
56 storage::FileSystemContext* file_system_context) | 56 storage::FileSystemContext* file_system_context) |
57 : blob_storage_context_(blob_storage_context), | 57 : blob_storage_context_(blob_storage_context), |
58 stream_context_(stream_context), | 58 stream_context_(stream_context), |
59 file_system_context_(file_system_context) {} | 59 file_system_context_(file_system_context) {} |
60 | 60 |
61 virtual ~BlobProtocolHandler() { | 61 ~BlobProtocolHandler() override {} |
62 } | |
63 | 62 |
64 virtual net::URLRequestJob* MaybeCreateJob( | 63 net::URLRequestJob* MaybeCreateJob( |
65 net::URLRequest* request, | 64 net::URLRequest* request, |
66 net::NetworkDelegate* network_delegate) const override { | 65 net::NetworkDelegate* network_delegate) const override { |
67 scoped_refptr<Stream> stream = | 66 scoped_refptr<Stream> stream = |
68 stream_context_->registry()->GetStream(request->url()); | 67 stream_context_->registry()->GetStream(request->url()); |
69 if (stream.get()) | 68 if (stream.get()) |
70 return new StreamURLRequestJob(request, network_delegate, stream); | 69 return new StreamURLRequestJob(request, network_delegate, stream); |
71 | 70 |
72 if (!blob_protocol_handler_) { | 71 if (!blob_protocol_handler_) { |
73 // Construction is deferred because 'this' is constructed on | 72 // Construction is deferred because 'this' is constructed on |
74 // the main thread but we want blob_protocol_handler_ constructed | 73 // the main thread but we want blob_protocol_handler_ constructed |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 | 592 |
594 // We do not call InitializeURLRequestContext() for media contexts because, | 593 // We do not call InitializeURLRequestContext() for media contexts because, |
595 // other than the HTTP cache, the media contexts share the same backing | 594 // other than the HTTP cache, the media contexts share the same backing |
596 // objects as their associated "normal" request context. Thus, the previous | 595 // objects as their associated "normal" request context. Thus, the previous |
597 // call serves to initialize the media request context for this storage | 596 // call serves to initialize the media request context for this storage |
598 // partition as well. | 597 // partition as well. |
599 } | 598 } |
600 } | 599 } |
601 | 600 |
602 } // namespace content | 601 } // namespace content |
OLD | NEW |