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