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

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

Issue 648813002: PlzNavigate: Add first version of NavigationURLLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@plz-navigate-prepare
Patch Set: mmenke comments Created 6 years, 2 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
(Empty)
1 // Copyright 2014 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_LOADER_NAVIGATION_URL_LOADER_IMPL_H_
6 #define CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "content/browser/loader/navigation_url_loader.h"
12
13 namespace net {
14 struct RedirectInfo;
15 }
16
17 namespace content {
18
19 class NavigationURLLoaderImplCore;
20 class StreamHandle;
21 struct ResourceResponse;
22
23 class NavigationURLLoaderImpl : public NavigationURLLoader {
24 public:
25 // The caller is responsible for ensuring that |delegate| outlives the loader.
26 NavigationURLLoaderImpl(BrowserContext* browser_context,
27 int64 frame_tree_node_id,
28 const CommonNavigationParams& common_params,
29 scoped_ptr<NavigationRequestInfo> request_info,
30 ResourceRequestBody* request_body,
31 NavigationURLLoaderDelegate* delegate);
32 ~NavigationURLLoaderImpl() override;
33
34 // Called in response to OnRequestRedirected to continue processing the
35 // request.
36 void FollowRedirect() override;
37
38 private:
39 friend class NavigationURLLoaderImplCore;
40
41 // Notifies the delegate of a redirect.
42 void NotifyRequestRedirected(const net::RedirectInfo& redirect_info,
43 ResourceResponse* response);
44
45 // Notifies the delegate that the response has started.
46 void NotifyResponseStarted(ResourceResponse* response,
47 scoped_ptr<StreamHandle> body);
48
49 // Notifies the delegate the request failed to return a response.
50 void NotifyRequestFailed(int net_error);
51
52 NavigationURLLoaderDelegate *delegate_;
nasko 2014/10/23 22:36:17 * goes with the type, not the variable.
davidben 2014/10/27 20:46:04 Done.
53
54 // |core_| is deleted on the IO thread in a subsequent task when the
55 // |NavigationURLLoaderImpl goes out of scope.
nasko 2014/10/23 22:36:16 Drop the | before NavigationURLLoaderImpl, as it i
davidben 2014/10/27 20:46:04 Done. I think emacs M-q tried to be clever...
56 NavigationURLLoaderImplCore* core_;
57
58 base::WeakPtrFactory<NavigationURLLoaderImpl> weak_factory_;
59
60 DISALLOW_COPY_AND_ASSIGN(NavigationURLLoaderImpl);
61 };
62
63 } // namespace content
64
65 #endif // CONTENT_BROWSER_LOADER_NAVIGATION_URL_LOADER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698