| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1380 | 1380 |
| 1381 void ChromeContentRendererClient::RunScriptsAtDocumentEnd( | 1381 void ChromeContentRendererClient::RunScriptsAtDocumentEnd( |
| 1382 content::RenderFrame* render_frame) { | 1382 content::RenderFrame* render_frame) { |
| 1383 #if defined(ENABLE_EXTENSIONS) | 1383 #if defined(ENABLE_EXTENSIONS) |
| 1384 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( | 1384 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( |
| 1385 render_frame); | 1385 render_frame); |
| 1386 // |render_frame| might be dead by now. | 1386 // |render_frame| might be dead by now. |
| 1387 #endif | 1387 #endif |
| 1388 } | 1388 } |
| 1389 | 1389 |
| 1390 void | 1390 void ChromeContentRendererClient:: |
| 1391 ChromeContentRendererClient::DidInitializeServiceWorkerContextOnWorkerThread( | 1391 DidInitializeServiceWorkerContextOnWorkerThread( |
| 1392 v8::Local<v8::Context> context, | 1392 v8::Local<v8::Context> context, |
| 1393 const GURL& url) { | 1393 int embedded_worker_id, |
| 1394 const GURL& url) { |
| 1394 #if defined(ENABLE_EXTENSIONS) | 1395 #if defined(ENABLE_EXTENSIONS) |
| 1395 extensions::Dispatcher::DidInitializeServiceWorkerContextOnWorkerThread( | 1396 ChromeExtensionsRendererClient::GetInstance() |
| 1396 context, url); | 1397 ->extension_dispatcher() |
| 1398 ->DidInitializeServiceWorkerContextOnWorkerThread( |
| 1399 context, embedded_worker_id, url); |
| 1397 #endif | 1400 #endif |
| 1398 } | 1401 } |
| 1399 | 1402 |
| 1400 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( | 1403 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1401 v8::Local<v8::Context> context, | 1404 v8::Local<v8::Context> context, |
| 1405 int embedded_worker_id, |
| 1402 const GURL& url) { | 1406 const GURL& url) { |
| 1403 #if defined(ENABLE_EXTENSIONS) | 1407 #if defined(ENABLE_EXTENSIONS) |
| 1404 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(context, | 1408 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1405 url); | 1409 context, embedded_worker_id, url); |
| 1406 #endif | 1410 #endif |
| 1407 } | 1411 } |
| 1408 | 1412 |
| 1409 // If we're in an extension, there is no need disabling multiple routes as | 1413 // If we're in an extension, there is no need disabling multiple routes as |
| 1410 // chrome.system.network.getNetworkInterfaces provides the same | 1414 // chrome.system.network.getNetworkInterfaces provides the same |
| 1411 // information. Also, the enforcement of sending and binding UDP is already done | 1415 // information. Also, the enforcement of sending and binding UDP is already done |
| 1412 // by chrome extension permission model. | 1416 // by chrome extension permission model. |
| 1413 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { | 1417 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { |
| 1414 #if defined(ENABLE_EXTENSIONS) | 1418 #if defined(ENABLE_EXTENSIONS) |
| 1415 return !IsStandaloneExtensionProcess(); | 1419 return !IsStandaloneExtensionProcess(); |
| 1416 #else | 1420 #else |
| 1417 return true; | 1421 return true; |
| 1418 #endif | 1422 #endif |
| 1419 } | 1423 } |
| 1424 |
| 1425 void ChromeContentRendererClient::InstallV8ExtensionForServiceWorkers() { |
| 1426 #if defined(ENABLE_EXTENSIONS) |
| 1427 extensions::Dispatcher::InstallV8ExtensionForServiceWorkers(); |
| 1428 #endif |
| 1429 } |
| OLD | NEW |