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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentThreadableLoader.h

Issue 1274063003: [Loader] Make ThreadableLoader non-RefCounted and be managed by OwnPtr (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reflect comments. Created 4 years, 9 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 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013, Intel Corporation 3 * Copyright (C) 2013, Intel Corporation
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 20 matching lines...) Expand all
31 31
32 #ifndef DocumentThreadableLoader_h 32 #ifndef DocumentThreadableLoader_h
33 #define DocumentThreadableLoader_h 33 #define DocumentThreadableLoader_h
34 34
35 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
36 #include "core/fetch/RawResource.h" 36 #include "core/fetch/RawResource.h"
37 #include "core/fetch/ResourceOwner.h" 37 #include "core/fetch/ResourceOwner.h"
38 #include "core/frame/csp/ContentSecurityPolicy.h" 38 #include "core/frame/csp/ContentSecurityPolicy.h"
39 #include "core/loader/ThreadableLoader.h" 39 #include "core/loader/ThreadableLoader.h"
40 #include "platform/Timer.h" 40 #include "platform/Timer.h"
41 #include "platform/heap/Handle.h"
Nate Chapin 2016/03/09 17:51:09 Why this include?
hiroshige 2016/03/09 19:11:24 This is according to tyoshino@'s comment and I thi
41 #include "platform/network/HTTPHeaderMap.h" 42 #include "platform/network/HTTPHeaderMap.h"
42 #include "platform/network/ResourceError.h" 43 #include "platform/network/ResourceError.h"
43 #include "wtf/Forward.h" 44 #include "wtf/Forward.h"
44 #include "wtf/OwnPtr.h" 45 #include "wtf/OwnPtr.h"
45 #include "wtf/PassRefPtr.h" 46 #include "wtf/PassOwnPtr.h"
47 #include "wtf/WeakPtr.h"
46 #include "wtf/text/WTFString.h" 48 #include "wtf/text/WTFString.h"
47 49
48 namespace blink { 50 namespace blink {
49 51
50 class Document; 52 class Document;
51 class KURL; 53 class KURL;
52 class ResourceRequest; 54 class ResourceRequest;
53 class SecurityOrigin; 55 class SecurityOrigin;
54 class ThreadableLoaderClient; 56 class ThreadableLoaderClient;
55 57
56 class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, priv ate RawResourceClient { 58 class CORE_EXPORT DocumentThreadableLoader final : public ThreadableLoader, priv ate RawResourceClient {
57 USING_FAST_MALLOC(DocumentThreadableLoader); 59 USING_FAST_MALLOC(DocumentThreadableLoader);
58 public: 60 public:
59 static void loadResourceSynchronously(Document&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOp tions&); 61 static void loadResourceSynchronously(Document&, const ResourceRequest&, ThreadableLoaderClient&, const ThreadableLoaderOptions&, const ResourceLoaderOp tions&);
60 static PassRefPtr<DocumentThreadableLoader> create(Document&, Threadable LoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&); 62 static PassOwnPtr<DocumentThreadableLoader> create(Document&, Threadable LoaderClient*, const ThreadableLoaderOptions&, const ResourceLoaderOptions&);
61 ~DocumentThreadableLoader() override; 63 ~DocumentThreadableLoader() override;
62 64
63 void start(const ResourceRequest&) override; 65 void start(const ResourceRequest&) override;
64 66
65 void overrideTimeout(unsigned long timeout) override; 67 void overrideTimeout(unsigned long timeout) override;
66 68
67 // |this| may be dead after calling this method in async mode. 69 // |this| may be dead after calling this method in async mode.
68 void cancel() override; 70 void cancel() override;
69 void setDefersLoading(bool); 71 void setDefersLoading(bool);
70 72
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 double m_requestStartedSeconds; // Time an asynchronous fetch request is started 225 double m_requestStartedSeconds; // Time an asynchronous fetch request is started
224 226
225 // Max number of times that this DocumentThreadableLoader can follow 227 // Max number of times that this DocumentThreadableLoader can follow
226 // cross-origin redirects. 228 // cross-origin redirects.
227 // This is used to limit the number of redirects. 229 // This is used to limit the number of redirects.
228 // But this value is not the max number of total redirects allowed, 230 // But this value is not the max number of total redirects allowed,
229 // because same-origin redirects are not counted here. 231 // because same-origin redirects are not counted here.
230 int m_corsRedirectLimit; 232 int m_corsRedirectLimit;
231 233
232 WebURLRequest::FetchRedirectMode m_redirectMode; 234 WebURLRequest::FetchRedirectMode m_redirectMode;
235
236 WeakPtrFactory<DocumentThreadableLoader> m_weakFactory;
233 }; 237 };
234 238
235 } // namespace blink 239 } // namespace blink
236 240
237 #endif // DocumentThreadableLoader_h 241 #endif // DocumentThreadableLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698