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

Side by Side Diff: Source/core/html/imports/HTMLImportsController.h

Issue 305743003: HTMLImportsController does not need to hold Document ptr. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/LinkResource.cpp ('k') | Source/core/html/imports/HTMLImportsController.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLImportsController); 54 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLImportsController);
55 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 55 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
56 public: 56 public:
57 static void provideTo(Document&); 57 static void provideTo(Document&);
58 58
59 explicit HTMLImportsController(Document&); 59 explicit HTMLImportsController(Document&);
60 virtual ~HTMLImportsController(); 60 virtual ~HTMLImportsController();
61 61
62 HTMLImportTreeRoot* root() const { return m_root.get(); } 62 HTMLImportTreeRoot* root() const { return m_root.get(); }
63 63
64 bool isMaster(const Document& document) const { return m_master == &document ; }
65 bool shouldBlockScriptExecution(const Document&) const; 64 bool shouldBlockScriptExecution(const Document&) const;
66 void wasDetachedFrom(const Document&); 65 void wasDetachedFrom(const Document&);
67 66
68 HTMLImportChild* load(HTMLImport* parent, HTMLImportChildClient*, FetchReque st); 67 HTMLImportChild* load(HTMLImport* parent, HTMLImportChildClient*, FetchReque st);
69 void showSecurityErrorMessage(const String&); 68 void showSecurityErrorMessage(const String&);
70 69
71 SecurityOrigin* securityOrigin() const; 70 Document* master() const;
72 ResourceFetcher* fetcher() const;
73 LocalFrame* frame() const;
74 Document* master() const { return m_master; }
75 71
76 HTMLImportLoader* createLoader(); 72 HTMLImportLoader* createLoader();
77 73
78 size_t loaderCount() const { return m_loaders.size(); } 74 size_t loaderCount() const { return m_loaders.size(); }
79 HTMLImportLoader* loaderAt(size_t i) const { return m_loaders[i].get(); } 75 HTMLImportLoader* loaderAt(size_t i) const { return m_loaders[i].get(); }
80 HTMLImportLoader* loaderFor(const Document&) const; 76 HTMLImportLoader* loaderFor(const Document&) const;
81 77
82 private: 78 private:
83 HTMLImportChild* createChild(const KURL&, HTMLImportLoader*, HTMLImport* par ent, HTMLImportChildClient*); 79 HTMLImportChild* createChild(const KURL&, HTMLImportLoader*, HTMLImport* par ent, HTMLImportChildClient*);
84 void clear(); 80 void clear();
85 81
86 Document* m_master;
87
88 OwnPtr<HTMLImportTreeRoot> m_root; 82 OwnPtr<HTMLImportTreeRoot> m_root;
89 83
90 typedef Vector<OwnPtr<HTMLImportLoader> > LoaderList; 84 typedef Vector<OwnPtr<HTMLImportLoader> > LoaderList;
91 LoaderList m_loaders; 85 LoaderList m_loaders;
92 }; 86 };
93 87
94 } // namespace WebCore 88 } // namespace WebCore
95 89
96 #endif // HTMLImportsController_h 90 #endif // HTMLImportsController_h
OLDNEW
« no previous file with comments | « Source/core/html/LinkResource.cpp ('k') | Source/core/html/imports/HTMLImportsController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698