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

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

Issue 1923003002: Clear Resource::m_loader in Resource::finish() and Resource::error() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase, comment in background.js Created 4 years, 7 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) 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ~ResourceLoader() override; 48 ~ResourceLoader() override;
49 DECLARE_TRACE(); 49 DECLARE_TRACE();
50 50
51 // Promptly release m_loader. 51 // Promptly release m_loader.
52 EAGERLY_FINALIZE(); 52 EAGERLY_FINALIZE();
53 53
54 void start(ResourceRequest&); 54 void start(ResourceRequest&);
55 55
56 void cancel(); 56 void cancel();
57 void cancel(const ResourceError&); 57 void cancel(const ResourceError&);
58 void cancelIfNotFinishing();
59 58
60 Resource* cachedResource() { return m_resource.get(); } 59 Resource* cachedResource() { return m_resource.get(); }
61 60
62 void setDefersLoading(bool); 61 void setDefersLoading(bool);
63 62
64 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); 63 void didChangePriority(ResourceLoadPriority, int intraPriorityValue);
65 64
66 // WebURLLoaderClient 65 // WebURLLoaderClient
67 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse& redirectResponse) override; 66 void willFollowRedirect(WebURLLoader*, WebURLRequest&, const WebURLResponse& redirectResponse) override;
68 void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override; 67 void didSendData(WebURLLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
(...skipping 23 matching lines...) Expand all
92 Member<ResourceFetcher> m_fetcher; 91 Member<ResourceFetcher> m_fetcher;
93 92
94 bool m_notifiedLoadComplete; 93 bool m_notifiedLoadComplete;
95 94
96 enum ConnectionState { 95 enum ConnectionState {
97 ConnectionStateNew, 96 ConnectionStateNew,
98 ConnectionStateStarted, 97 ConnectionStateStarted,
99 ConnectionStateReceivedResponse, 98 ConnectionStateReceivedResponse,
100 ConnectionStateReceivingData, 99 ConnectionStateReceivingData,
101 ConnectionStateFinishedLoading, 100 ConnectionStateFinishedLoading,
102 ConnectionStateCanceled,
103 ConnectionStateFailed,
104 ConnectionStateReleased 101 ConnectionStateReleased
105 }; 102 };
106 bool isFinishing() { return m_state >= ConnectionStateFinishedLoading && m_s tate <= ConnectionStateFailed; }
107 103
108 Member<Resource> m_resource; 104 Member<Resource> m_resource;
109 105
110 // Used for sanity checking to make sure we don't experience illegal state 106 // Used for sanity checking to make sure we don't experience illegal state
111 // transitions. 107 // transitions.
112 ConnectionState m_state; 108 ConnectionState m_state;
113 }; 109 };
114 110
115 } // namespace blink 111 } // namespace blink
116 112
117 #endif 113 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698