| 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 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 #if defined(ENABLE_EXTENSIONS) | 1371 #if defined(ENABLE_EXTENSIONS) |
| 1372 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( | 1372 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( |
| 1373 render_frame); | 1373 render_frame); |
| 1374 // |render_frame| might be dead by now. | 1374 // |render_frame| might be dead by now. |
| 1375 #endif | 1375 #endif |
| 1376 } | 1376 } |
| 1377 | 1377 |
| 1378 void ChromeContentRendererClient:: | 1378 void ChromeContentRendererClient:: |
| 1379 DidInitializeServiceWorkerContextOnWorkerThread( | 1379 DidInitializeServiceWorkerContextOnWorkerThread( |
| 1380 v8::Local<v8::Context> context, | 1380 v8::Local<v8::Context> context, |
| 1381 int embedded_worker_id, | 1381 int64_t service_worker_version_id, |
| 1382 const GURL& url) { | 1382 const GURL& url) { |
| 1383 #if defined(ENABLE_EXTENSIONS) | 1383 #if defined(ENABLE_EXTENSIONS) |
| 1384 ChromeExtensionsRendererClient::GetInstance() | 1384 ChromeExtensionsRendererClient::GetInstance() |
| 1385 ->extension_dispatcher() | 1385 ->extension_dispatcher() |
| 1386 ->DidInitializeServiceWorkerContextOnWorkerThread( | 1386 ->DidInitializeServiceWorkerContextOnWorkerThread( |
| 1387 context, embedded_worker_id, url); | 1387 context, service_worker_version_id, url); |
| 1388 #endif | 1388 #endif |
| 1389 } | 1389 } |
| 1390 | 1390 |
| 1391 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( | 1391 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1392 v8::Local<v8::Context> context, | 1392 v8::Local<v8::Context> context, |
| 1393 int embedded_worker_id, | 1393 int64_t service_worker_version_id, |
| 1394 const GURL& url) { | 1394 const GURL& url) { |
| 1395 #if defined(ENABLE_EXTENSIONS) | 1395 #if defined(ENABLE_EXTENSIONS) |
| 1396 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( | 1396 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1397 context, embedded_worker_id, url); | 1397 context, service_worker_version_id, url); |
| 1398 #endif | 1398 #endif |
| 1399 } | 1399 } |
| 1400 | 1400 |
| 1401 // If we're in an extension, there is no need disabling multiple routes as | 1401 // If we're in an extension, there is no need disabling multiple routes as |
| 1402 // chrome.system.network.getNetworkInterfaces provides the same | 1402 // chrome.system.network.getNetworkInterfaces provides the same |
| 1403 // information. Also, the enforcement of sending and binding UDP is already done | 1403 // information. Also, the enforcement of sending and binding UDP is already done |
| 1404 // by chrome extension permission model. | 1404 // by chrome extension permission model. |
| 1405 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { | 1405 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { |
| 1406 #if defined(ENABLE_EXTENSIONS) | 1406 #if defined(ENABLE_EXTENSIONS) |
| 1407 return !IsStandaloneExtensionProcess(); | 1407 return !IsStandaloneExtensionProcess(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 | 1469 |
| 1470 url::Replacements<char> r; | 1470 url::Replacements<char> r; |
| 1471 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1471 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1472 | 1472 |
| 1473 if (result == internal::NUM_PLUGIN_ERROR) | 1473 if (result == internal::NUM_PLUGIN_ERROR) |
| 1474 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1474 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1475 | 1475 |
| 1476 RecordYouTubeRewriteUMA(result); | 1476 RecordYouTubeRewriteUMA(result); |
| 1477 return corrected_url.ReplaceComponents(r); | 1477 return corrected_url.ReplaceComponents(r); |
| 1478 } | 1478 } |
| OLD | NEW |