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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h

Issue 1937033002: Fix crash in CSSStyleSheetResource::appendData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove client in destructor 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) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2010 Google Inc. All Rights Reserved. 3 * Copyright (C) 2010 Google Inc. All Rights Reserved.
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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 PreloadRequestStream* m_requests = nullptr; 81 PreloadRequestStream* m_requests = nullptr;
82 const KURL* m_predictedBaseElementURL = nullptr; 82 const KURL* m_predictedBaseElementURL = nullptr;
83 }; 83 };
84 84
85 // Each CSSPreloaderResourceClient keeps track of a single CSS resource, and 85 // Each CSSPreloaderResourceClient keeps track of a single CSS resource, and
86 // drives a CSSPreloadScanner as raw data arrives for it. This lets us preload 86 // drives a CSSPreloadScanner as raw data arrives for it. This lets us preload
87 // @import tags before parsing. 87 // @import tags before parsing.
88 class CSSPreloaderResourceClient : public StyleSheetResourceClient { 88 class CSSPreloaderResourceClient : public StyleSheetResourceClient {
89 public: 89 public:
90 CSSPreloaderResourceClient(Resource*, HTMLResourcePreloader*); 90 CSSPreloaderResourceClient(Resource*, HTMLResourcePreloader*);
91 ~CSSPreloaderResourceClient();
91 void notifyFinished(Resource*) override; 92 void notifyFinished(Resource*) override;
92 void didAppendFirstData(const CSSStyleSheetResource*) override; 93 void didAppendFirstData(const CSSStyleSheetResource*) override;
93 String debugName() const override { return "CSSPreloaderResourceClient"; } 94 String debugName() const override { return "CSSPreloaderResourceClient"; }
94 95
95 private: 96 private:
97 void stopObserving();
96 Persistent<Resource> m_resource; 98 Persistent<Resource> m_resource;
97 WeakPersistent<HTMLResourcePreloader> m_preloader; 99 WeakPersistent<HTMLResourcePreloader> m_preloader;
98 }; 100 };
99 101
100 } // namespace blink 102 } // namespace blink
101 103
102 #endif 104 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698