| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 // Execute the main function with its dependencies passed in as arguments. | 504 // Execute the main function with its dependencies passed in as arguments. |
| 505 v8::Local<v8::Value> args[] = { | 505 v8::Local<v8::Value> args[] = { |
| 506 // The extension's background URL. | 506 // The extension's background URL. |
| 507 v8_helpers::ToV8StringUnsafe( | 507 v8_helpers::ToV8StringUnsafe( |
| 508 isolate, BackgroundInfo::GetBackgroundURL(extension).spec()), | 508 isolate, BackgroundInfo::GetBackgroundURL(extension).spec()), |
| 509 // The wake-event-page native function. | 509 // The wake-event-page native function. |
| 510 WakeEventPage::Get()->GetForContext(context), | 510 WakeEventPage::Get()->GetForContext(context), |
| 511 // The logging module. | 511 // The logging module. |
| 512 logging->NewInstance(), | 512 logging->NewInstance(), |
| 513 }; | 513 }; |
| 514 context->CallFunction(main_function, arraysize(args), args); | 514 context->SafeCallFunction(main_function, arraysize(args), args); |
| 515 | 515 |
| 516 const base::TimeDelta elapsed = base::TimeTicks::Now() - start_time; | 516 const base::TimeDelta elapsed = base::TimeTicks::Now() - start_time; |
| 517 UMA_HISTOGRAM_TIMES( | 517 UMA_HISTOGRAM_TIMES( |
| 518 "Extensions.DidInitializeServiceWorkerContextOnWorkerThread", elapsed); | 518 "Extensions.DidInitializeServiceWorkerContextOnWorkerThread", elapsed); |
| 519 } | 519 } |
| 520 | 520 |
| 521 void Dispatcher::WillReleaseScriptContext( | 521 void Dispatcher::WillReleaseScriptContext( |
| 522 blink::WebLocalFrame* frame, | 522 blink::WebLocalFrame* frame, |
| 523 const v8::Local<v8::Context>& v8_context, | 523 const v8::Local<v8::Context>& v8_context, |
| 524 int world_id) { | 524 int world_id) { |
| (...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1649 // The "guestViewDeny" module must always be loaded last. It registers | 1649 // The "guestViewDeny" module must always be loaded last. It registers |
| 1650 // error-providing custom elements for the GuestView types that are not | 1650 // error-providing custom elements for the GuestView types that are not |
| 1651 // available, and thus all of those types must have been checked and loaded | 1651 // available, and thus all of those types must have been checked and loaded |
| 1652 // (or not loaded) beforehand. | 1652 // (or not loaded) beforehand. |
| 1653 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1653 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
| 1654 module_system->Require("guestViewDeny"); | 1654 module_system->Require("guestViewDeny"); |
| 1655 } | 1655 } |
| 1656 } | 1656 } |
| 1657 | 1657 |
| 1658 } // namespace extensions | 1658 } // namespace extensions |
| OLD | NEW |