Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(697)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 2166523003: Add ref count to service workers for extension API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: send increment/decrement request from renderer/ process Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
1375 #if defined(ENABLE_EXTENSIONS) 1375 #if defined(ENABLE_EXTENSIONS)
1376 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd( 1376 ChromeExtensionsRendererClient::GetInstance()->RunScriptsAtDocumentEnd(
1377 render_frame); 1377 render_frame);
1378 // |render_frame| might be dead by now. 1378 // |render_frame| might be dead by now.
1379 #endif 1379 #endif
1380 } 1380 }
1381 1381
1382 void ChromeContentRendererClient:: 1382 void ChromeContentRendererClient::
1383 DidInitializeServiceWorkerContextOnWorkerThread( 1383 DidInitializeServiceWorkerContextOnWorkerThread(
1384 v8::Local<v8::Context> context, 1384 v8::Local<v8::Context> context,
1385 int embedded_worker_id, 1385 int64_t service_worker_version_id,
1386 const GURL& url) { 1386 const GURL& url) {
1387 #if defined(ENABLE_EXTENSIONS) 1387 #if defined(ENABLE_EXTENSIONS)
1388 ChromeExtensionsRendererClient::GetInstance() 1388 ChromeExtensionsRendererClient::GetInstance()
1389 ->extension_dispatcher() 1389 ->extension_dispatcher()
1390 ->DidInitializeServiceWorkerContextOnWorkerThread( 1390 ->DidInitializeServiceWorkerContextOnWorkerThread(
1391 context, embedded_worker_id, url); 1391 context, service_worker_version_id, url);
1392 #endif 1392 #endif
1393 } 1393 }
1394 1394
1395 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( 1395 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread(
1396 v8::Local<v8::Context> context, 1396 v8::Local<v8::Context> context,
1397 int embedded_worker_id, 1397 int64_t service_worker_version_id,
1398 const GURL& url) { 1398 const GURL& url) {
1399 #if defined(ENABLE_EXTENSIONS) 1399 #if defined(ENABLE_EXTENSIONS)
1400 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread( 1400 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(
1401 context, embedded_worker_id, url); 1401 context, service_worker_version_id, url);
1402 #endif 1402 #endif
1403 } 1403 }
1404 1404
1405 // If we're in an extension, there is no need disabling multiple routes as 1405 // If we're in an extension, there is no need disabling multiple routes as
1406 // chrome.system.network.getNetworkInterfaces provides the same 1406 // chrome.system.network.getNetworkInterfaces provides the same
1407 // information. Also, the enforcement of sending and binding UDP is already done 1407 // information. Also, the enforcement of sending and binding UDP is already done
1408 // by chrome extension permission model. 1408 // by chrome extension permission model.
1409 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() { 1409 bool ChromeContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {
1410 #if defined(ENABLE_EXTENSIONS) 1410 #if defined(ENABLE_EXTENSIONS)
1411 return !IsStandaloneExtensionProcess(); 1411 return !IsStandaloneExtensionProcess();
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 1473
1474 url::Replacements<char> r; 1474 url::Replacements<char> r;
1475 r.SetPath(path.c_str(), url::Component(0, path.length())); 1475 r.SetPath(path.c_str(), url::Component(0, path.length()));
1476 1476
1477 if (result == internal::NUM_PLUGIN_ERROR) 1477 if (result == internal::NUM_PLUGIN_ERROR)
1478 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; 1478 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS;
1479 1479
1480 RecordYouTubeRewriteUMA(result); 1480 RecordYouTubeRewriteUMA(result);
1481 return corrected_url.ReplaceComponents(r); 1481 return corrected_url.ReplaceComponents(r);
1482 } 1482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698