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

Side by Side Diff: content/browser/blob_storage/blob_url_loader_factory.h

Issue 2906543002: Add support for reading blobs when using the network service. (Closed)
Patch Set: merge and switch back to associated request 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
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/blob_storage/blob_url_loader_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_
6 #define CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h"
11 #include "content/common/url_loader_factory.mojom.h"
12 #include "content/public/browser/browser_thread.h"
13 #include "mojo/public/cpp/bindings/binding_set.h"
14
15 namespace storage {
16 class BlobStorageContext;
17 class FileSystemContext;
18 }
19
20 namespace content {
21
22 // A class for creating URLLoaderFactory for blob scheme.
23 // There should be one owned per StoragePartition.
24 class BlobURLLoaderFactory
25 : public base::RefCountedThreadSafe<BlobURLLoaderFactory,
26 BrowserThread::DeleteOnIOThread>,
27 public mojom::URLLoaderFactory {
28 public:
29 CONTENT_EXPORT BlobURLLoaderFactory(
30 base::WeakPtr<storage::BlobStorageContext> blob_storage_context,
31 scoped_refptr<storage::FileSystemContext> file_system_context);
32
33 // Creates a URLLoaderFactory interface pointer for serving blob requests.
34 // Called on the UI thread.
35 mojom::URLLoaderFactoryPtr CreateFactory();
36
37 // mojom::URLLoaderFactory implementation:
38 void CreateLoaderAndStart(mojom::URLLoaderAssociatedRequest loader,
39 int32_t routing_id,
40 int32_t request_id,
41 uint32_t options,
42 const ResourceRequest& request,
43 mojom::URLLoaderClientPtr client) override;
44 void SyncLoad(int32_t routing_id,
45 int32_t request_id,
46 const ResourceRequest& request,
47 SyncLoadCallback callback) override;
48
49 private:
50 friend class base::DeleteHelper<BlobURLLoaderFactory>;
51 friend struct BrowserThread::DeleteOnThread<BrowserThread::IO>;
52
53 ~BlobURLLoaderFactory() override;
54
55 void BindOnIO(mojom::URLLoaderFactoryRequest request);
56
57 // Safe to have a raw pointer since the IO thread
dmurph 2017/06/02 20:10:33 nit: update comment, no longer raw pointer.
58 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_;
59 scoped_refptr<storage::FileSystemContext> file_system_context_;
60
61 // Used on the IO thread.
62 mojo::BindingSet<mojom::URLLoaderFactory> loader_factory_bindings_;
63
64 DISALLOW_COPY_AND_ASSIGN(BlobURLLoaderFactory);
65 };
66
67 } // namespace content
68
69 #endif // CONTENT_BROWSER_BLOB_STORAGE_BLOB_URL_LOADER_FACTORY_H_
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/blob_storage/blob_url_loader_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698