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

Side by Side Diff: content/browser/loader/downloaded_temp_file_impl.h

Issue 2715423003: [Mojo-Loading] Use independent URLLoaderClient (Closed)
Patch Set: fix Created 3 years, 9 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_ 5 #ifndef CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_
6 #define CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_ 6 #define CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/common/content_export.h" 9 #include "content/common/content_export.h"
10 #include "content/common/url_loader_factory.mojom.h" 10 #include "content/common/url_loader_factory.mojom.h"
11 11
12 namespace content { 12 namespace content {
13 13
14 // DownloadedTempFileImpl is created on the download_to_file mode of resource 14 // DownloadedTempFileImpl is created on the download_to_file mode of resource
15 // loading. The instance is held by the client and lives until the client 15 // loading. The instance is held by the client and lives until the client
16 // destroys the interface, slightly after the URLLoader is destroyed. 16 // destroys the interface, slightly after the URLLoader is destroyed.
17 class CONTENT_EXPORT DownloadedTempFileImpl final 17 class CONTENT_EXPORT DownloadedTempFileImpl final
18 : public mojom::DownloadedTempFile { 18 : public mojom::DownloadedTempFile {
19 public: 19 public:
20 // Creates a DownloadedTempFileImpl, binds it as a strong associated 20 // Creates a DownloadedTempFileImpl, binds it as a strong interface, and
21 // interface, and returns the interface ptr info to be passed to the client. 21 // returns the interface ptr to be passed to the client.
22 // That means: 22 // That means:
23 // * The DownloadedTempFile object created here is essentially owned by the 23 // * The DownloadedTempFile object created here is essentially owned by the
24 // client. It keeps alive until the client destroys the other endpoint. 24 // client. It keeps alive until the client destroys the other endpoint.
25 // * The resulting interface will be associated to the same message pipe on 25 static mojom::DownloadedTempFilePtr Create(int child_id, int request_id);
26 // which the returned pointer info object is sent.
27 static mojom::DownloadedTempFileAssociatedPtrInfo Create(int child_id,
28 int request_id);
29
30 static mojom::DownloadedTempFilePtr CreateForTesting(int child_id,
31 int request_id);
32 26
33 DownloadedTempFileImpl(int child_id, int request_id); 27 DownloadedTempFileImpl(int child_id, int request_id);
34 ~DownloadedTempFileImpl() override; 28 ~DownloadedTempFileImpl() override;
35 29
36 private: 30 private:
37 int child_id_; 31 const int child_id_;
38 int request_id_; 32 const int request_id_;
39 33
40 DISALLOW_COPY_AND_ASSIGN(DownloadedTempFileImpl); 34 DISALLOW_COPY_AND_ASSIGN(DownloadedTempFileImpl);
41 }; 35 };
42 36
43 } // namespace content 37 } // namespace content
44 38
45 #endif // CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_ 39 #endif // CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/loader/downloaded_temp_file_impl.cc » ('j') | content/child/resource_dispatcher.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698