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

Unified Diff: third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h

Issue 2329243002: Implement WTF::WeakPtr in terms of base::WeakPtr (Closed)
Patch Set: Thread-safety fix with comment Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
diff --git a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
index 8de0f0323bc7cbfaf8b33335cb193d51efef354b..37583acce7df0f280c95f2abb55d7c1ed45c8cad 100644
--- a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
+++ b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
@@ -65,7 +65,11 @@ public:
bool shouldCoalesceChunks;
};
- static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, std::unique_ptr<Configuration>, const KURL& documentURL, std::unique_ptr<CachedDocumentParameters>, const MediaValuesCached::MediaValuesCachedData&, std::unique_ptr<WebTaskRunner>);
+ // The returned BackgroundHTMLParser should only be used on the parser
+ // thread: it must first be initialized by calling init(), and free by
+ // calling stop().
+ static WeakPtr<BackgroundHTMLParser> create(std::unique_ptr<Configuration>, std::unique_ptr<WebTaskRunner>);
+ void init(const KURL& documentURL, std::unique_ptr<CachedDocumentParameters>, const MediaValuesCached::MediaValuesCachedData&);
struct Checkpoint {
USING_FAST_MALLOC(Checkpoint);
@@ -90,7 +94,7 @@ public:
void forcePlaintextForTextDocument();
private:
- BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, std::unique_ptr<Configuration>, const KURL& documentURL, std::unique_ptr<CachedDocumentParameters>, const MediaValuesCached::MediaValuesCachedData&, std::unique_ptr<WebTaskRunner>);
+ BackgroundHTMLParser(std::unique_ptr<Configuration>, std::unique_ptr<WebTaskRunner>);
~BackgroundHTMLParser();
void appendDecodedBytes(const String&);

Powered by Google App Engine
This is Rietveld 408576698