OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ | 5 #ifndef EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ |
6 #define EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ | 6 #define EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 void OnInjectionComplete(std::unique_ptr<base::Value> execution_result, | 56 void OnInjectionComplete(std::unique_ptr<base::Value> execution_result, |
57 UserScript::RunLocation run_location, | 57 UserScript::RunLocation run_location, |
58 content::RenderFrame* render_frame) override; | 58 content::RenderFrame* render_frame) override; |
59 void OnWillNotInject(InjectFailureReason reason, | 59 void OnWillNotInject(InjectFailureReason reason, |
60 content::RenderFrame* render_frame) override; | 60 content::RenderFrame* render_frame) override; |
61 | 61 |
62 // The associated user script. Owned by the UserScriptInjector that created | 62 // The associated user script. Owned by the UserScriptInjector that created |
63 // this object. | 63 // this object. |
64 const UserScript* script_; | 64 const UserScript* script_; |
65 | 65 |
66 // The UserScriptSet that eventually owns the UserScript this | |
67 // UserScriptInjector points to. | |
68 // Outlives |this|. | |
69 UserScriptSet* const user_script_set_; | |
70 | |
71 // The id of the associated user script. We cache this because when we update | 66 // The id of the associated user script. We cache this because when we update |
72 // the |script_| associated with this injection, the old referance may be | 67 // the |script_| associated with this injection, the old referance may be |
73 // deleted. | 68 // deleted. |
74 int script_id_; | 69 int script_id_; |
75 | 70 |
76 // The associated host id, preserved for the same reason as |script_id|. | 71 // The associated host id, preserved for the same reason as |script_id|. |
77 HostID host_id_; | 72 HostID host_id_; |
78 | 73 |
79 // Indicates whether or not this script is declarative. This influences which | 74 // Indicates whether or not this script is declarative. This influences which |
80 // script permissions are checked before injection. | 75 // script permissions are checked before injection. |
81 bool is_declarative_; | 76 bool is_declarative_; |
82 | 77 |
83 ScopedObserver<UserScriptSet, UserScriptSet::Observer> | 78 ScopedObserver<UserScriptSet, UserScriptSet::Observer> |
84 user_script_set_observer_; | 79 user_script_set_observer_; |
85 | 80 |
86 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector); | 81 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector); |
87 }; | 82 }; |
88 | 83 |
89 } // namespace extensions | 84 } // namespace extensions |
90 | 85 |
91 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ | 86 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ |
OLD | NEW |