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 |
66 // The id of the associated user script. We cache this because when we update | 71 // The id of the associated user script. We cache this because when we update |
67 // the |script_| associated with this injection, the old referance may be | 72 // the |script_| associated with this injection, the old referance may be |
68 // deleted. | 73 // deleted. |
69 int script_id_; | 74 int script_id_; |
70 | 75 |
71 // The associated host id, preserved for the same reason as |script_id|. | 76 // The associated host id, preserved for the same reason as |script_id|. |
72 HostID host_id_; | 77 HostID host_id_; |
73 | 78 |
74 // Indicates whether or not this script is declarative. This influences which | 79 // Indicates whether or not this script is declarative. This influences which |
75 // script permissions are checked before injection. | 80 // script permissions are checked before injection. |
76 bool is_declarative_; | 81 bool is_declarative_; |
77 | 82 |
78 ScopedObserver<UserScriptSet, UserScriptSet::Observer> | 83 ScopedObserver<UserScriptSet, UserScriptSet::Observer> |
79 user_script_set_observer_; | 84 user_script_set_observer_; |
80 | 85 |
81 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector); | 86 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector); |
82 }; | 87 }; |
83 | 88 |
84 } // namespace extensions | 89 } // namespace extensions |
85 | 90 |
86 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ | 91 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ |
OLD | NEW |