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

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

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 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_context.cc ('k') | media/blink/webencryptedmediaclient_impl.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/script_context_set.h" 5 #include "extensions/renderer/script_context_set.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "content/public/common/url_constants.h" 8 #include "content/public/common/url_constants.h"
9 #include "content/public/renderer/render_frame.h" 9 #include "content/public/renderer/render_frame.h"
10 #include "extensions/common/extension.h" 10 #include "extensions/common/extension.h"
(...skipping 27 matching lines...) Expand all
38 int extension_group, 38 int extension_group,
39 int world_id) { 39 int world_id) {
40 const Extension* extension = 40 const Extension* extension =
41 GetExtensionFromFrameAndWorld(frame, world_id, false); 41 GetExtensionFromFrameAndWorld(frame, world_id, false);
42 const Extension* effective_extension = 42 const Extension* effective_extension =
43 GetExtensionFromFrameAndWorld(frame, world_id, true); 43 GetExtensionFromFrameAndWorld(frame, world_id, true);
44 44
45 GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame); 45 GURL frame_url = ScriptContext::GetDataSourceURLForFrame(frame);
46 Feature::Context context_type = 46 Feature::Context context_type =
47 ClassifyJavaScriptContext(extension, extension_group, frame_url, 47 ClassifyJavaScriptContext(extension, extension_group, frame_url,
48 frame->document().securityOrigin()); 48 frame->document().getSecurityOrigin());
49 Feature::Context effective_context_type = ClassifyJavaScriptContext( 49 Feature::Context effective_context_type = ClassifyJavaScriptContext(
50 effective_extension, extension_group, 50 effective_extension, extension_group,
51 ScriptContext::GetEffectiveDocumentURL(frame, frame_url, true), 51 ScriptContext::GetEffectiveDocumentURL(frame, frame_url, true),
52 frame->document().securityOrigin()); 52 frame->document().getSecurityOrigin());
53 53
54 ScriptContext* context = 54 ScriptContext* context =
55 new ScriptContext(v8_context, frame, extension, context_type, 55 new ScriptContext(v8_context, frame, extension, context_type,
56 effective_extension, effective_context_type); 56 effective_extension, effective_context_type);
57 contexts_.insert(context); // takes ownership 57 contexts_.insert(context); // takes ownership
58 return context; 58 return context;
59 } 59 }
60 60
61 void ScriptContextSet::Remove(ScriptContext* context) { 61 void ScriptContextSet::Remove(ScriptContext* context) {
62 if (contexts_.erase(context)) { 62 if (contexts_.erase(context)) {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return Feature::WEB_PAGE_CONTEXT; 209 return Feature::WEB_PAGE_CONTEXT;
210 } 210 }
211 211
212 void ScriptContextSet::RecordAndRemove(std::set<ScriptContext*>* removed, 212 void ScriptContextSet::RecordAndRemove(std::set<ScriptContext*>* removed,
213 ScriptContext* context) { 213 ScriptContext* context) {
214 removed->insert(context); 214 removed->insert(context);
215 Remove(context); // Note: context deletion is deferred to the message loop. 215 Remove(context); // Note: context deletion is deferred to the message loop.
216 } 216 }
217 217
218 } // namespace extensions 218 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/script_context.cc ('k') | media/blink/webencryptedmediaclient_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698