OLD | NEW |
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/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 1156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 } | 1167 } |
1168 } | 1168 } |
1169 return false; | 1169 return false; |
1170 } | 1170 } |
1171 | 1171 |
1172 Feature::Context Dispatcher::ClassifyJavaScriptContext( | 1172 Feature::Context Dispatcher::ClassifyJavaScriptContext( |
1173 const Extension* extension, | 1173 const Extension* extension, |
1174 int extension_group, | 1174 int extension_group, |
1175 const GURL& url, | 1175 const GURL& url, |
1176 const blink::WebSecurityOrigin& origin) { | 1176 const blink::WebSecurityOrigin& origin) { |
1177 // WARNING: This logic must match ProcessMap::GuessContextType, as much as | 1177 // WARNING: This logic must match ProcessMap::GetContextType, as much as |
1178 // possible. | 1178 // possible. |
1179 | 1179 |
1180 DCHECK_GE(extension_group, 0); | 1180 DCHECK_GE(extension_group, 0); |
1181 if (extension_group == EXTENSION_GROUP_CONTENT_SCRIPTS) { | 1181 if (extension_group == EXTENSION_GROUP_CONTENT_SCRIPTS) { |
1182 return extension ? // TODO(kalman): when does this happen? | 1182 return extension ? // TODO(kalman): when does this happen? |
1183 Feature::CONTENT_SCRIPT_CONTEXT | 1183 Feature::CONTENT_SCRIPT_CONTEXT |
1184 : Feature::UNSPECIFIED_CONTEXT; | 1184 : Feature::UNSPECIFIED_CONTEXT; |
1185 } | 1185 } |
1186 | 1186 |
1187 // We have an explicit check for sandboxed pages before checking whether the | 1187 // We have an explicit check for sandboxed pages before checking whether the |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 return v8::Handle<v8::Object>(); | 1291 return v8::Handle<v8::Object>(); |
1292 | 1292 |
1293 if (bind_name) | 1293 if (bind_name) |
1294 *bind_name = split.back(); | 1294 *bind_name = split.back(); |
1295 | 1295 |
1296 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1296 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
1297 : bind_object; | 1297 : bind_object; |
1298 } | 1298 } |
1299 | 1299 |
1300 } // namespace extensions | 1300 } // namespace extensions |
OLD | NEW |