| 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 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 #if defined(ENABLE_EXTENSIONS) | 1361 #if defined(ENABLE_EXTENSIONS) |
| 1362 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( | 1362 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( |
| 1363 render_frame); | 1363 render_frame); |
| 1364 // |render_frame| might be dead by now. | 1364 // |render_frame| might be dead by now. |
| 1365 #endif | 1365 #endif |
| 1366 } | 1366 } |
| 1367 | 1367 |
| 1368 void ChromeContentRendererClient:: | 1368 void ChromeContentRendererClient:: |
| 1369 DidInitializeServiceWorkerContextOnWorkerThread( | 1369 DidInitializeServiceWorkerContextOnWorkerThread( |
| 1370 v8::Local<v8::Context> context, | 1370 v8::Local<v8::Context> context, |
| 1371 int embedded_worker_id, | 1371 int64_t service_worker_version_id, |
| 1372 const GURL& url) { | 1372 const GURL& url) { |
| 1373 #if defined(ENABLE_EXTENSIONS) | 1373 #if defined(ENABLE_EXTENSIONS) |
| 1374 ChromeExtensionsRendererClient::GetInstance() | 1374 ChromeExtensionsRendererClient::GetInstance() |
| 1375 ->extension_dispatcher() | 1375 ->extension_dispatcher() |
| 1376 ->DidInitializeServiceWorkerContextOnWorkerThread( | 1376 ->DidInitializeServiceWorkerContextOnWorkerThread( |
| 1377 context, embedded_worker_id, url); | 1377 context, service_worker_version_id, url); |
| 1378 #endif | 1378 #endif |
| 1379 } | 1379 } |
| 1380 | 1380 |
| 1381 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( | 1381 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( |
| 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 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( | 1386 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1387 context, embedded_worker_id, url); | 1387 context, service_worker_version_id, url); |
| 1388 #endif | 1388 #endif |
| 1389 } | 1389 } |
| 1390 | 1390 |
| 1391 // If we're in an extension, there is no need disabling multiple routes as | 1391 // If we're in an extension, there is no need disabling multiple routes as |
| 1392 // chrome.system.network.getNetworkInterfaces provides the same | 1392 // chrome.system.network.getNetworkInterfaces provides the same |
| 1393 // information. Also, the enforcement of sending and binding UDP is already done | 1393 // information. Also, the enforcement of sending and binding UDP is already done |
| 1394 // by chrome extension permission model. | 1394 // by chrome extension permission model. |
| 1395 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { | 1395 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { |
| 1396 #if defined(ENABLE_EXTENSIONS) | 1396 #if defined(ENABLE_EXTENSIONS) |
| 1397 return !IsStandaloneExtensionProcess(); | 1397 return !IsStandaloneExtensionProcess(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1459 | 1459 |
| 1460 url::Replacements<char> r; | 1460 url::Replacements<char> r; |
| 1461 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1461 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1462 | 1462 |
| 1463 if (result == internal::NUM_PLUGIN_ERROR) | 1463 if (result == internal::NUM_PLUGIN_ERROR) |
| 1464 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1464 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1465 | 1465 |
| 1466 RecordYouTubeRewriteUMA(result); | 1466 RecordYouTubeRewriteUMA(result); |
| 1467 return corrected_url.ReplaceComponents(r); | 1467 return corrected_url.ReplaceComponents(r); |
| 1468 } | 1468 } |
| OLD | NEW |