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

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

Issue 2326913003: Privatize StrongBinding lifetime management (Closed)
Patch Set: rebase Created 4 years, 3 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_URL_LOADER_FACTORY_IMPL_H_ 5 #ifndef CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_
6 #define CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ 6 #define CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
11 #include "content/common/url_loader_factory.mojom.h" 11 #include "content/common/url_loader_factory.mojom.h"
12 #include "mojo/public/cpp/bindings/interface_request.h" 12 #include "mojo/public/cpp/bindings/interface_request.h"
13 #include "mojo/public/cpp/bindings/strong_binding.h"
14 13
15 namespace content { 14 namespace content {
16 15
17 class ResourceMessageFilter; 16 class ResourceMessageFilter;
18 17
19 // This class is an implementation of mojom::URLLoaderFactory that creates 18 // This class is an implementation of mojom::URLLoaderFactory that creates
20 // a mojom::URLLoader. 19 // a mojom::URLLoader.
21 class URLLoaderFactoryImpl final : public mojom::URLLoaderFactory { 20 class URLLoaderFactoryImpl final : public mojom::URLLoaderFactory {
22 public: 21 public:
23 ~URLLoaderFactoryImpl() override; 22 ~URLLoaderFactoryImpl() override;
24 23
25 void CreateLoaderAndStart(mojom::URLLoaderRequest request, 24 void CreateLoaderAndStart(mojom::URLLoaderRequest request,
26 int32_t request_id, 25 int32_t request_id,
27 const ResourceRequest& url_request, 26 const ResourceRequest& url_request,
28 mojom::URLLoaderClientPtr client) override; 27 mojom::URLLoaderClientPtr client) override;
29 28
30 // Creates a URLLoaderFactoryImpl instance. The instance is held by the 29 // Creates a URLLoaderFactoryImpl instance. The instance is held by the
31 // StrongBinding in it, so this function doesn't return the instance. 30 // StrongBinding in it, so this function doesn't return the instance.
32 CONTENT_EXPORT static void Create( 31 CONTENT_EXPORT static void Create(
33 scoped_refptr<ResourceMessageFilter> resource_message_filter, 32 scoped_refptr<ResourceMessageFilter> resource_message_filter,
34 mojo::InterfaceRequest<mojom::URLLoaderFactory> request); 33 mojom::URLLoaderFactoryRequest request);
35 34
36 private: 35 private:
37 URLLoaderFactoryImpl( 36 explicit URLLoaderFactoryImpl(
38 scoped_refptr<ResourceMessageFilter> resource_message_filter, 37 scoped_refptr<ResourceMessageFilter> resource_message_filter);
39 mojo::InterfaceRequest<mojom::URLLoaderFactory> request);
40 38
41 scoped_refptr<ResourceMessageFilter> resource_message_filter_; 39 scoped_refptr<ResourceMessageFilter> resource_message_filter_;
42 mojo::StrongBinding<mojom::URLLoaderFactory> binding_;
43 40
44 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl); 41 DISALLOW_COPY_AND_ASSIGN(URLLoaderFactoryImpl);
45 }; 42 };
46 43
47 } // namespace content 44 } // namespace content
48 45
49 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_ 46 #endif // CONTENT_BROWSER_LOADER_URL_LOADER_FACTORY_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/hyphenation/hyphenation_impl.cc ('k') | content/browser/loader/url_loader_factory_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698