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

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

Issue 652313002: Enable the mojo-based serial API in the renderer behind a flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojo-js-natives-registration
Patch Set: fix windows build Created 6 years, 1 month 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 resources.push_back( 567 resources.push_back(
568 std::make_pair(mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS)); 568 std::make_pair(mojo::kConnectionModuleName, IDR_MOJO_CONNECTION_JS));
569 resources.push_back( 569 resources.push_back(
570 std::make_pair(mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS)); 570 std::make_pair(mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS));
571 resources.push_back( 571 resources.push_back(
572 std::make_pair(mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS)); 572 std::make_pair(mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS));
573 resources.push_back( 573 resources.push_back(
574 std::make_pair(mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS)); 574 std::make_pair(mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS));
575 resources.push_back( 575 resources.push_back(
576 std::make_pair(mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS)); 576 std::make_pair(mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS));
577 resources.push_back(std::make_pair("async_waiter", IDR_ASYNC_WAITER_JS));
578 resources.push_back(std::make_pair("data_receiver", IDR_DATA_RECEIVER_JS));
579 resources.push_back(std::make_pair("data_sender", IDR_DATA_SENDER_JS));
577 resources.push_back(std::make_pair("keep_alive", IDR_KEEP_ALIVE_JS)); 580 resources.push_back(std::make_pair("keep_alive", IDR_KEEP_ALIVE_JS));
578 resources.push_back(std::make_pair("extensions/common/mojo/keep_alive.mojom", 581 resources.push_back(std::make_pair("extensions/common/mojo/keep_alive.mojom",
579 IDR_KEEP_ALIVE_MOJOM_JS)); 582 IDR_KEEP_ALIVE_MOJOM_JS));
583 resources.push_back(std::make_pair("device/serial/data_stream.mojom",
584 IDR_DATA_STREAM_MOJOM_JS));
585 resources.push_back(
586 std::make_pair("device/serial/data_stream_serialization.mojom",
587 IDR_DATA_STREAM_SERIALIZATION_MOJOM_JS));
580 588
581 // Custom bindings. 589 // Custom bindings.
582 resources.push_back( 590 resources.push_back(
583 std::make_pair("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS)); 591 std::make_pair("app.runtime", IDR_APP_RUNTIME_CUSTOM_BINDINGS_JS));
584 resources.push_back( 592 resources.push_back(
585 std::make_pair("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS)); 593 std::make_pair("app.window", IDR_APP_WINDOW_CUSTOM_BINDINGS_JS));
586 resources.push_back( 594 resources.push_back(
587 std::make_pair("declarativeWebRequest", 595 std::make_pair("declarativeWebRequest",
588 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS)); 596 IDR_DECLARATIVE_WEBREQUEST_CUSTOM_BINDINGS_JS));
589 resources.push_back( 597 resources.push_back(
590 std::make_pair("contextMenus", IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS)); 598 std::make_pair("contextMenus", IDR_CONTEXT_MENUS_CUSTOM_BINDINGS_JS));
591 resources.push_back( 599 resources.push_back(
592 std::make_pair("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS)); 600 std::make_pair("extension", IDR_EXTENSION_CUSTOM_BINDINGS_JS));
593 resources.push_back(std::make_pair("i18n", IDR_I18N_CUSTOM_BINDINGS_JS)); 601 resources.push_back(std::make_pair("i18n", IDR_I18N_CUSTOM_BINDINGS_JS));
594 resources.push_back( 602 resources.push_back(
595 std::make_pair("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS)); 603 std::make_pair("permissions", IDR_PERMISSIONS_CUSTOM_BINDINGS_JS));
596 resources.push_back( 604 resources.push_back(
597 std::make_pair("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS)); 605 std::make_pair("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS));
598 resources.push_back(std::make_pair("windowControls", IDR_WINDOW_CONTROLS_JS)); 606 resources.push_back(std::make_pair("windowControls", IDR_WINDOW_CONTROLS_JS));
599 resources.push_back( 607 resources.push_back(
600 std::make_pair("webViewRequest", 608 std::make_pair("webViewRequest",
601 IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS)); 609 IDR_WEB_VIEW_REQUEST_CUSTOM_BINDINGS_JS));
602 resources.push_back(std::make_pair("binding", IDR_BINDING_JS)); 610 resources.push_back(std::make_pair("binding", IDR_BINDING_JS));
603 611
612 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
613 switches::kEnableMojoSerialService)) {
614 resources.push_back(
615 std::make_pair("serial", IDR_SERIAL_CUSTOM_BINDINGS_JS));
616 }
617 resources.push_back(std::make_pair("serial_service", IDR_SERIAL_SERVICE_JS));
618 resources.push_back(
619 std::make_pair("device/serial/serial.mojom", IDR_SERIAL_MOJOM_JS));
620 resources.push_back(std::make_pair("device/serial/serial_serialization.mojom",
621 IDR_SERIAL_SERIALIZATION_MOJOM_JS));
622
604 // Custom types sources. 623 // Custom types sources.
605 resources.push_back(std::make_pair("StorageArea", IDR_STORAGE_AREA_JS)); 624 resources.push_back(std::make_pair("StorageArea", IDR_STORAGE_AREA_JS));
606 625
607 // Platform app sources that are not API-specific.. 626 // Platform app sources that are not API-specific..
608 resources.push_back(std::make_pair("platformApp", IDR_PLATFORM_APP_JS)); 627 resources.push_back(std::make_pair("platformApp", IDR_PLATFORM_APP_JS));
609 628
610 return resources; 629 return resources;
611 } 630 }
612 631
613 // NOTE: please use the naming convention "foo_natives" for these. 632 // NOTE: please use the naming convention "foo_natives" for these.
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1393 return v8::Handle<v8::Object>(); 1412 return v8::Handle<v8::Object>();
1394 1413
1395 if (bind_name) 1414 if (bind_name)
1396 *bind_name = split.back(); 1415 *bind_name = split.back();
1397 1416
1398 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1417 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1399 : bind_object; 1418 : bind_object;
1400 } 1419 }
1401 1420
1402 } // namespace extensions 1421 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api/serial/serial_api_unittest.cc ('k') | extensions/renderer/module_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698