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

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

Issue 2561743003: Use associated interface on DownloadedTempFile (Closed)
Patch Set: +NOTREACHED on non frame trasfer Created 3 years, 11 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/loader/DEPS ('k') | content/browser/loader/downloaded_temp_file_impl.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 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 mojo {
13 class AssociatedGroup;
14 }
15
12 namespace content { 16 namespace content {
13 17
14 // DownloadedTempFileImpl is created on the download_to_file mode of resource 18 // 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 19 // loading. The instance is held by the client and lives until the client
16 // destroys the interface, slightly after the URLLoader is destroyed. 20 // destroys the interface, slightly after the URLLoader is destroyed.
17 class CONTENT_EXPORT DownloadedTempFileImpl final 21 class CONTENT_EXPORT DownloadedTempFileImpl final
18 : public mojom::DownloadedTempFile { 22 : public mojom::DownloadedTempFile {
19 public: 23 public:
20 static mojo::InterfacePtr<mojom::DownloadedTempFile> Create(int child_id, 24 // Creates a DownloadedTempFileImpl, binds it as a strong associated
21 int request_id); 25 // interface, and returns the interface ptr info to be passed to the client.
26 // That means:
27 // * The DownloadedTempFile object created here is essentially owned by the
28 // client. It keeps alive until the client destroys the other endpoint.
29 // * The resulting interface is associated to the given |associated_group|,
30 // all Mojo IPCs messages that share |associated_group| will arrive in a
31 // sequence.
32 static mojom::DownloadedTempFileAssociatedPtrInfo
33 Create(mojo::AssociatedGroup* associated_group, int child_id, int request_id);
34
35 static mojom::DownloadedTempFilePtr CreateForTesting(int child_id,
36 int request_id);
22 37
23 DownloadedTempFileImpl(int child_id, int request_id); 38 DownloadedTempFileImpl(int child_id, int request_id);
24 ~DownloadedTempFileImpl() override; 39 ~DownloadedTempFileImpl() override;
25 40
26 private: 41 private:
27 int child_id_; 42 int child_id_;
28 int request_id_; 43 int request_id_;
29 44
30 DISALLOW_COPY_AND_ASSIGN(DownloadedTempFileImpl); 45 DISALLOW_COPY_AND_ASSIGN(DownloadedTempFileImpl);
31 }; 46 };
32 47
33 } // namespace content 48 } // namespace content
34 49
35 #endif // CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_ 50 #endif // CONTENT_BROWSER_LOADER_DOWNLOADED_TEMP_FILE_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/loader/DEPS ('k') | content/browser/loader/downloaded_temp_file_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698