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

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

Issue 2213603002: Prevent duplicate content script injection defined in manifest.json (reland) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed lgtm nits Created 4 years, 3 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
« no previous file with comments | « extensions/renderer/script_injector.h ('k') | extensions/renderer/user_script_injector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_SCRIPTS_RUN_INFO_H_ 5 #ifndef EXTENSIONS_RENDERER_SCRIPTS_RUN_INFO_H_
6 #define EXTENSIONS_RENDERER_SCRIPTS_RUN_INFO_H_ 6 #define EXTENSIONS_RENDERER_SCRIPTS_RUN_INFO_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 20 matching lines...) Expand all
31 ~ScriptsRunInfo(); 31 ~ScriptsRunInfo();
32 32
33 // The number of CSS scripts injected. 33 // The number of CSS scripts injected.
34 size_t num_css; 34 size_t num_css;
35 // The number of JS scripts injected. 35 // The number of JS scripts injected.
36 size_t num_js; 36 size_t num_js;
37 // The number of blocked JS scripts injected. 37 // The number of blocked JS scripts injected.
38 size_t num_blocking_js; 38 size_t num_blocking_js;
39 // A map of extension ids to executing script paths. 39 // A map of extension ids to executing script paths.
40 ExecutingScriptsMap executing_scripts; 40 ExecutingScriptsMap executing_scripts;
41 // A map of extension ids to injected stylesheet paths.
42 ExecutingScriptsMap injected_stylesheets;
41 // The elapsed time since the ScriptsRunInfo was constructed. 43 // The elapsed time since the ScriptsRunInfo was constructed.
42 base::ElapsedTimer timer; 44 base::ElapsedTimer timer;
43 45
44 // Log information about a given script run. If |send_script_activity| is 46 // Log information about a given script run. If |send_script_activity| is
45 // true, this also informs the browser of the script run. 47 // true, this also informs the browser of the script run.
46 void LogRun(bool send_script_activity); 48 void LogRun(bool send_script_activity);
47 49
48 private: 50 private:
49 // The routinig id to use to notify the browser of any injections. Since the 51 // The routinig id to use to notify the browser of any injections. Since the
50 // frame may be deleted in injection, we don't hold on to a reference to it 52 // frame may be deleted in injection, we don't hold on to a reference to it
51 // directly. 53 // directly.
52 int routing_id_; 54 int routing_id_;
53 55
54 // The run location at which injection is happening. 56 // The run location at which injection is happening.
55 UserScript::RunLocation run_location_; 57 UserScript::RunLocation run_location_;
56 58
57 // The url of the frame, preserved for the same reason as the routing id. 59 // The url of the frame, preserved for the same reason as the routing id.
58 GURL frame_url_; 60 GURL frame_url_;
59 61
60 DISALLOW_COPY_AND_ASSIGN(ScriptsRunInfo); 62 DISALLOW_COPY_AND_ASSIGN(ScriptsRunInfo);
61 }; 63 };
62 64
63 } // namespace extensions 65 } // namespace extensions
64 66
65 #endif // EXTENSIONS_RENDERER_SCRIPTS_RUN_INFO_H_ 67 #endif // EXTENSIONS_RENDERER_SCRIPTS_RUN_INFO_H_
OLDNEW
« no previous file with comments | « extensions/renderer/script_injector.h ('k') | extensions/renderer/user_script_injector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698