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

Side by Side Diff: extensions/renderer/user_script_injector.h

Issue 878513005: Extensions: suspend extension's scripts when V8 is paused (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 // 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 <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 bool ShouldInjectCss(UserScript::RunLocation run_location) const override; 45 bool ShouldInjectCss(UserScript::RunLocation run_location) const override;
46 PermissionsData::AccessType CanExecuteOnFrame( 46 PermissionsData::AccessType CanExecuteOnFrame(
47 const InjectionHost* injection_host, 47 const InjectionHost* injection_host,
48 blink::WebFrame* web_frame, 48 blink::WebFrame* web_frame,
49 int tab_id, 49 int tab_id,
50 const GURL& top_url) const override; 50 const GURL& top_url) const override;
51 std::vector<blink::WebScriptSource> GetJsSources( 51 std::vector<blink::WebScriptSource> GetJsSources(
52 UserScript::RunLocation run_location) const override; 52 UserScript::RunLocation run_location) const override;
53 std::vector<std::string> GetCssSources( 53 std::vector<std::string> GetCssSources(
54 UserScript::RunLocation run_location) const override; 54 UserScript::RunLocation run_location) const override;
55 void GetRunInfo(ScriptsRunInfo* scripts_run_info,
56 UserScript::RunLocation run_location) const override;
55 void OnInjectionComplete(scoped_ptr<base::ListValue> execution_results, 57 void OnInjectionComplete(scoped_ptr<base::ListValue> execution_results,
56 ScriptsRunInfo* scripts_run_info,
57 UserScript::RunLocation run_location) override; 58 UserScript::RunLocation run_location) override;
58 void OnWillNotInject(InjectFailureReason reason) override; 59 void OnWillNotInject(InjectFailureReason reason) override;
59 60
60 // The associated user script. Owned by the UserScriptInjector that created 61 // The associated user script. Owned by the UserScriptInjector that created
61 // this object. 62 // this object.
62 const UserScript* script_; 63 const UserScript* script_;
63 64
64 // The id of the associated user script. We cache this because when we update 65 // The id of the associated user script. We cache this because when we update
65 // the |script_| associated with this injection, the old referance may be 66 // the |script_| associated with this injection, the old referance may be
66 // deleted. 67 // deleted.
67 int script_id_; 68 int script_id_;
68 69
69 // The associated extension id, preserved for the same reason as |script_id|. 70 // The associated extension id, preserved for the same reason as |script_id|.
70 std::string extension_id_; 71 std::string extension_id_;
71 72
72 // Indicates whether or not this script is declarative. This influences which 73 // Indicates whether or not this script is declarative. This influences which
73 // script permissions are checked before injection. 74 // script permissions are checked before injection.
74 bool is_declarative_; 75 bool is_declarative_;
75 76
76 ScopedObserver<UserScriptSet, UserScriptSet::Observer> 77 ScopedObserver<UserScriptSet, UserScriptSet::Observer>
77 user_script_set_observer_; 78 user_script_set_observer_;
78 79
79 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector); 80 DISALLOW_COPY_AND_ASSIGN(UserScriptInjector);
80 }; 81 };
81 82
82 } // namespace extensions 83 } // namespace extensions
83 84
84 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_ 85 #endif // EXTENSIONS_RENDERER_USER_SCRIPT_INJECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698