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

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

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 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
« no previous file with comments | « extensions/renderer/script_injection.cc ('k') | extensions/renderer/wake_event_page.cc » ('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 #include "extensions/renderer/user_script_injector.h" 5 #include "extensions/renderer/user_script_injector.h"
6 6
7 #include <tuple> 7 #include <tuple>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 using RoutingInfoMap = std::map<RoutingInfoKey, bool>; 45 using RoutingInfoMap = std::map<RoutingInfoKey, bool>;
46 46
47 // A map records whether a given |script_id| from a webview-added user script 47 // A map records whether a given |script_id| from a webview-added user script
48 // is allowed to inject on the render of given |routing_id|. 48 // is allowed to inject on the render of given |routing_id|.
49 // Once a script is added, the decision of whether or not allowed to inject 49 // Once a script is added, the decision of whether or not allowed to inject
50 // won't be changed. 50 // won't be changed.
51 // After removed by the webview, the user scipt will also be removed 51 // After removed by the webview, the user scipt will also be removed
52 // from the render. Therefore, there won't be any query from the same 52 // from the render. Therefore, there won't be any query from the same
53 // |script_id| and |routing_id| pair. 53 // |script_id| and |routing_id| pair.
54 base::LazyInstance<RoutingInfoMap> g_routing_info_map = 54 base::LazyInstance<RoutingInfoMap>::DestructorAtExit g_routing_info_map =
55 LAZY_INSTANCE_INITIALIZER; 55 LAZY_INSTANCE_INITIALIZER;
56 56
57 // Greasemonkey API source that is injected with the scripts. 57 // Greasemonkey API source that is injected with the scripts.
58 struct GreasemonkeyApiJsString { 58 struct GreasemonkeyApiJsString {
59 GreasemonkeyApiJsString(); 59 GreasemonkeyApiJsString();
60 blink::WebScriptSource GetSource() const; 60 blink::WebScriptSource GetSource() const;
61 61
62 private: 62 private:
63 blink::WebString source_; 63 blink::WebString source_;
64 }; 64 };
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 void UserScriptInjector::OnInjectionComplete( 268 void UserScriptInjector::OnInjectionComplete(
269 std::unique_ptr<base::Value> execution_result, 269 std::unique_ptr<base::Value> execution_result,
270 UserScript::RunLocation run_location, 270 UserScript::RunLocation run_location,
271 content::RenderFrame* render_frame) {} 271 content::RenderFrame* render_frame) {}
272 272
273 void UserScriptInjector::OnWillNotInject(InjectFailureReason reason, 273 void UserScriptInjector::OnWillNotInject(InjectFailureReason reason,
274 content::RenderFrame* render_frame) { 274 content::RenderFrame* render_frame) {
275 } 275 }
276 276
277 } // namespace extensions 277 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/script_injection.cc ('k') | extensions/renderer/wake_event_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698