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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceLoader.h

Issue 1418003006: Simplify starting a navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enum-ify Created 5 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 29 matching lines...) Expand all
40 namespace blink { 40 namespace blink {
41 41
42 class Resource; 42 class Resource;
43 class KURL; 43 class KURL;
44 class ResourceError; 44 class ResourceError;
45 class ResourceFetcher; 45 class ResourceFetcher;
46 class ThreadedDataReceiver; 46 class ThreadedDataReceiver;
47 47
48 class CORE_EXPORT ResourceLoader final : public GarbageCollectedFinalized<Resour ceLoader>, protected WebURLLoaderClient { 48 class CORE_EXPORT ResourceLoader final : public GarbageCollectedFinalized<Resour ceLoader>, protected WebURLLoaderClient {
49 public: 49 public:
50 static ResourceLoader* create(ResourceFetcher*, Resource*, const ResourceReq uest&, const ResourceLoaderOptions&); 50 static ResourceLoader* create(ResourceFetcher*, Resource*, ResourceRequest&, const ResourceLoaderOptions&);
51 ~ResourceLoader() override; 51 ~ResourceLoader() override;
52 DECLARE_TRACE(); 52 DECLARE_TRACE();
53 53
54 void start(); 54 void start();
55 void changeToSynchronous(); 55 void changeToSynchronous();
56 56
57 void cancel(); 57 void cancel();
58 void cancel(const ResourceError&); 58 void cancel(const ResourceError&);
59 void cancelIfNotFinishing(); 59 void cancelIfNotFinishing();
60 60
61 Resource* cachedResource() { return m_resource; } 61 Resource* cachedResource() { return m_resource; }
62 const ResourceRequest& originalRequest() const { return m_originalRequest; }
63 62
64 void setDefersLoading(bool); 63 void setDefersLoading(bool);
65 bool defersLoading() const { return m_defersLoading; } 64 bool defersLoading() const { return m_defersLoading; }
66 65
67 void attachThreadedDataReceiver(PassRefPtrWillBeRawPtr<ThreadedDataReceiver> ); 66 void attachThreadedDataReceiver(PassRefPtrWillBeRawPtr<ThreadedDataReceiver> );
68 67
69 void releaseResources(); 68 void releaseResources();
70 69
71 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); 70 void didChangePriority(ResourceLoadPriority, int intraPriorityValue);
72 71
73 // WebURLLoaderClient 72 // WebURLLoaderClient
74 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse& redirectResponse) override; 73 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse& redirectResponse) override;
75 void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override; 74 void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
76 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) override; 75 void didReceiveResponse(WebURLLoader*, const WebURLResponse&) override;
77 void didReceiveResponse(WebURLLoader*, const WebURLResponse&, WebDataConsume rHandle*) override; 76 void didReceiveResponse(WebURLLoader*, const WebURLResponse&, WebDataConsume rHandle*) override;
78 void didReceiveData(WebURLLoader*, const char*, int, int encodedDataLength) override; 77 void didReceiveData(WebURLLoader*, const char*, int, int encodedDataLength) override;
79 void didReceiveCachedMetadata(WebURLLoader*, const char* data, int length) o verride; 78 void didReceiveCachedMetadata(WebURLLoader*, const char* data, int length) o verride;
80 void didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataL ength) override; 79 void didFinishLoading(WebURLLoader*, double finishTime, int64_t encodedDataL ength) override;
81 void didFail(WebURLLoader*, const WebURLError&) override; 80 void didFail(WebURLLoader*, const WebURLError&) override;
82 void didDownloadData(WebURLLoader*, int, int) override; 81 void didDownloadData(WebURLLoader*, int, int) override;
83 82
84 const KURL& url() const { return m_request.url(); } 83 const KURL& url() const { return m_request.url(); }
85 bool isLoadedBy(ResourceFetcher*) const; 84 bool isLoadedBy(ResourceFetcher*) const;
86 85
87 bool reachedTerminalState() const { return m_state == Terminated; } 86 bool reachedTerminalState() const { return m_state == Terminated; }
88 const ResourceRequest& request() const { return m_request; }
89 87
90 bool loadingMultipartContent() const { return m_loadingMultipartContent; } 88 bool loadingMultipartContent() const { return m_loadingMultipartContent; }
91 89
92 private: 90 private:
93 ResourceLoader(ResourceFetcher*, Resource*, const ResourceLoaderOptions&); 91 ResourceLoader(ResourceFetcher*, Resource*, const ResourceLoaderOptions&);
94 92
95 void init(const ResourceRequest&); 93 void init(ResourceRequest&);
96 void requestSynchronously(); 94 void requestSynchronously();
97 95
98 void didFinishLoadingOnePart(double finishTime, int64_t encodedDataLength); 96 void didFinishLoadingOnePart(double finishTime, int64_t encodedDataLength);
99 97
100 bool responseNeedsAccessControlCheck() const; 98 bool responseNeedsAccessControlCheck() const;
101 99
102 ResourceRequest& applyOptions(ResourceRequest&) const; 100 ResourceRequest& applyOptions(ResourceRequest&) const;
103 101
104 OwnPtr<WebURLLoader> m_loader; 102 OwnPtr<WebURLLoader> m_loader;
105 Member<ResourceFetcher> m_fetcher; 103 Member<ResourceFetcher> m_fetcher;
106 104
107 ResourceRequest m_request; 105 ResourceRequest m_request;
108 ResourceRequest m_originalRequest; // Before redirects.
109 106
110 bool m_notifiedLoadComplete; 107 bool m_notifiedLoadComplete;
111 108
112 bool m_defersLoading; 109 bool m_defersLoading;
113 bool m_loadingMultipartContent; 110 bool m_loadingMultipartContent;
114 ResourceRequest m_deferredRequest; 111 ResourceRequest m_deferredRequest;
115 ResourceLoaderOptions m_options; 112 ResourceLoaderOptions m_options;
116 113
117 enum ResourceLoaderState { 114 enum ResourceLoaderState {
118 Initialized, 115 Initialized,
(...skipping 15 matching lines...) Expand all
134 ResourceLoaderState m_state; 131 ResourceLoaderState m_state;
135 132
136 // Used for sanity checking to make sure we don't experience illegal state 133 // Used for sanity checking to make sure we don't experience illegal state
137 // transitions. 134 // transitions.
138 ConnectionState m_connectionState; 135 ConnectionState m_connectionState;
139 }; 136 };
140 137
141 } 138 }
142 139
143 #endif 140 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp ('k') | third_party/WebKit/Source/core/fetch/ResourceLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698