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/imports/HTMLImportsController.h

Issue 1914183002: Simplify ownership handling of HTMLImportsController. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drop Finalized 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 28 matching lines...) Expand all
39 namespace blink { 39 namespace blink {
40 40
41 class FetchRequest; 41 class FetchRequest;
42 class HTMLImport; 42 class HTMLImport;
43 class HTMLImportChild; 43 class HTMLImportChild;
44 class HTMLImportChildClient; 44 class HTMLImportChildClient;
45 class HTMLImportLoader; 45 class HTMLImportLoader;
46 class HTMLImportTreeRoot; 46 class HTMLImportTreeRoot;
47 class KURL; 47 class KURL;
48 48
49 class HTMLImportsController final : public GarbageCollectedFinalized<HTMLImports Controller>, public Supplement<Document> { 49 class HTMLImportsController final : public GarbageCollected<HTMLImportsControlle r> {
50 USING_GARBAGE_COLLECTED_MIXIN(HTMLImportsController);
51 public: 50 public:
52 static const char* supplementName(); 51 static HTMLImportsController* create(Document& master)
53 static void provideTo(Document&); 52 {
54 static void removeFrom(Document&); 53 return new HTMLImportsController(master);
54 }
55 55
56 explicit HTMLImportsController(Document&); 56 HTMLImportTreeRoot* root() const { return m_root; }
57 virtual ~HTMLImportsController();
58
59 HTMLImportTreeRoot* root() const { return m_root.get(); }
60 57
61 bool shouldBlockScriptExecution(const Document&) const; 58 bool shouldBlockScriptExecution(const Document&) const;
62 HTMLImportChild* load(HTMLImport* parent, HTMLImportChildClient*, FetchReque st); 59 HTMLImportChild* load(HTMLImport* parent, HTMLImportChildClient*, FetchReque st);
63 60
64 Document* master() const; 61 Document* master() const;
65 62
66 HTMLImportLoader* createLoader(); 63 HTMLImportLoader* createLoader();
67 64
68 size_t loaderCount() const { return m_loaders.size(); } 65 size_t loaderCount() const { return m_loaders.size(); }
69 HTMLImportLoader* loaderAt(size_t i) const { return m_loaders[i].get(); } 66 HTMLImportLoader* loaderAt(size_t i) const { return m_loaders[i]; }
70 Document* loaderDocumentAt(size_t) const; 67 Document* loaderDocumentAt(size_t) const;
71 HTMLImportLoader* loaderFor(const Document&) const; 68 HTMLImportLoader* loaderFor(const Document&) const;
72 69
73 DECLARE_VIRTUAL_TRACE(); 70 DECLARE_TRACE();
74
75 private:
76 HTMLImportChild* createChild(const KURL&, HTMLImportLoader*, HTMLImport* par ent, HTMLImportChildClient*);
77 71
78 void dispose(); 72 void dispose();
79 73
74 private:
75 explicit HTMLImportsController(Document&);
76
77 HTMLImportChild* createChild(const KURL&, HTMLImportLoader*, HTMLImport* par ent, HTMLImportChildClient*);
78
80 Member<HTMLImportTreeRoot> m_root; 79 Member<HTMLImportTreeRoot> m_root;
81 using LoaderList = HeapVector<Member<HTMLImportLoader>>; 80 using LoaderList = HeapVector<Member<HTMLImportLoader>>;
82 LoaderList m_loaders; 81 LoaderList m_loaders;
83 }; 82 };
84 83
85 } // namespace blink 84 } // namespace blink
86 85
87 #endif // HTMLImportsController_h 86 #endif // HTMLImportsController_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698