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

Side by Side Diff: extensions/renderer/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: Addressed comments 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_SCRIPT_INJECTOR_H_ 5 #ifndef EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_
6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ 6 #define EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // Returns the javascript sources to inject at the given |run_location|. 69 // Returns the javascript sources to inject at the given |run_location|.
70 // Only called if ShouldInjectJs() is true. 70 // Only called if ShouldInjectJs() is true.
71 virtual std::vector<blink::WebScriptSource> GetJsSources( 71 virtual std::vector<blink::WebScriptSource> GetJsSources(
72 UserScript::RunLocation run_location) const = 0; 72 UserScript::RunLocation run_location) const = 0;
73 73
74 // Returns the css to inject at the given |run_location|. 74 // Returns the css to inject at the given |run_location|.
75 // Only called if ShouldInjectCss() is true. 75 // Only called if ShouldInjectCss() is true.
76 virtual std::vector<std::string> GetCssSources( 76 virtual std::vector<std::string> GetCssSources(
77 UserScript::RunLocation run_location) const = 0; 77 UserScript::RunLocation run_location) const = 0;
78 78
79 // Fill scriptrs run info
80 virtual void GetRunInfo(
Devlin 2015/02/27 18:25:33 I think I slightly prefer having the one OnInjecti
kozy 2015/02/28 15:23:22 If we want to get run info for sync and async (wit
81 ScriptsRunInfo* scripts_run_info,
82 UserScript::RunLocation run_location) const = 0;
83
79 // Notifies the script that injection has completed, with a possibly-populated 84 // Notifies the script that injection has completed, with a possibly-populated
80 // list of results (depending on whether or not ExpectsResults() was true). 85 // list of results (depending on whether or not ExpectsResults() was true).
81 virtual void OnInjectionComplete( 86 virtual void OnInjectionComplete(
82 scoped_ptr<base::ListValue> execution_results, 87 scoped_ptr<base::ListValue> execution_results,
83 ScriptsRunInfo* scripts_run_info,
84 UserScript::RunLocation run_location) = 0; 88 UserScript::RunLocation run_location) = 0;
85 89
86 // Notifies the script that injection will never occur. 90 // Notifies the script that injection will never occur.
87 virtual void OnWillNotInject(InjectFailureReason reason) = 0; 91 virtual void OnWillNotInject(InjectFailureReason reason) = 0;
88 }; 92 };
89 93
90 } // namespace extensions 94 } // namespace extensions
91 95
92 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_ 96 #endif // EXTENSIONS_RENDERER_SCRIPT_INJECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698