| 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 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 #if defined(ENABLE_EXTENSIONS) | 1385 #if defined(ENABLE_EXTENSIONS) |
| 1386 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( | 1386 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( |
| 1387 render_frame); | 1387 render_frame); |
| 1388 // |render_frame| might be dead by now. | 1388 // |render_frame| might be dead by now. |
| 1389 #endif | 1389 #endif |
| 1390 } | 1390 } |
| 1391 | 1391 |
| 1392 void ChromeContentRendererClient:: | 1392 void ChromeContentRendererClient:: |
| 1393 DidInitializeServiceWorkerContextOnWorkerThread( | 1393 DidInitializeServiceWorkerContextOnWorkerThread( |
| 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 ChromeExtensionsRendererClient::GetInstance() | 1398 ChromeExtensionsRendererClient::GetInstance() |
| 1399 ->extension_dispatcher() | 1399 ->extension_dispatcher() |
| 1400 ->DidInitializeServiceWorkerContextOnWorkerThread( | 1400 ->DidInitializeServiceWorkerContextOnWorkerThread( |
| 1401 context, embedded_worker_id, url); | 1401 context, service_worker_version_id, url); |
| 1402 #endif | 1402 #endif |
| 1403 } | 1403 } |
| 1404 | 1404 |
| 1405 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( | 1405 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1406 v8::Local<v8::Context> context, | 1406 v8::Local<v8::Context> context, |
| 1407 int embedded_worker_id, | 1407 int64_t service_worker_version_id, |
| 1408 const GURL& url) { | 1408 const GURL& url) { |
| 1409 #if defined(ENABLE_EXTENSIONS) | 1409 #if defined(ENABLE_EXTENSIONS) |
| 1410 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( | 1410 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1411 context, embedded_worker_id, url); | 1411 context, service_worker_version_id, url); |
| 1412 #endif | 1412 #endif |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 // If we're in an extension, there is no need disabling multiple routes as | 1415 // If we're in an extension, there is no need disabling multiple routes as |
| 1416 // chrome.system.network.getNetworkInterfaces provides the same | 1416 // chrome.system.network.getNetworkInterfaces provides the same |
| 1417 // information. Also, the enforcement of sending and binding UDP is already done | 1417 // information. Also, the enforcement of sending and binding UDP is already done |
| 1418 // by chrome extension permission model. | 1418 // by chrome extension permission model. |
| 1419 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { | 1419 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { |
| 1420 #if defined(ENABLE_EXTENSIONS) | 1420 #if defined(ENABLE_EXTENSIONS) |
| 1421 return !IsStandaloneExtensionProcess(); | 1421 return !IsStandaloneExtensionProcess(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1483 | 1483 |
| 1484 url::Replacements<char> r; | 1484 url::Replacements<char> r; |
| 1485 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1485 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1486 | 1486 |
| 1487 if (result == internal::NUM_PLUGIN_ERROR) | 1487 if (result == internal::NUM_PLUGIN_ERROR) |
| 1488 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1488 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1489 | 1489 |
| 1490 RecordYouTubeRewriteUMA(result); | 1490 RecordYouTubeRewriteUMA(result); |
| 1491 return corrected_url.ReplaceComponents(r); | 1491 return corrected_url.ReplaceComponents(r); |
| 1492 } | 1492 } |
| OLD | NEW |