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

Unified Diff: third_party/WebKit/Source/core/loader/DocumentLoader.h

Issue 2556053002: Clarify when DocumentLoader's FrameLoader/FrameLoaderClient accessors can be used (Closed)
Patch Set: Rebase and comment fix Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/DocumentLoader.h
diff --git a/third_party/WebKit/Source/core/loader/DocumentLoader.h b/third_party/WebKit/Source/core/loader/DocumentLoader.h
index cf8dbc2d2b38d1961465dd012037e1fbef056c79..40a807f4c832159f0ca3868eb095ffe59335af5f 100644
--- a/third_party/WebKit/Source/core/loader/DocumentLoader.h
+++ b/third_party/WebKit/Source/core/loader/DocumentLoader.h
@@ -60,6 +60,7 @@ class ResourceFetcher;
class DocumentInit;
class LocalFrame;
class FrameLoader;
+class FrameLoaderClient;
class ResourceTimingInfo;
class WebDocumentSubresourceFilter;
struct ViewportDescriptionWrapper;
@@ -74,6 +75,8 @@ class CORE_EXPORT DocumentLoader
const ResourceRequest& request,
const SubstituteData& data,
ClientRedirectPolicy clientRedirectPolicy) {
+ DCHECK(frame);
+
return new DocumentLoader(frame, request, data, clientRedirectPolicy);
}
~DocumentLoader() override;
@@ -206,7 +209,10 @@ class CORE_EXPORT DocumentLoader
const KURL& overridingURL = KURL());
void endWriting();
- FrameLoader* frameLoader() const;
+ // Use these method only where it's guaranteed that |m_frame| hasn't been
+ // cleared.
+ FrameLoader& frameLoader() const;
+ FrameLoaderClient* frameLoaderClient() const;
yhirano 2016/12/26 08:46:23 What is the reference-pointer policy here? Both fr
tyoshino (SeeGerritForStatus) 2017/01/10 10:29:25 Ah, right. Changed frameLoaderClient() to also be
void commitIfReady();
void commitData(const char* bytes, size_t length);
@@ -216,6 +222,8 @@ class CORE_EXPORT DocumentLoader
void finishedLoading(double finishTime);
void cancelLoadAfterXFrameOptionsOrCSPDenied(const ResourceResponse&);
+
+ // RawResourceClient implementation
bool redirectReceived(Resource*,
const ResourceRequest&,
const ResourceResponse&) final;
@@ -223,10 +231,13 @@ class CORE_EXPORT DocumentLoader
const ResourceResponse&,
std::unique_ptr<WebDataConsumerHandle>) final;
void dataReceived(Resource*, const char* data, size_t length) final;
- void processData(const char* data, size_t length);
+
+ // ResourceClient implementation
void notifyFinished(Resource*) final;
String debugName() const override { return "DocumentLoader"; }
+ void processData(const char* data, size_t length);
+
bool maybeLoadEmpty();
bool isRedirectAfterPost(const ResourceRequest&, const ResourceResponse&);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/DocumentLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698