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

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 2892403002: Introduce lock screen app context to extension features (Closed)
Patch Set: . Created 3 years, 6 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
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | extensions/renderer/js_extension_bindings_system.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 UMA_HISTOGRAM_TIMES("Extensions.DidCreateScriptContext_BlessedWebPage", 412 UMA_HISTOGRAM_TIMES("Extensions.DidCreateScriptContext_BlessedWebPage",
413 elapsed); 413 elapsed);
414 break; 414 break;
415 case Feature::WEBUI_CONTEXT: 415 case Feature::WEBUI_CONTEXT:
416 UMA_HISTOGRAM_TIMES("Extensions.DidCreateScriptContext_WebUI", elapsed); 416 UMA_HISTOGRAM_TIMES("Extensions.DidCreateScriptContext_WebUI", elapsed);
417 break; 417 break;
418 case Feature::SERVICE_WORKER_CONTEXT: 418 case Feature::SERVICE_WORKER_CONTEXT:
419 // Handled in DidInitializeServiceWorkerContextOnWorkerThread(). 419 // Handled in DidInitializeServiceWorkerContextOnWorkerThread().
420 NOTREACHED(); 420 NOTREACHED();
421 break; 421 break;
422 case Feature::LOCK_SCREEN_EXTENSION_CONTEXT:
423 UMA_HISTOGRAM_TIMES(
424 "Extensions.DidCreateScriptContext_LockScreenExtension", elapsed);
425 break;
422 } 426 }
423 427
424 VLOG(1) << "Num tracked contexts: " << script_context_set_->size(); 428 VLOG(1) << "Num tracked contexts: " << script_context_set_->size();
425 } 429 }
426 430
427 void Dispatcher::DidInitializeServiceWorkerContextOnWorkerThread( 431 void Dispatcher::DidInitializeServiceWorkerContextOnWorkerThread(
428 v8::Local<v8::Context> v8_context, 432 v8::Local<v8::Context> v8_context,
429 int64_t service_worker_version_id, 433 int64_t service_worker_version_id,
430 const GURL& url) { 434 const GURL& url) {
431 const base::TimeTicks start_time = base::TimeTicks::Now(); 435 const base::TimeTicks start_time = base::TimeTicks::Now();
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 content::RenderFrame* background_frame = 1100 content::RenderFrame* background_frame =
1097 ExtensionFrameHelper::GetBackgroundPageFrame(params.extension_id); 1101 ExtensionFrameHelper::GetBackgroundPageFrame(params.extension_id);
1098 if (background_frame) { 1102 if (background_frame) {
1099 background_frame->Send(new ExtensionHostMsg_EventAck( 1103 background_frame->Send(new ExtensionHostMsg_EventAck(
1100 background_frame->GetRoutingID(), params.event_id)); 1104 background_frame->GetRoutingID(), params.event_id));
1101 } 1105 }
1102 } 1106 }
1103 } 1107 }
1104 1108
1105 void Dispatcher::OnSetSessionInfo(version_info::Channel channel, 1109 void Dispatcher::OnSetSessionInfo(version_info::Channel channel,
1106 FeatureSessionType session_type) { 1110 FeatureSessionType session_type,
1111 bool is_lock_screen_context) {
1107 SetCurrentChannel(channel); 1112 SetCurrentChannel(channel);
1108 SetCurrentFeatureSessionType(session_type); 1113 SetCurrentFeatureSessionType(session_type);
1114 script_context_set_->set_is_lock_screen_context(is_lock_screen_context);
1109 1115
1110 if (feature_util::ExtensionServiceWorkersEnabled()) { 1116 if (feature_util::ExtensionServiceWorkersEnabled()) {
1111 // chrome-extension: resources should be allowed to register ServiceWorkers. 1117 // chrome-extension: resources should be allowed to register ServiceWorkers.
1112 blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers( 1118 blink::WebSecurityPolicy::RegisterURLSchemeAsAllowingServiceWorkers(
1113 blink::WebString::FromUTF8(extensions::kExtensionScheme)); 1119 blink::WebString::FromUTF8(extensions::kExtensionScheme));
1114 } 1120 }
1115 } 1121 }
1116 1122
1117 void Dispatcher::OnSetScriptingWhitelist( 1123 void Dispatcher::OnSetScriptingWhitelist(
1118 const ExtensionsClient::ScriptingWhitelist& extension_ids) { 1124 const ExtensionsClient::ScriptingWhitelist& extension_ids) {
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1480 // The "guestViewDeny" module must always be loaded last. It registers 1486 // The "guestViewDeny" module must always be loaded last. It registers
1481 // error-providing custom elements for the GuestView types that are not 1487 // error-providing custom elements for the GuestView types that are not
1482 // available, and thus all of those types must have been checked and loaded 1488 // available, and thus all of those types must have been checked and loaded
1483 // (or not loaded) beforehand. 1489 // (or not loaded) beforehand.
1484 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1490 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1485 module_system->Require("guestViewDeny"); 1491 module_system->Require("guestViewDeny");
1486 } 1492 }
1487 } 1493 }
1488 1494
1489 } // namespace extensions 1495 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/dispatcher.h ('k') | extensions/renderer/js_extension_bindings_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698