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

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

Issue 2727123002: [Media Router] Custom Controls 1 - Add MediaStatus, MediaRouteController, and mojo interfaces (Closed)
Patch Set: . Created 3 years, 9 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 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 namespace { 133 namespace {
134 134
135 static const int64_t kInitialExtensionIdleHandlerDelayMs = 5 * 1000; 135 static const int64_t kInitialExtensionIdleHandlerDelayMs = 5 * 1000;
136 static const int64_t kMaxExtensionIdleHandlerDelayMs = 5 * 60 * 1000; 136 static const int64_t kMaxExtensionIdleHandlerDelayMs = 5 * 60 * 1000;
137 static const char kOnSuspendEvent[] = "runtime.onSuspend"; 137 static const char kOnSuspendEvent[] = "runtime.onSuspend";
138 static const char kOnSuspendCanceledEvent[] = "runtime.onSuspendCanceled"; 138 static const char kOnSuspendCanceledEvent[] = "runtime.onSuspendCanceled";
139 139
140 void CrashOnException(const v8::TryCatch& trycatch) { 140 void CrashOnException(const v8::TryCatch& trycatch) {
141 NOTREACHED(); 141 NOTREACHED();
142 }; 142 }
143 143
144 // Calls a method |method_name| in a module |module_name| belonging to the 144 // Calls a method |method_name| in a module |module_name| belonging to the
145 // module system from |context|. Intended as a callback target from 145 // module system from |context|. Intended as a callback target from
146 // ScriptContextSet::ForEach. 146 // ScriptContextSet::ForEach.
147 void CallModuleMethod(const std::string& module_name, 147 void CallModuleMethod(const std::string& module_name,
148 const std::string& method_name, 148 const std::string& method_name,
149 const base::ListValue* args, 149 const base::ListValue* args,
150 ScriptContext* context) { 150 ScriptContext* context) {
151 v8::HandleScope handle_scope(context->isolate()); 151 v8::HandleScope handle_scope(context->isolate());
152 v8::Context::Scope context_scope(context->v8_context()); 152 v8::Context::Scope context_scope(context->v8_context());
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 {"webViewRequest", IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS}, 735 {"webViewRequest", IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS},
736 {"binding", IDR_BINDING_JS}, 736 {"binding", IDR_BINDING_JS},
737 737
738 // Custom types sources. 738 // Custom types sources.
739 {"StorageArea", IDR_STORAGE_AREA_JS}, 739 {"StorageArea", IDR_STORAGE_AREA_JS},
740 740
741 // Platform app sources that are not API-specific.. 741 // Platform app sources that are not API-specific..
742 {"platformApp", IDR_PLATFORM_APP_JS}, 742 {"platformApp", IDR_PLATFORM_APP_JS},
743 743
744 #if defined(ENABLE_MEDIA_ROUTER) 744 #if defined(ENABLE_MEDIA_ROUTER)
745 {"chrome/browser/media/router/mojo/media_controller.mojom",
Devlin 2017/03/06 22:51:05 Where are these used? I can't find them being req
takumif 2017/03/08 04:24:03 media_router.mojom includes these two files, so th
Devlin 2017/03/08 19:33:23 Why? These resources are added to the Dispatcher'
746 IDR_MEDIA_CONTROLLER_MOJOM_JS},
745 {"chrome/browser/media/router/mojo/media_router.mojom", 747 {"chrome/browser/media/router/mojo/media_router.mojom",
746 IDR_MEDIA_ROUTER_MOJOM_JS}, 748 IDR_MEDIA_ROUTER_MOJOM_JS},
749 {"chrome/browser/media/router/mojo/media_status.mojom",
750 IDR_MEDIA_STATUS_MOJOM_JS},
747 {"mojo/common/time.mojom", IDR_MOJO_TIME_MOJOM_JS}, 751 {"mojo/common/time.mojom", IDR_MOJO_TIME_MOJOM_JS},
748 {"url/mojo/origin.mojom", IDR_ORIGIN_MOJOM_JS}, 752 {"url/mojo/origin.mojom", IDR_ORIGIN_MOJOM_JS},
749 {"media_router_bindings", IDR_MEDIA_ROUTER_BINDINGS_JS}, 753 {"media_router_bindings", IDR_MEDIA_ROUTER_BINDINGS_JS},
750 #endif // defined(ENABLE_MEDIA_ROUTER) 754 #endif // defined(ENABLE_MEDIA_ROUTER)
751 }; 755 };
752 756
753 if (base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames)) { 757 if (base::FeatureList::IsEnabled(::features::kGuestViewCrossProcessFrames)) {
754 resources.emplace_back("guestViewIframe", IDR_GUEST_VIEW_IFRAME_JS); 758 resources.emplace_back("guestViewIframe", IDR_GUEST_VIEW_IFRAME_JS);
755 resources.emplace_back("guestViewIframeContainer", 759 resources.emplace_back("guestViewIframeContainer",
756 IDR_GUEST_VIEW_IFRAME_CONTAINER_JS); 760 IDR_GUEST_VIEW_IFRAME_CONTAINER_JS);
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 // The "guestViewDeny" module must always be loaded last. It registers 1412 // The "guestViewDeny" module must always be loaded last. It registers
1409 // error-providing custom elements for the GuestView types that are not 1413 // error-providing custom elements for the GuestView types that are not
1410 // available, and thus all of those types must have been checked and loaded 1414 // available, and thus all of those types must have been checked and loaded
1411 // (or not loaded) beforehand. 1415 // (or not loaded) beforehand.
1412 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1416 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1413 module_system->Require("guestViewDeny"); 1417 module_system->Require("guestViewDeny");
1414 } 1418 }
1415 } 1419 }
1416 1420
1417 } // namespace extensions 1421 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698