diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 21:44:36 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-25 21:44:36 +0000 |
commit | 4d166378f46ed1f4a00923250c60674527ac7d77 (patch) | |
tree | b1ac480aacfafce8c105888b9b7d108fc0028d55 | |
parent | dfc0424c076efcddbcf312af589dc61c6bea1466 (diff) | |
download | chromium_src-4d166378f46ed1f4a00923250c60674527ac7d77.zip chromium_src-4d166378f46ed1f4a00923250c60674527ac7d77.tar.gz chromium_src-4d166378f46ed1f4a00923250c60674527ac7d77.tar.bz2 |
Extensions: Move bluetooth APIs to extensions/.
BUG=395240
Review URL: https://codereview.chromium.org/395333003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285687 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/BUILD.gn | 8 | ||||
-rw-r--r-- | chrome/browser/extensions/chrome_extensions_browser_client.cc | 5 | ||||
-rw-r--r-- | chrome/browser/extensions/chrome_extensions_browser_client.h | 1 | ||||
-rw-r--r-- | chrome/chrome_browser_extensions.gypi | 36 | ||||
-rw-r--r-- | chrome/chrome_tests.gypi | 2 | ||||
-rw-r--r-- | chrome/chrome_tests_unit.gypi | 4 | ||||
-rw-r--r-- | chrome/common/extensions/api/api.gyp | 2 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/BUILD.gn (renamed from chrome/browser/extensions/api/cast_channel/BUILD.gn) | 3 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/OWNERS (renamed from chrome/browser/extensions/api/cast_channel/OWNERS) | 0 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_auth_util.h (renamed from chrome/browser/extensions/api/cast_channel/cast_auth_util.h) | 12 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_auth_util_nss.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_auth_util_nss.cc) | 31 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_auth_util_openssl.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_auth_util_openssl.cc) | 8 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_channel.proto (renamed from chrome/browser/extensions/api/cast_channel/cast_channel.proto) | 6 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_channel_api.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_channel_api.cc) | 10 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_channel_api.h (renamed from chrome/browser/extensions/api/cast_channel/cast_channel_api.h) | 14 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_channel_api_unittest.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_channel_api_unittest.cc) | 6 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_channel_apitest.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_channel_apitest.cc) | 10 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_message_util.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_message_util.cc) | 12 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_message_util.h (renamed from chrome/browser/extensions/api/cast_channel/cast_message_util.h) | 12 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_socket.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_socket.cc) | 24 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_socket.h (renamed from chrome/browser/extensions/api/cast_channel/cast_socket.h) | 14 | ||||
-rw-r--r-- | extensions/browser/api/cast_channel/cast_socket_unittest.cc (renamed from chrome/browser/extensions/api/cast_channel/cast_socket_unittest.cc) | 13 | ||||
-rw-r--r-- | extensions/browser/api/hid/DEPS (renamed from chrome/browser/extensions/api/hid/DEPS) | 0 | ||||
-rw-r--r-- | extensions/browser/api/hid/OWNERS (renamed from chrome/browser/extensions/api/hid/OWNERS) | 0 | ||||
-rw-r--r-- | extensions/browser/api/hid/hid_api.cc (renamed from chrome/browser/extensions/api/hid/hid_api.cc) | 6 | ||||
-rw-r--r-- | extensions/browser/api/hid/hid_api.h (renamed from chrome/browser/extensions/api/hid/hid_api.h) | 26 | ||||
-rw-r--r-- | extensions/browser/api/hid/hid_connection_resource.cc (renamed from chrome/browser/extensions/api/hid/hid_connection_resource.cc) | 2 | ||||
-rw-r--r-- | extensions/browser/api/hid/hid_connection_resource.h (renamed from chrome/browser/extensions/api/hid/hid_connection_resource.h) | 6 | ||||
-rw-r--r-- | extensions/browser/api/hid/hid_device_manager.cc (renamed from chrome/browser/extensions/api/hid/hid_device_manager.cc) | 8 | ||||
-rw-r--r-- | extensions/browser/api/hid/hid_device_manager.h (renamed from chrome/browser/extensions/api/hid/hid_device_manager.h) | 9 | ||||
-rw-r--r-- | extensions/browser/extensions_browser_client.h | 4 | ||||
-rw-r--r-- | extensions/browser/test_extensions_browser_client.cc | 4 | ||||
-rw-r--r-- | extensions/browser/test_extensions_browser_client.h | 1 | ||||
-rw-r--r-- | extensions/common/api/BUILD.gn | 2 | ||||
-rw-r--r-- | extensions/common/api/api.gyp | 2 | ||||
-rw-r--r-- | extensions/common/api/cast_channel.idl (renamed from chrome/common/extensions/api/cast_channel.idl) | 2 | ||||
-rw-r--r-- | extensions/common/api/hid.idl (renamed from chrome/common/extensions/api/hid.idl) | 0 | ||||
-rw-r--r-- | extensions/extensions.gyp | 47 | ||||
-rw-r--r-- | extensions/shell/app_shell.gyp | 1 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extensions_browser_client.cc | 4 | ||||
-rw-r--r-- | extensions/shell/browser/shell_extensions_browser_client.h | 1 |
41 files changed, 188 insertions, 170 deletions
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn index 4685591..a8a0cab 100644 --- a/chrome/browser/extensions/BUILD.gn +++ b/chrome/browser/extensions/BUILD.gn @@ -33,7 +33,6 @@ static_library("extensions") { "//chrome:resources", "//chrome:strings", "//chrome/app/resources:platform_locale_settings", - "//chrome/browser/extensions/api/cast_channel:cast_channel_proto", "//chrome/app/theme:theme_resources", "//chrome/browser/history:in_memory_url_index_cache_proto", "//chrome/browser/sync_file_system:sync_file_system_proto", @@ -202,13 +201,6 @@ static_library("extensions") { sources += [ "api/system_display/display_info_provider_aura.cc" ] } - if (use_openssl) { - sources += [ "api/cast_channel/cast_auth_util_openssl.cc" ] - } else { - # cast_auth_util_nss.cc uses NSS functions. - sources += [ "api/cast_channel/cast_auth_util_nss.cc" ] - } - if (is_android) { sources += rebase_path( gypi_values.chrome_browser_extensions_android_sources, diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.cc b/chrome/browser/extensions/chrome_extensions_browser_client.cc index db2ae3b..9c692ae 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.cc +++ b/chrome/browser/extensions/chrome_extensions_browser_client.cc @@ -19,6 +19,7 @@ #include "chrome/browser/extensions/extension_util.h" #include "chrome/browser/extensions/url_request_util.h" #include "chrome/browser/external_protocol/external_protocol_handler.h" +#include "chrome/browser/net/chrome_net_log.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile_manager.h" #include "chrome/common/chrome_paths.h" @@ -263,6 +264,10 @@ ChromeExtensionsBrowserClient::GetComponentExtensionResourceManager() { return resource_manager_.get(); } +net::NetLog* ChromeExtensionsBrowserClient::GetNetLog() { + return g_browser_process->net_log(); +} + scoped_ptr<extensions::RuntimeAPIDelegate> ChromeExtensionsBrowserClient::CreateRuntimeAPIDelegate( content::BrowserContext* context) const { diff --git a/chrome/browser/extensions/chrome_extensions_browser_client.h b/chrome/browser/extensions/chrome_extensions_browser_client.h index 5957838..6e5bbeb 100644 --- a/chrome/browser/extensions/chrome_extensions_browser_client.h +++ b/chrome/browser/extensions/chrome_extensions_browser_client.h @@ -92,6 +92,7 @@ class ChromeExtensionsBrowserClient : public ExtensionsBrowserClient { content::BrowserContext* context) const OVERRIDE; virtual ComponentExtensionResourceManager* GetComponentExtensionResourceManager() OVERRIDE; + virtual net::NetLog* GetNetLog() OVERRIDE; private: friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsBrowserClient>; diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi index 333acd4..ee0c223 100644 --- a/chrome/chrome_browser_extensions.gypi +++ b/chrome/chrome_browser_extensions.gypi @@ -450,13 +450,6 @@ 'browser/extensions/api/browsing_data/browsing_data_api.h', 'browser/extensions/api/capture_web_contents_function.cc', 'browser/extensions/api/capture_web_contents_function.h', - 'browser/extensions/api/cast_channel/cast_auth_util.h', - 'browser/extensions/api/cast_channel/cast_channel_api.cc', - 'browser/extensions/api/cast_channel/cast_channel_api.h', - 'browser/extensions/api/cast_channel/cast_message_util.cc', - 'browser/extensions/api/cast_channel/cast_message_util.h', - 'browser/extensions/api/cast_channel/cast_socket.cc', - 'browser/extensions/api/cast_channel/cast_socket.h', 'browser/extensions/api/chrome_extensions_api_client.cc', 'browser/extensions/api/chrome_extensions_api_client.h', 'browser/extensions/api/cloud_print_private/cloud_print_private_api.cc', @@ -570,12 +563,6 @@ 'browser/extensions/api/gcm/gcm_api.h', 'browser/extensions/api/guest_view/guest_view_internal_api.cc', 'browser/extensions/api/guest_view/guest_view_internal_api.h', - 'browser/extensions/api/hid/hid_api.cc', - 'browser/extensions/api/hid/hid_api.h', - 'browser/extensions/api/hid/hid_connection_resource.cc', - 'browser/extensions/api/hid/hid_connection_resource.h', - 'browser/extensions/api/hid/hid_device_manager.cc', - 'browser/extensions/api/hid/hid_device_manager.h', 'browser/extensions/api/history/history_api.cc', 'browser/extensions/api/history/history_api.h', 'browser/extensions/api/hotword_private/hotword_private_api.cc', @@ -960,7 +947,6 @@ # have the same dependencies. Once browser_extensions is untangled from # browser, then we can clean up these dependencies. 'dependencies': [ - 'cast_channel_proto', 'chrome_resources.gyp:chrome_extra_resources', 'chrome_resources.gyp:chrome_resources', 'chrome_resources.gyp:chrome_strings', @@ -1180,16 +1166,6 @@ 'browser/extensions/api/system_display/display_info_provider_aura.cc', ], }], - ['use_openssl==1', { - 'sources': [ - 'browser/extensions/api/cast_channel/cast_auth_util_openssl.cc', - ], - }, { - 'sources': [ - # cast_auth_util_nss.cc uses NSS functions. - 'browser/extensions/api/cast_channel/cast_auth_util_nss.cc', - ], - }], ['OS=="android"', { 'sources': [ '<@(chrome_browser_extensions_android_sources)', @@ -1202,17 +1178,5 @@ }] ], }, - { - # Protobuf compiler / generator for chrome.cast.channel-related protocol buffers. - # GN version: //chrome/browser/extensions/api/cast_channel:cast_channel_proto - 'target_name': 'cast_channel_proto', - 'type': 'static_library', - 'sources': [ 'browser/extensions/api/cast_channel/cast_channel.proto' ], - 'variables': { - 'proto_in_dir': 'browser/extensions/api/cast_channel', - 'proto_out_dir': 'chrome/browser/extensions/api/cast_channel', - }, - 'includes': [ '../build/protoc.gypi' ] - }, ], } diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi index a3b69a3..a5ddd61 100644 --- a/chrome/chrome_tests.gypi +++ b/chrome/chrome_tests.gypi @@ -841,6 +841,7 @@ '../apps/app_shim/test/app_shim_host_manager_test_api_mac.cc', '../apps/app_shim/test/app_shim_host_manager_test_api_mac.h', '../apps/load_and_launch_browsertest.cc', + '../extensions/browser/api/cast_channel/cast_channel_apitest.cc', '../extensions/browser/api/serial/serial_apitest.cc', '../extensions/browser/api/usb/usb_apitest.cc', '../extensions/browser/api/usb/usb_manual_apitest.cc', @@ -1060,7 +1061,6 @@ 'browser/extensions/api/browser/browser_apitest.cc', 'browser/extensions/api/bookmarks/bookmark_apitest.cc', 'browser/extensions/api/browsing_data/browsing_data_test.cc', - 'browser/extensions/api/cast_channel/cast_channel_apitest.cc', 'browser/extensions/api/cast_streaming/cast_streaming_apitest.cc', 'browser/extensions/api/cloud_print_private/cloud_print_private_apitest.cc', 'browser/extensions/api/command_line_private/command_line_private_apitest.cc', diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi index a0fc3bd..513012c 100644 --- a/chrome/chrome_tests_unit.gypi +++ b/chrome/chrome_tests_unit.gypi @@ -540,6 +540,8 @@ # they should be kept here. '../extensions/browser/admin_policy_unittest.cc', '../extensions/browser/api/api_resource_manager_unittest.cc', + '../extensions/browser/api/cast_channel/cast_channel_api_unittest.cc', + '../extensions/browser/api/cast_channel/cast_socket_unittest.cc', '../extensions/browser/api/power/power_api_unittest.cc', '../extensions/browser/api/storage/settings_quota_unittest.cc', '../extensions/browser/api/storage/settings_test_util.cc', @@ -885,8 +887,6 @@ 'browser/extensions/api/alarms/alarms_api_unittest.cc', 'browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc', 'browser/extensions/api/bookmarks/bookmark_api_helpers_unittest.cc', - 'browser/extensions/api/cast_channel/cast_channel_api_unittest.cc', - 'browser/extensions/api/cast_channel/cast_socket_unittest.cc', 'browser/extensions/api/content_settings/content_settings_store_unittest.cc', 'browser/extensions/api/content_settings/content_settings_unittest.cc', 'browser/extensions/api/cookies/cookies_unittest.cc', diff --git a/chrome/common/extensions/api/api.gyp b/chrome/common/extensions/api/api.gyp index ff40236..f453674 100644 --- a/chrome/common/extensions/api/api.gyp +++ b/chrome/common/extensions/api/api.gyp @@ -37,7 +37,6 @@ 'bookmarks.json', 'braille_display_private.idl', 'browser.idl', - 'cast_channel.idl', 'cloud_print_private.json', 'command_line_private.json', 'content_settings.json', @@ -65,7 +64,6 @@ 'gcm.json', 'guest_view_internal.json', 'hangouts_private.idl', - 'hid.idl', 'history.json', 'hotword_private.idl', 'i18n.json', diff --git a/chrome/browser/extensions/api/cast_channel/BUILD.gn b/extensions/browser/api/cast_channel/BUILD.gn index 0c18ede..e5a46da 100644 --- a/chrome/browser/extensions/api/cast_channel/BUILD.gn +++ b/extensions/browser/api/cast_channel/BUILD.gn @@ -4,8 +4,7 @@ import("//third_party/protobuf/proto_library.gni") -# GYP version: chrome/chrome_browser_extensions.gypi:cast_channel_proto +# GYP version: extensions/extensions.gyp:cast_channel_proto proto_library("cast_channel_proto") { sources = [ "cast_channel.proto" ] } - diff --git a/chrome/browser/extensions/api/cast_channel/OWNERS b/extensions/browser/api/cast_channel/OWNERS index 5de6137..5de6137 100644 --- a/chrome/browser/extensions/api/cast_channel/OWNERS +++ b/extensions/browser/api/cast_channel/OWNERS diff --git a/chrome/browser/extensions/api/cast_channel/cast_auth_util.h b/extensions/browser/api/cast_channel/cast_auth_util.h index c3d5da6..9fac2f4 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_auth_util.h +++ b/extensions/browser/api/cast_channel/cast_auth_util.h @@ -1,14 +1,14 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ -#define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ +#ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ +#define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ #include <string> namespace extensions { -namespace api { +namespace core_api { namespace cast_channel { class CastMessage; @@ -20,7 +20,7 @@ bool AuthenticateChallengeReply(const CastMessage& challenge_reply, const std::string& peer_cert); } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions -#endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ +#endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_AUTH_UTIL_H_ diff --git a/chrome/browser/extensions/api/cast_channel/cast_auth_util_nss.cc b/extensions/browser/api/cast_channel/cast_auth_util_nss.cc index c3875e4..9937286 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_auth_util_nss.cc +++ b/extensions/browser/api/cast_channel/cast_auth_util_nss.cc @@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/cast_channel/cast_auth_util.h" +#include "extensions/browser/api/cast_channel/cast_auth_util.h" #include <cert.h> #include <cryptohi.h> @@ -11,13 +11,17 @@ #include <string> #include "base/logging.h" -#include "chrome/browser/extensions/api/cast_channel/cast_channel.pb.h" -#include "chrome/browser/extensions/api/cast_channel/cast_message_util.h" #include "crypto/nss_util.h" #include "crypto/scoped_nss_types.h" +#include "extensions/browser/api/cast_channel/cast_channel.pb.h" +#include "extensions/browser/api/cast_channel/cast_message_util.h" #include "net/base/hash_value.h" #include "net/cert/x509_certificate.h" +namespace extensions { +namespace core_api { +namespace cast_channel { + namespace { // Fingerprints and public keys of the allowed / trusted ICAs. @@ -183,11 +187,9 @@ static int GetICAWithFingerprint(const net::SHA1HashValue& fingerprint) { } // Parses out DeviceAuthMessage from CastMessage -static bool ParseAuthMessage( - const extensions::api::cast_channel::CastMessage& challenge_reply, - extensions::api::cast_channel::DeviceAuthMessage* auth_message) { - if (challenge_reply.payload_type() != - extensions::api::cast_channel::CastMessage_PayloadType_BINARY) { +static bool ParseAuthMessage(const CastMessage& challenge_reply, + DeviceAuthMessage* auth_message) { + if (challenge_reply.payload_type() != CastMessage_PayloadType_BINARY) { VLOG(1) << "Wrong payload type in challenge reply"; return false; } @@ -214,9 +216,8 @@ static bool ParseAuthMessage( // Authenticates the given credentials: // 1. |signature| verification of |data| using |certificate|. // 2. |certificate| is signed by a trusted CA. -bool VerifyCredentials( - const extensions::api::cast_channel::AuthResponse& response, - const std::string& data) { +bool VerifyCredentials(const AuthResponse& response, + const std::string& data) { const std::string& certificate = response.client_auth_certificate(); const std::string& signature = response.signature(); @@ -302,10 +303,6 @@ bool VerifyCredentials( } // namespace -namespace extensions { -namespace api { -namespace cast_channel { - bool AuthenticateChallengeReply(const CastMessage& challenge_reply, const std::string& peer_cert) { if (peer_cert.empty()) @@ -321,5 +318,5 @@ bool AuthenticateChallengeReply(const CastMessage& challenge_reply, } } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions diff --git a/chrome/browser/extensions/api/cast_channel/cast_auth_util_openssl.cc b/extensions/browser/api/cast_channel/cast_auth_util_openssl.cc index 18bc330..04795ca 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_auth_util_openssl.cc +++ b/extensions/browser/api/cast_channel/cast_auth_util_openssl.cc @@ -1,13 +1,13 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/cast_channel/cast_auth_util.h" +#include "extensions/browser/api/cast_channel/cast_auth_util.h" #include "base/logging.h" namespace extensions { -namespace api { +namespace core_api { namespace cast_channel { bool AuthenticateChallengeReply(const CastMessage& challenge_reply, @@ -17,5 +17,5 @@ bool AuthenticateChallengeReply(const CastMessage& challenge_reply, } } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions diff --git a/chrome/browser/extensions/api/cast_channel/cast_channel.proto b/extensions/browser/api/cast_channel/cast_channel.proto index fd22654..c7b9d9e 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_channel.proto +++ b/extensions/browser/api/cast_channel/cast_channel.proto @@ -1,4 +1,4 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,7 +6,7 @@ syntax = "proto2"; option optimize_for = LITE_RUNTIME; -package extensions.api.cast_channel; +package extensions.core_api.cast_channel; message CastMessage { // Always pass a version of the protocol for future compatibility @@ -27,7 +27,7 @@ message CastMessage { // // For messages to or from the sender or receiver platform, the special ids // 'sender-0' and 'receiver-0' can be used. - // + // // For messages intended for all endpoints using a given channel, the // wildcard destination_id '*' can be used. required string source_id = 2; diff --git a/chrome/browser/extensions/api/cast_channel/cast_channel_api.cc b/extensions/browser/api/cast_channel/cast_channel_api.cc index 1c3a311..8878a0c5 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_channel_api.cc +++ b/extensions/browser/api/cast_channel/cast_channel_api.cc @@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/cast_channel/cast_channel_api.h" +#include "extensions/browser/api/cast_channel/cast_channel_api.h" #include <limits> #include <string> @@ -11,10 +11,8 @@ #include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/extensions/api/cast_channel/cast_socket.h" -#include "chrome/browser/net/chrome_net_log.h" #include "content/public/browser/browser_thread.h" +#include "extensions/browser/api/cast_channel/cast_socket.h" #include "extensions/browser/event_router.h" #include "net/base/ip_endpoint.h" #include "net/base/net_errors.h" @@ -109,7 +107,7 @@ scoped_ptr<CastSocket> CastChannelAPI::CreateCastSocket( } else { return scoped_ptr<CastSocket>( new CastSocket(extension_id, ip_endpoint, channel_auth, this, - g_browser_process->net_log(), + ExtensionsBrowserClient::Get()->GetNetLog(), timeout)); } } diff --git a/chrome/browser/extensions/api/cast_channel/cast_channel_api.h b/extensions/browser/api/cast_channel/cast_channel_api.h index 73ca4a0..99bbb02 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_channel_api.h +++ b/extensions/browser/api/cast_channel/cast_channel_api.h @@ -1,20 +1,20 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ -#define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ +#ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ +#define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ #include <string> #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" -#include "chrome/browser/extensions/api/cast_channel/cast_socket.h" -#include "chrome/common/extensions/api/cast_channel.h" #include "extensions/browser/api/api_resource_manager.h" #include "extensions/browser/api/async_api_function.h" +#include "extensions/browser/api/cast_channel/cast_socket.h" #include "extensions/browser/browser_context_keyed_api_factory.h" +#include "extensions/common/api/cast_channel.h" class GURL; class CastChannelAPITest; @@ -29,7 +29,7 @@ class IPEndPoint; namespace extensions { -namespace cast_channel = api::cast_channel; +namespace cast_channel = core_api::cast_channel; class CastChannelAPI : public BrowserContextKeyedAPI, public cast_channel::CastSocket::Delegate { @@ -205,4 +205,4 @@ class CastChannelCloseFunction : public CastChannelAsyncApiFunction { } // namespace extensions -#endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ +#endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_CHANNEL_API_H_ diff --git a/chrome/browser/extensions/api/cast_channel/cast_channel_api_unittest.cc b/extensions/browser/api/cast_channel/cast_channel_api_unittest.cc index e736f16..bad9e30 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_channel_api_unittest.cc +++ b/extensions/browser/api/cast_channel/cast_channel_api_unittest.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/cast_channel/cast_channel_api.h" +#include "extensions/browser/api/cast_channel/cast_channel_api.h" #include "base/memory/scoped_ptr.h" #include "net/base/ip_endpoint.h" @@ -10,7 +10,7 @@ #include "url/gurl.h" namespace extensions { -namespace api { +namespace core_api { namespace cast_channel { // Tests URL parsing and validation. @@ -63,5 +63,5 @@ TEST(CastChannelOpenFunctionTest, TestParseConnectInfo) { } } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions diff --git a/chrome/browser/extensions/api/cast_channel/cast_channel_apitest.cc b/extensions/browser/api/cast_channel/cast_channel_apitest.cc index 6c0162e..14f1fbd 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_channel_apitest.cc +++ b/extensions/browser/api/cast_channel/cast_channel_apitest.cc @@ -1,18 +1,18 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "base/bind.h" #include "base/command_line.h" #include "base/files/file_path.h" -#include "chrome/browser/extensions/api/cast_channel/cast_channel_api.h" -#include "chrome/browser/extensions/api/cast_channel/cast_socket.h" #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_function_test_utils.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/ui/browser.h" -#include "chrome/common/extensions/api/cast_channel.h" #include "content/public/browser/browser_thread.h" +#include "extensions/browser/api/cast_channel/cast_channel_api.h" +#include "extensions/browser/api/cast_channel/cast_socket.h" +#include "extensions/common/api/cast_channel.h" #include "extensions/common/switches.h" #include "net/base/capturing_net_log.h" #include "net/base/completion_callback.h" @@ -20,7 +20,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock_mutant.h" -namespace cast_channel = extensions::api::cast_channel; +namespace cast_channel = extensions::core_api::cast_channel; using cast_channel::CastSocket; using cast_channel::ChannelError; using cast_channel::MessageInfo; diff --git a/chrome/browser/extensions/api/cast_channel/cast_message_util.cc b/extensions/browser/api/cast_channel/cast_message_util.cc index b614c63..3cc5ebb 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_message_util.cc +++ b/extensions/browser/api/cast_channel/cast_message_util.cc @@ -1,15 +1,15 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/cast_channel/cast_message_util.h" +#include "extensions/browser/api/cast_channel/cast_message_util.h" #include "base/logging.h" #include "base/memory/scoped_ptr.h" #include "base/strings/string_number_conversions.h" #include "base/values.h" -#include "chrome/browser/extensions/api/cast_channel/cast_channel.pb.h" -#include "chrome/common/extensions/api/cast_channel.h" +#include "extensions/browser/api/cast_channel/cast_channel.pb.h" +#include "extensions/common/api/cast_channel.h" namespace { static const char kAuthNamespace[] = @@ -20,7 +20,7 @@ static const char kPlatformReceiverId[] = "receiver-0"; } // namespace namespace extensions { -namespace api { +namespace core_api { namespace cast_channel { bool MessageInfoToCastMessage(const MessageInfo& message, @@ -146,5 +146,5 @@ bool IsAuthMessage(const CastMessage& message) { } } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions diff --git a/chrome/browser/extensions/api/cast_channel/cast_message_util.h b/extensions/browser/api/cast_channel/cast_message_util.h index e270d82..9080639 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_message_util.h +++ b/extensions/browser/api/cast_channel/cast_message_util.h @@ -1,14 +1,14 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ -#define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ +#ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ +#define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ #include <string> namespace extensions { -namespace api { +namespace core_api { namespace cast_channel { class CastMessage; @@ -36,7 +36,7 @@ void CreateAuthChallengeMessage(CastMessage* message_proto); bool IsAuthMessage(const CastMessage& message); } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions -#endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ +#endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_MESSAGE_UTIL_H_ diff --git a/chrome/browser/extensions/api/cast_channel/cast_socket.cc b/extensions/browser/api/cast_channel/cast_socket.cc index db128d9..bd713ac 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_socket.cc +++ b/extensions/browser/api/cast_channel/cast_socket.cc @@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/cast_channel/cast_socket.h" +#include "extensions/browser/api/cast_channel/cast_socket.h" #include <stdlib.h> #include <string.h> @@ -13,9 +13,9 @@ #include "base/numerics/safe_conversions.h" #include "base/strings/string_number_conversions.h" #include "base/sys_byteorder.h" -#include "chrome/browser/extensions/api/cast_channel/cast_auth_util.h" -#include "chrome/browser/extensions/api/cast_channel/cast_channel.pb.h" -#include "chrome/browser/extensions/api/cast_channel/cast_message_util.h" +#include "extensions/browser/api/cast_channel/cast_auth_util.h" +#include "extensions/browser/api/cast_channel/cast_channel.pb.h" +#include "extensions/browser/api/cast_channel/cast_message_util.h" #include "net/base/address_list.h" #include "net/base/host_port_pair.h" #include "net/base/net_errors.h" @@ -49,18 +49,18 @@ const int kTcpKeepAliveDelaySecs = 10; namespace extensions { static base::LazyInstance<BrowserContextKeyedAPIFactory< - ApiResourceManager<api::cast_channel::CastSocket> > > g_factory = + ApiResourceManager<core_api::cast_channel::CastSocket> > > g_factory = LAZY_INSTANCE_INITIALIZER; // static template <> BrowserContextKeyedAPIFactory< - ApiResourceManager<api::cast_channel::CastSocket> >* -ApiResourceManager<api::cast_channel::CastSocket>::GetFactoryInstance() { + ApiResourceManager<core_api::cast_channel::CastSocket> >* +ApiResourceManager<core_api::cast_channel::CastSocket>::GetFactoryInstance() { return g_factory.Pointer(); } -namespace api { +namespace core_api { namespace cast_channel { CastSocket::CastSocket(const std::string& owner_extension_id, @@ -739,8 +739,8 @@ base::Timer* CastSocket::GetTimer() { CastSocket::MessageHeader::MessageHeader() : message_size(0) { } void CastSocket::MessageHeader::SetMessageSize(size_t size) { - DCHECK(size < static_cast<size_t>(kuint32max)); - DCHECK(size > 0); + DCHECK_LT(size, static_cast<size_t>(kuint32max)); + DCHECK_GT(size, 0U); message_size = static_cast<size_t>(size); } @@ -788,7 +788,7 @@ bool CastSocket::WriteRequest::SetContent(const CastMessage& message_proto) { CastSocket::WriteRequest::~WriteRequest() { } } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions #undef VLOG_WITH_CONNECTION diff --git a/chrome/browser/extensions/api/cast_channel/cast_socket.h b/extensions/browser/api/cast_channel/cast_socket.h index 6770955..7bcd513 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_socket.h +++ b/extensions/browser/api/cast_channel/cast_socket.h @@ -1,9 +1,9 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_ -#define CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_ +#ifndef EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ +#define EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ #include <queue> #include <string> @@ -16,9 +16,9 @@ #include "base/memory/weak_ptr.h" #include "base/threading/thread_checker.h" #include "base/timer/timer.h" -#include "chrome/common/extensions/api/cast_channel.h" #include "extensions/browser/api/api_resource.h" #include "extensions/browser/api/api_resource_manager.h" +#include "extensions/common/api/cast_channel.h" #include "net/base/completion_callback.h" #include "net/base/io_buffer.h" #include "net/base/ip_endpoint.h" @@ -34,7 +34,7 @@ class TransportSecurityState; } namespace extensions { -namespace api { +namespace core_api { namespace cast_channel { class CastMessage; @@ -368,7 +368,7 @@ class CastSocket : public ApiResource, }; } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions -#endif // CHROME_BROWSER_EXTENSIONS_API_CAST_CHANNEL_CAST_SOCKET_H_ +#endif // EXTENSIONS_BROWSER_API_CAST_CHANNEL_CAST_SOCKET_H_ diff --git a/chrome/browser/extensions/api/cast_channel/cast_socket_unittest.cc b/extensions/browser/api/cast_channel/cast_socket_unittest.cc index 7a88002..6abaf35 100644 --- a/chrome/browser/extensions/api/cast_channel/cast_socket_unittest.cc +++ b/extensions/browser/api/cast_channel/cast_socket_unittest.cc @@ -1,8 +1,8 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/cast_channel/cast_socket.h" +#include "extensions/browser/api/cast_channel/cast_socket.h" #include "base/memory/weak_ptr.h" #include "base/message_loop/message_loop.h" @@ -10,8 +10,8 @@ #include "base/strings/string_number_conversions.h" #include "base/sys_byteorder.h" #include "base/timer/mock_timer.h" -#include "chrome/browser/extensions/api/cast_channel/cast_channel.pb.h" -#include "chrome/browser/extensions/api/cast_channel/cast_message_util.h" +#include "extensions/browser/api/cast_channel/cast_channel.pb.h" +#include "extensions/browser/api/cast_channel/cast_message_util.h" #include "net/base/address_list.h" #include "net/base/capturing_net_log.h" #include "net/base/net_errors.h" @@ -41,7 +41,7 @@ const char* kTestData[4] = { } // namespace namespace extensions { -namespace api { +namespace core_api { namespace cast_channel { // Fills in |message| with a string message. @@ -837,7 +837,6 @@ TEST_F(CastSocketTest, TestWriteErrorLargeMessage) { EXPECT_EQ(cast_channel::READY_STATE_OPEN, socket_->ready_state()); EXPECT_EQ(cast_channel::CHANNEL_ERROR_NONE, socket_->error_state()); - } // Test write error - network error (sync) @@ -1060,5 +1059,5 @@ TEST_F(CastSocketTest, TestReadBodyParseError) { } } // namespace cast_channel -} // namespace api +} // namespace core_api } // namespace extensions diff --git a/chrome/browser/extensions/api/hid/DEPS b/extensions/browser/api/hid/DEPS index 76a0f69..76a0f69 100644 --- a/chrome/browser/extensions/api/hid/DEPS +++ b/extensions/browser/api/hid/DEPS diff --git a/chrome/browser/extensions/api/hid/OWNERS b/extensions/browser/api/hid/OWNERS index cf122ec..cf122ec 100644 --- a/chrome/browser/extensions/api/hid/OWNERS +++ b/extensions/browser/api/hid/OWNERS diff --git a/chrome/browser/extensions/api/hid/hid_api.cc b/extensions/browser/api/hid/hid_api.cc index 2462384..06b0973 100644 --- a/chrome/browser/extensions/api/hid/hid_api.cc +++ b/extensions/browser/api/hid/hid_api.cc @@ -2,21 +2,21 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/hid/hid_api.h" +#include "extensions/browser/api/hid/hid_api.h" #include <string> #include <vector> -#include "chrome/common/extensions/api/hid.h" #include "device/hid/hid_connection.h" #include "device/hid/hid_device_info.h" #include "device/hid/hid_service.h" #include "extensions/browser/api/api_resource_manager.h" +#include "extensions/common/api/hid.h" #include "extensions/common/permissions/permissions_data.h" #include "extensions/common/permissions/usb_device_permission.h" #include "net/base/io_buffer.h" -namespace hid = extensions::api::hid; +namespace hid = extensions::core_api::hid; using device::HidConnection; using device::HidDeviceInfo; diff --git a/chrome/browser/extensions/api/hid/hid_api.h b/extensions/browser/api/hid/hid_api.h index 6d4b14d..d9ea2de 100644 --- a/chrome/browser/extensions/api/hid/hid_api.h +++ b/extensions/browser/api/hid/hid_api.h @@ -2,18 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_EXTENSIONS_API_HID_HID_API_H_ -#define CHROME_BROWSER_EXTENSIONS_API_HID_HID_API_H_ +#ifndef EXTENSIONS_BROWSER_API_HID_HID_API_H_ +#define EXTENSIONS_BROWSER_API_HID_HID_API_H_ #include <string> #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" -#include "chrome/browser/extensions/api/hid/hid_connection_resource.h" -#include "chrome/browser/extensions/api/hid/hid_device_manager.h" -#include "chrome/common/extensions/api/hid.h" #include "extensions/browser/api/api_resource_manager.h" #include "extensions/browser/api/async_api_function.h" +#include "extensions/browser/api/hid/hid_connection_resource.h" +#include "extensions/browser/api/hid/hid_device_manager.h" +#include "extensions/common/api/hid.h" namespace net { @@ -58,7 +58,7 @@ class HidGetDevicesFunction : public HidAsyncApiFunction { virtual ~HidGetDevicesFunction(); scoped_ptr<base::ListValue> result_; - scoped_ptr<extensions::api::hid::GetDevices::Params> parameters_; + scoped_ptr<core_api::hid::GetDevices::Params> parameters_; private: DISALLOW_COPY_AND_ASSIGN(HidGetDevicesFunction); @@ -78,7 +78,7 @@ class HidConnectFunction : public HidAsyncApiFunction { virtual ~HidConnectFunction(); scoped_ptr<base::ListValue> result_; - scoped_ptr<extensions::api::hid::Connect::Params> parameters_; + scoped_ptr<core_api::hid::Connect::Params> parameters_; DISALLOW_COPY_AND_ASSIGN(HidConnectFunction); }; @@ -97,7 +97,7 @@ class HidDisconnectFunction : public HidAsyncApiFunction { virtual ~HidDisconnectFunction(); scoped_ptr<base::ListValue> result_; - scoped_ptr<extensions::api::hid::Disconnect::Params> parameters_; + scoped_ptr<core_api::hid::Disconnect::Params> parameters_; DISALLOW_COPY_AND_ASSIGN(HidDisconnectFunction); }; @@ -119,7 +119,7 @@ class HidReceiveFunction : public HidAsyncApiFunction { scoped_refptr<net::IOBufferWithSize> buffer_; scoped_ptr<base::ListValue> result_; - scoped_ptr<extensions::api::hid::Receive::Params> parameters_; + scoped_ptr<core_api::hid::Receive::Params> parameters_; DISALLOW_COPY_AND_ASSIGN(HidReceiveFunction); }; @@ -140,7 +140,7 @@ class HidSendFunction : public HidAsyncApiFunction { void OnFinished(bool success, size_t bytes); scoped_ptr<base::ListValue> result_; - scoped_ptr<extensions::api::hid::Send::Params> parameters_; + scoped_ptr<core_api::hid::Send::Params> parameters_; DISALLOW_COPY_AND_ASSIGN(HidSendFunction); }; @@ -163,7 +163,7 @@ class HidReceiveFeatureReportFunction : public HidAsyncApiFunction { scoped_refptr<net::IOBufferWithSize> buffer_; scoped_ptr<base::ListValue> result_; - scoped_ptr<extensions::api::hid::ReceiveFeatureReport::Params> parameters_; + scoped_ptr<core_api::hid::ReceiveFeatureReport::Params> parameters_; DISALLOW_COPY_AND_ASSIGN(HidReceiveFeatureReportFunction); }; @@ -184,11 +184,11 @@ class HidSendFeatureReportFunction : public HidAsyncApiFunction { void OnFinished(bool success, size_t bytes); scoped_ptr<base::ListValue> result_; - scoped_ptr<extensions::api::hid::SendFeatureReport::Params> parameters_; + scoped_ptr<core_api::hid::SendFeatureReport::Params> parameters_; DISALLOW_COPY_AND_ASSIGN(HidSendFeatureReportFunction); }; } // namespace extensions -#endif // CHROME_BROWSER_EXTENSIONS_API_HID_HID_API_H_ +#endif // EXTENSIONS_BROWSER_API_HID_HID_API_H_ diff --git a/chrome/browser/extensions/api/hid/hid_connection_resource.cc b/extensions/browser/api/hid/hid_connection_resource.cc index 7c92ec8..8351166 100644 --- a/chrome/browser/extensions/api/hid/hid_connection_resource.cc +++ b/extensions/browser/api/hid/hid_connection_resource.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/hid/hid_connection_resource.h" +#include "extensions/browser/api/hid/hid_connection_resource.h" #include <string> diff --git a/chrome/browser/extensions/api/hid/hid_connection_resource.h b/extensions/browser/api/hid/hid_connection_resource.h index 08c26f7..13d6a11 100644 --- a/chrome/browser/extensions/api/hid/hid_connection_resource.h +++ b/extensions/browser/api/hid/hid_connection_resource.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_EXTENSIONS_API_HID_HID_CONNECTION_RESOURCE_H_ -#define CHROME_BROWSER_EXTENSIONS_API_HID_HID_CONNECTION_RESOURCE_H_ +#ifndef EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_ +#define EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_ #include <string> @@ -38,4 +38,4 @@ class HidConnectionResource : public ApiResource { } // namespace extensions -#endif // CHROME_BROWSER_EXTENSIONS_API_HID_HID_CONNECTION_RESOURCE_H_ +#endif // EXTENSIONS_BROWSER_API_HID_HID_CONNECTION_RESOURCE_H_ diff --git a/chrome/browser/extensions/api/hid/hid_device_manager.cc b/extensions/browser/api/hid/hid_device_manager.cc index 90fb6ce..c14783c 100644 --- a/chrome/browser/extensions/api/hid/hid_device_manager.cc +++ b/extensions/browser/api/hid/hid_device_manager.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/extensions/api/hid/hid_device_manager.h" +#include "extensions/browser/api/hid/hid_device_manager.h" #include <limits> #include <vector> @@ -47,7 +47,7 @@ scoped_ptr<base::ListValue> HidDeviceManager::GetApiDevices( if (hid_service->GetDeviceInfo(device_id, &device_info)) { if (device_info.vendor_id == vendor_id && device_info.product_id == product_id) { - api::hid::HidDeviceInfo api_device_info; + core_api::hid::HidDeviceInfo api_device_info; api_device_info.device_id = resource_id; api_device_info.vendor_id = device_info.vendor_id; api_device_info.product_id = device_info.product_id; @@ -69,8 +69,8 @@ scoped_ptr<base::ListValue> HidDeviceManager::GetApiDevices( continue; } - api::hid::HidCollectionInfo* api_collection = - new api::hid::HidCollectionInfo(); + core_api::hid::HidCollectionInfo* api_collection = + new core_api::hid::HidCollectionInfo(); api_collection->usage_page = collection.usage.usage_page; api_collection->usage = collection.usage.usage; diff --git a/chrome/browser/extensions/api/hid/hid_device_manager.h b/extensions/browser/api/hid/hid_device_manager.h index 84a6e30..de94960 100644 --- a/chrome/browser/extensions/api/hid/hid_device_manager.h +++ b/extensions/browser/api/hid/hid_device_manager.h @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef CHROME_BROWSER_EXTENSIONS_API_HID_HID_DEVICE_MANAGER_H_ -#define CHROME_BROWSER_EXTENSIONS_API_HID_HID_DEVICE_MANAGER_H_ +#ifndef EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ +#define EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ #include <stdint.h> @@ -12,10 +12,9 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "base/threading/thread_checker.h" -#include "chrome/browser/profiles/profile.h" -#include "chrome/common/extensions/api/hid.h" #include "device/hid/hid_device_info.h" #include "extensions/browser/browser_context_keyed_api_factory.h" +#include "extensions/common/api/hid.h" namespace extensions { @@ -59,4 +58,4 @@ class HidDeviceManager : public BrowserContextKeyedAPI { } // namespace extensions -#endif // CHROME_BROWSER_EXTENSIONS_API_HID_HID_DEVICE_MANAGER_H_ +#endif // EXTENSIONS_BROWSER_API_HID_HID_DEVICE_MANAGER_H_ diff --git a/extensions/browser/extensions_browser_client.h b/extensions/browser/extensions_browser_client.h index cb810b6..7616d5c 100644 --- a/extensions/browser/extensions_browser_client.h +++ b/extensions/browser/extensions_browser_client.h @@ -25,6 +25,7 @@ class WebContents; } namespace net { +class NetLog; class NetworkDelegate; class URLRequest; class URLRequestJob; @@ -177,6 +178,9 @@ class ExtensionsBrowserClient { virtual ComponentExtensionResourceManager* GetComponentExtensionResourceManager() = 0; + // Returns the embedder's net::NetLog. + virtual net::NetLog* GetNetLog() = 0; + // Returns the single instance of |this|. static ExtensionsBrowserClient* Get(); diff --git a/extensions/browser/test_extensions_browser_client.cc b/extensions/browser/test_extensions_browser_client.cc index a01b128..6ff13db 100644 --- a/extensions/browser/test_extensions_browser_client.cc +++ b/extensions/browser/test_extensions_browser_client.cc @@ -164,4 +164,8 @@ TestExtensionsBrowserClient::GetComponentExtensionResourceManager() { return NULL; } +net::NetLog* TestExtensionsBrowserClient::GetNetLog() { + return NULL; +} + } // namespace extensions diff --git a/extensions/browser/test_extensions_browser_client.h b/extensions/browser/test_extensions_browser_client.h index 1cfffee..c47c5cd 100644 --- a/extensions/browser/test_extensions_browser_client.h +++ b/extensions/browser/test_extensions_browser_client.h @@ -78,6 +78,7 @@ class TestExtensionsBrowserClient : public ExtensionsBrowserClient { content::BrowserContext* context) const OVERRIDE; virtual ComponentExtensionResourceManager* GetComponentExtensionResourceManager() OVERRIDE; + virtual net::NetLog* GetNetLog() OVERRIDE; private: content::BrowserContext* main_context_; // Not owned. diff --git a/extensions/common/api/BUILD.gn b/extensions/common/api/BUILD.gn index d28d98cd..95320f9 100644 --- a/extensions/common/api/BUILD.gn +++ b/extensions/common/api/BUILD.gn @@ -9,8 +9,10 @@ generated_extensions_api("api") { sources = [ "app_runtime.idl", "app_view_internal.json", + "cast_channel.idl", "dns.idl", "extensions_manifest_types.json", + "hid.idl", "power.idl", "runtime.json", "serial.idl", diff --git a/extensions/common/api/api.gyp b/extensions/common/api/api.gyp index 94be1fd..49725aa5 100644 --- a/extensions/common/api/api.gyp +++ b/extensions/common/api/api.gyp @@ -27,8 +27,10 @@ 'schema_files': [ 'app_runtime.idl', 'app_view_internal.json', + 'cast_channel.idl', 'dns.idl', 'extensions_manifest_types.json', + 'hid.idl', 'power.idl', 'runtime.json', 'serial.idl', diff --git a/chrome/common/extensions/api/cast_channel.idl b/extensions/common/api/cast_channel.idl index 9ea2136..ebefa99 100644 --- a/chrome/common/extensions/api/cast_channel.idl +++ b/extensions/common/api/cast_channel.idl @@ -1,4 +1,4 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. +// Copyright 2014 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/chrome/common/extensions/api/hid.idl b/extensions/common/api/hid.idl index bf2cad4..bf2cad4 100644 --- a/chrome/common/extensions/api/hid.idl +++ b/extensions/common/api/hid.idl diff --git a/extensions/extensions.gyp b/extensions/extensions.gyp index 0320c8f..7faa191 100644 --- a/extensions/extensions.gyp +++ b/extensions/extensions.gyp @@ -247,6 +247,7 @@ '../device/serial/serial.gyp:device_serial', '../skia/skia.gyp:skia', '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase', + 'cast_channel_proto', 'common/api/api.gyp:extensions_api', 'extensions_common', 'extensions_strings.gyp:extensions_strings', @@ -273,12 +274,25 @@ 'browser/api/app_view/app_view_internal_api.h', 'browser/api/async_api_function.cc', 'browser/api/async_api_function.h', + 'browser/api/cast_channel/cast_auth_util.h', + 'browser/api/cast_channel/cast_channel_api.cc', + 'browser/api/cast_channel/cast_channel_api.h', + 'browser/api/cast_channel/cast_message_util.cc', + 'browser/api/cast_channel/cast_message_util.h', + 'browser/api/cast_channel/cast_socket.cc', + 'browser/api/cast_channel/cast_socket.h', 'browser/api/dns/dns_api.cc', 'browser/api/dns/dns_api.h', 'browser/api/dns/host_resolver_wrapper.cc', 'browser/api/dns/host_resolver_wrapper.h', 'browser/api/extensions_api_client.cc', 'browser/api/extensions_api_client.h', + 'browser/api/hid/hid_api.cc', + 'browser/api/hid/hid_api.h', + 'browser/api/hid/hid_connection_resource.cc', + 'browser/api/hid/hid_connection_resource.h', + 'browser/api/hid/hid_device_manager.cc', + 'browser/api/hid/hid_device_manager.h', 'browser/api/power/power_api.cc', 'browser/api/power/power_api.h', 'browser/api/power/power_api_manager.cc', @@ -490,6 +504,27 @@ '../device/serial/serial.gyp:device_serial', ], }], + ['use_openssl==1', { + 'sources': [ + 'browser/api/cast_channel/cast_auth_util_openssl.cc', + ], + }, { + 'sources': [ + # cast_auth_util_nss.cc uses NSS functions. + 'browser/api/cast_channel/cast_auth_util_nss.cc', + ], + }], + ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "android"', { + 'dependencies': [ + '../build/linux/system.gyp:ssl', + ], + }], + ['OS == "mac" or OS == "ios" or OS == "win"', { + 'dependencies': [ + '../third_party/nss/nss.gyp:nspr', + '../third_party/nss/nss.gyp:nss', + ], + }], ], # Disable c4267 warnings until we fix size_t to int truncations. 'msvs_disabled_warnings': [ 4267, ], @@ -770,5 +805,17 @@ }], ], }, + { + # Protobuf compiler / generator for chrome.cast.channel-related protocol buffers. + # GN version: //extensions/browser/api/cast_channel/BUILD.gn + 'target_name': 'cast_channel_proto', + 'type': 'static_library', + 'sources': [ 'browser/api/cast_channel/cast_channel.proto' ], + 'variables': { + 'proto_in_dir': 'browser/api/cast_channel', + 'proto_out_dir': 'extensions/browser/api/cast_channel', + }, + 'includes': [ '../build/protoc.gypi' ] + }, ] } diff --git a/extensions/shell/app_shell.gyp b/extensions/shell/app_shell.gyp index cb1dceb..f24978b 100644 --- a/extensions/shell/app_shell.gyp +++ b/extensions/shell/app_shell.gyp @@ -80,6 +80,7 @@ '<(DEPTH)/content/content.gyp:content_gpu', '<(DEPTH)/content/content.gyp:content_ppapi_plugin', '<(DEPTH)/content/content_shell_and_tests.gyp:content_shell_lib', + '<(DEPTH)/device/hid/hid.gyp:device_hid', '<(DEPTH)/extensions/common/api/api.gyp:extensions_api', '<(DEPTH)/extensions/extensions.gyp:extensions_browser', '<(DEPTH)/extensions/extensions.gyp:extensions_common', diff --git a/extensions/shell/browser/shell_extensions_browser_client.cc b/extensions/shell/browser/shell_extensions_browser_client.cc index c725ebd..298d412 100644 --- a/extensions/shell/browser/shell_extensions_browser_client.cc +++ b/extensions/shell/browser/shell_extensions_browser_client.cc @@ -239,4 +239,8 @@ ShellExtensionsBrowserClient::GetComponentExtensionResourceManager() { return NULL; } +net::NetLog* ShellExtensionsBrowserClient::GetNetLog() { + return NULL; +} + } // namespace extensions diff --git a/extensions/shell/browser/shell_extensions_browser_client.h b/extensions/shell/browser/shell_extensions_browser_client.h index 648c7aa..472b5f0 100644 --- a/extensions/shell/browser/shell_extensions_browser_client.h +++ b/extensions/shell/browser/shell_extensions_browser_client.h @@ -74,6 +74,7 @@ class ShellExtensionsBrowserClient : public ExtensionsBrowserClient { content::BrowserContext* context) const OVERRIDE; virtual ComponentExtensionResourceManager* GetComponentExtensionResourceManager() OVERRIDE; + virtual net::NetLog* GetNetLog() OVERRIDE; private: // The single BrowserContext for app_shell. Not owned. |