| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 } | 297 } |
| 298 | 298 |
| 299 UpdateBindingsForContext(context); | 299 UpdateBindingsForContext(context); |
| 300 | 300 |
| 301 bool is_within_platform_app = IsWithinPlatformApp(); | 301 bool is_within_platform_app = IsWithinPlatformApp(); |
| 302 // Inject custom JS into the platform app context. | 302 // Inject custom JS into the platform app context. |
| 303 if (is_within_platform_app) { | 303 if (is_within_platform_app) { |
| 304 module_system->Require("platformApp"); | 304 module_system->Require("platformApp"); |
| 305 } | 305 } |
| 306 | 306 |
| 307 delegate_->RequireAdditionalModules( | 307 delegate_->RequireAdditionalModules(context, is_within_platform_app); |
| 308 module_system, extension, context_type, is_within_platform_app); | |
| 309 | 308 |
| 310 VLOG(1) << "Num tracked contexts: " << script_context_set_.size(); | 309 VLOG(1) << "Num tracked contexts: " << script_context_set_.size(); |
| 311 } | 310 } |
| 312 | 311 |
| 313 void Dispatcher::WillReleaseScriptContext( | 312 void Dispatcher::WillReleaseScriptContext( |
| 314 WebFrame* frame, | 313 WebFrame* frame, |
| 315 const v8::Handle<v8::Context>& v8_context, | 314 const v8::Handle<v8::Context>& v8_context, |
| 316 int world_id) { | 315 int world_id) { |
| 317 ScriptContext* context = script_context_set_.GetByV8Context(v8_context); | 316 ScriptContext* context = script_context_set_.GetByV8Context(v8_context); |
| 318 if (!context) | 317 if (!context) |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 return v8::Handle<v8::Object>(); | 1285 return v8::Handle<v8::Object>(); |
| 1287 | 1286 |
| 1288 if (bind_name) | 1287 if (bind_name) |
| 1289 *bind_name = split.back(); | 1288 *bind_name = split.back(); |
| 1290 | 1289 |
| 1291 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1290 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
| 1292 : bind_object; | 1291 : bind_object; |
| 1293 } | 1292 } |
| 1294 | 1293 |
| 1295 } // namespace extensions | 1294 } // namespace extensions |
| OLD | NEW |