mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Fix dangling raw_ptr errors and related issues (see #3239)
- Use raw_ptr in class container fields. - Use defined lifespan for StreamReaderURLLoader. - Fix lifespan assumptions for WebContents/RFH usage.
This commit is contained in:
@@ -104,11 +104,9 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
|
||||
// on the IO thread unless otherwise indicated.
|
||||
class Delegate : public ResourceResponse {
|
||||
public:
|
||||
// This method is called if the result of calling OpenInputStream was null.
|
||||
// The |restarted| parameter is set to true if the request was restarted
|
||||
// with a new loader.
|
||||
virtual void OnInputStreamOpenFailed(int32_t request_id,
|
||||
bool* restarted) = 0;
|
||||
// Called if the result of calling OpenInputStream was nullptr. Returns
|
||||
// true if the failure was handled.
|
||||
virtual bool OnInputStreamOpenFailed(int32_t request_id) = 0;
|
||||
};
|
||||
|
||||
StreamReaderURLLoader(
|
||||
@@ -127,6 +125,10 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
|
||||
|
||||
void Start();
|
||||
|
||||
// Called by the client in response to OnReceiveResponse.
|
||||
void Continue();
|
||||
void Cancel();
|
||||
|
||||
// network::mojom::URLLoader methods:
|
||||
void FollowRedirect(
|
||||
const std::vector<std::string>& removed_headers,
|
||||
@@ -186,6 +188,9 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
|
||||
|
||||
base::OnceClosure open_cancel_callback_;
|
||||
|
||||
bool need_client_callback_ = false;
|
||||
bool got_client_callback_ = false;
|
||||
|
||||
base::WeakPtrFactory<StreamReaderURLLoader> weak_factory_;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user