diff --git a/DEPS b/DEPS index ed050f4..533c647 100644 --- a/DEPS +++ b/DEPS
@@ -44,7 +44,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '493d8b47ade62b5b331c13a102282102bce14489', + 'v8_revision': '2284f0b2d4153e6e2c512cc4aa660d64cf243ee4', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -96,7 +96,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': '6866edfb97f38a69ed7dd24cf6c6d8e85bfe2dbc', + 'catapult_revision': 'ccb57adfd154798c0eb20b336b6ea8120c34fa13', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -232,7 +232,7 @@ Var('chromium_git') + '/native_client/src/third_party/scons-2.0.1.git' + '@' + '1c1550e17fc26355d08627fbdec13d8291227067', 'src/third_party/webrtc': - Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + 'c9e9080c82c5b19092d636c36d288652d0dde62c', # commit position 18408 + Var('chromium_git') + '/external/webrtc/trunk/webrtc.git' + '@' + '2149a54ecafd877efdc40e805e4492519b582562', # commit position 18441 'src/third_party/openmax_dl': Var('chromium_git') + '/external/webrtc/deps/third_party/openmax.git' + '@' + Var('openmax_dl_revision'),
diff --git a/components/crash/android/javatests/src/org/chromium/components/crash/browser/CrashDumpManagerTest.java b/components/crash/android/javatests/src/org/chromium/components/crash/browser/CrashDumpManagerTest.java index 53b91f6..0e0520d 100644 --- a/components/crash/android/javatests/src/org/chromium/components/crash/browser/CrashDumpManagerTest.java +++ b/components/crash/android/javatests/src/org/chromium/components/crash/browser/CrashDumpManagerTest.java
@@ -68,7 +68,7 @@ // @SmallTest // @Feature({"Android-AppBase"}) - @DisabledTest // Flaky, crbug.com/726976. + @DisabledTest // Flaky, crbug.com/725379. public void testUploadMinidump_FileDoesntExist() { registerUploadCallback(new CrashDumpManager.UploadMinidumpCallback() { @Override @@ -83,6 +83,7 @@ @SmallTest @Feature({"Android-AppBase"}) + @DisabledTest // Flaky, crbug.com/725379. public void testUploadMinidump_MinidumpPathIsDirectory() throws IOException { File directory = new File(mTempDir, "a_directory"); assertTrue(directory.mkdir()); @@ -99,6 +100,7 @@ @SmallTest @Feature({"Android-AppBase"}) + @DisabledTest // Flaky, crbug.com/725379. public void testUploadMinidump_MinidumpPathIsValid() throws IOException { final File minidump = new File(mTempDir, "mini.dmp"); assertTrue(minidump.createNewFile());
diff --git a/google_apis/BUILD.gn b/google_apis/BUILD.gn index 7170f4e..1ac35ebf 100644 --- a/google_apis/BUILD.gn +++ b/google_apis/BUILD.gn
@@ -138,6 +138,7 @@ "//base", "//base/third_party/dynamic_annotations", "//crypto", + "//mojo/public/cpp/bindings:struct_traits", ] if (defined(invoker.deps)) {
diff --git a/google_apis/gaia/DEPS b/google_apis/gaia/DEPS new file mode 100644 index 0000000..f8f20b6 --- /dev/null +++ b/google_apis/gaia/DEPS
@@ -0,0 +1,4 @@ +include_rules = [ + # Needed to support typemaps of core types for the Identity Service. + "+mojo/public/cpp/bindings/struct_traits.h", +]
diff --git a/google_apis/gaia/google_service_auth_error.cc b/google_apis/gaia/google_service_auth_error.cc index 909cf16..a357005 100644 --- a/google_apis/gaia/google_service_auth_error.cc +++ b/google_apis/gaia/google_service_auth_error.cc
@@ -74,6 +74,9 @@ return !(*this == b); } +GoogleServiceAuthError::GoogleServiceAuthError() + : state_(NONE), network_error_(0) {} + GoogleServiceAuthError::GoogleServiceAuthError(State s) : state_(s), network_error_(0) {
diff --git a/google_apis/gaia/google_service_auth_error.h b/google_apis/gaia/google_service_auth_error.h index 2736e57..5e84599 100644 --- a/google_apis/gaia/google_service_auth_error.h +++ b/google_apis/gaia/google_service_auth_error.h
@@ -24,8 +24,16 @@ #include <string> +#include "mojo/public/cpp/bindings/struct_traits.h" + #include "url/gurl.h" +namespace identity { +namespace mojom { +class GoogleServiceAuthErrorDataView; +} +} + namespace base { class DictionaryValue; } @@ -146,6 +154,10 @@ // Construct a GoogleServiceAuthError from a State with no additional data. explicit GoogleServiceAuthError(State s); + // Equivalent to calling GoogleServiceAuthError(NONE). Needs to exist and be + // public for Mojo bindings code. + GoogleServiceAuthError(); + GoogleServiceAuthError(const GoogleServiceAuthError& other); // Construct a GoogleServiceAuthError from a network error. @@ -199,6 +211,12 @@ bool IsTransientError() const; private: + // Allows the Identity Service to construct a GoogleServiceAuthError instance + // from data that has come in over the wire. + friend struct mojo::StructTraits< + identity::mojom::GoogleServiceAuthErrorDataView, + GoogleServiceAuthError>; + GoogleServiceAuthError(State s, int error); // Construct a GoogleServiceAuthError from |state| and |error_message|.
diff --git a/headless/BUILD.gn b/headless/BUILD.gn index a038ce3..1313ee56 100644 --- a/headless/BUILD.gn +++ b/headless/BUILD.gn
@@ -212,6 +212,8 @@ "//build/linux:fontconfig", "//third_party/freetype", ] + + configs += [ ":headless_implementation" ] } }
diff --git a/headless/public/util/fontconfig.h b/headless/public/util/fontconfig.h index 2a50493..b3e1ec1e 100644 --- a/headless/public/util/fontconfig.h +++ b/headless/public/util/fontconfig.h
@@ -5,15 +5,17 @@ #ifndef HEADLESS_PUBLIC_UTIL_FONTCONFIG_H_ #define HEADLESS_PUBLIC_UTIL_FONTCONFIG_H_ +#include "headless/public/headless_export.h" + namespace headless { // Initialize fontconfig by loading fonts from given path without following // symlinks. This is a wrapper around FcInit from libfreetype bundled with // Chromium modified to enable headless embedders to deploy in custom // environments. -void InitFonts(const char* font_config_path); +HEADLESS_EXPORT void InitFonts(const char* font_config_path); -void ReleaseFonts(); +HEADLESS_EXPORT void ReleaseFonts(); } // namespace headless
diff --git a/mojo/public/tools/bindings/chromium_bindings_configuration.gni b/mojo/public/tools/bindings/chromium_bindings_configuration.gni index 945a781..1166acc1 100644 --- a/mojo/public/tools/bindings/chromium_bindings_configuration.gni +++ b/mojo/public/tools/bindings/chromium_bindings_configuration.gni
@@ -28,6 +28,7 @@ "//mojo/common/typemaps.gni", "//mojo/public/cpp/bindings/tests/chromium_typemaps.gni", "//net/interfaces/typemaps.gni", + "//services/identity/public/cpp/typemaps.gni", "//services/preferences/public/cpp/typemaps.gni", "//services/resource_coordinator/public/cpp/typemaps.gni", "//services/service_manager/public/cpp/typemaps.gni",
diff --git a/net/quic/chromium/quic_chromium_client_session.cc b/net/quic/chromium/quic_chromium_client_session.cc index 3e47b88..ba9e2c2 100644 --- a/net/quic/chromium/quic_chromium_client_session.cc +++ b/net/quic/chromium/quic_chromium_client_session.cc
@@ -353,7 +353,7 @@ QuicChromiumClientSession::StreamRequest::StreamRequest( QuicChromiumClientSession::Handle* session, bool requires_confirmation) - : session_(std::move(session)), + : session_(session), requires_confirmation_(requires_confirmation), stream_(nullptr), weak_factory_(this) {}
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc index 3dded3d..fc429bc 100644 --- a/net/url_request/url_request_unittest.cc +++ b/net/url_request/url_request_unittest.cc
@@ -6782,7 +6782,7 @@ context.set_network_delegate(&network_delegate); context.set_cert_verifier(&cert_verifier); context.set_cert_transparency_verifier(&ct_verifier); - context.set_ct_policy_enforcer(std::move(&ct_policy_enforcer)); + context.set_ct_policy_enforcer(&ct_policy_enforcer); context.Init(); // Now send a request to trigger the violation.
diff --git a/services/identity/public/cpp/BUILD.gn b/services/identity/public/cpp/BUILD.gn new file mode 100644 index 0000000..07ad0e4 --- /dev/null +++ b/services/identity/public/cpp/BUILD.gn
@@ -0,0 +1,13 @@ +# Copyright 2017 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. + +# A source_set for types which the public interfaces depend on for typemapping. +# This cannot itself depend on the main public interfaces target. +source_set("cpp_types") { + output_name = "identity_cpp_types" + + sources = [ + "scope_set.h", + ] +}
diff --git a/services/identity/public/cpp/DEPS b/services/identity/public/cpp/DEPS new file mode 100644 index 0000000..4b54793 --- /dev/null +++ b/services/identity/public/cpp/DEPS
@@ -0,0 +1,3 @@ +include_rules = [ + "+google_apis/gaia/google_service_auth_error.h", +]
diff --git a/services/identity/public/cpp/OWNERS b/services/identity/public/cpp/OWNERS new file mode 100644 index 0000000..4df0c71 --- /dev/null +++ b/services/identity/public/cpp/OWNERS
@@ -0,0 +1,4 @@ +per-file *_struct_traits*.*=set noparent +per-file *_struct_traits*.*=file://ipc/SECURITY_OWNERS +per-file *.typemap=set noparent +per-file *.typemap=file://ipc/SECURITY_OWNERS
diff --git a/services/identity/public/cpp/google_service_auth_error.typemap b/services/identity/public/cpp/google_service_auth_error.typemap new file mode 100644 index 0000000..8212e41 --- /dev/null +++ b/services/identity/public/cpp/google_service_auth_error.typemap
@@ -0,0 +1,23 @@ +# Copyright 2017 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. + +mojom = "//services/identity/public/interfaces/google_service_auth_error.mojom" +public_headers = [ "//google_apis/gaia/google_service_auth_error.h" ] +traits_headers = [ "//services/identity/public/cpp/google_service_auth_error_struct_traits.h" ] +sources = [ + "//services/identity/public/cpp/google_service_auth_error_struct_traits.cc", +] +public_deps = [ + # TODO(blundell): In the long term, any files from //google_apis that are + # exposed to consumers of the Identity Service should move to be part of + # the client library of the Identity Service. + "//google_apis", + "//services/identity/public/cpp:cpp_types", +] + +type_mappings = [ + "identity.mojom.Captcha=::GoogleServiceAuthError::Captcha", + "identity.mojom.SecondFactor=::GoogleServiceAuthError::SecondFactor", + "identity.mojom.GoogleServiceAuthError=::GoogleServiceAuthError", +]
diff --git a/services/identity/public/cpp/google_service_auth_error_struct_traits.cc b/services/identity/public/cpp/google_service_auth_error_struct_traits.cc new file mode 100644 index 0000000..c783ffbae --- /dev/null +++ b/services/identity/public/cpp/google_service_auth_error_struct_traits.cc
@@ -0,0 +1,82 @@ +// Copyright 2017 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 "services/identity/public/cpp/google_service_auth_error_struct_traits.h" + +#include "url/mojo/url_gurl_struct_traits.h" + +namespace mojo { + +// static +bool StructTraits<identity::mojom::GoogleServiceAuthError::DataView, + ::GoogleServiceAuthError>:: + Read(identity::mojom::GoogleServiceAuthErrorDataView data, + ::GoogleServiceAuthError* out) { + int state = data.state(); + ::GoogleServiceAuthError::Captcha captcha; + ::GoogleServiceAuthError::SecondFactor second_factor; + std::string error_message; + if (state < 0 || state > ::GoogleServiceAuthError::State::NUM_STATES || + !data.ReadCaptcha(&captcha) || !data.ReadSecondFactor(&second_factor) || + !data.ReadErrorMessage(&error_message)) { + return false; + } + + out->state_ = ::GoogleServiceAuthError::State(state); + out->captcha_ = captcha; + out->second_factor_ = second_factor; + out->error_message_ = error_message; + out->network_error_ = data.network_error(); + + return true; +} + +// static +bool StructTraits<identity::mojom::Captcha::DataView, + ::GoogleServiceAuthError::Captcha>:: + Read(identity::mojom::CaptchaDataView data, + ::GoogleServiceAuthError::Captcha* out) { + std::string token; + GURL audio_url; + GURL image_url; + GURL unlock_url; + if (data.image_width() < 0 || data.image_height() < 0 || + !data.ReadToken(&token) || !data.ReadAudioUrl(&audio_url) || + !data.ReadImageUrl(&image_url) || !data.ReadUnlockUrl(&unlock_url)) { + return false; + } + + out->token = token; + out->audio_url = audio_url; + out->image_url = image_url; + out->unlock_url = unlock_url; + out->image_width = data.image_width(); + out->image_height = data.image_height(); + + return true; +} + +// static +bool StructTraits<identity::mojom::SecondFactor::DataView, + ::GoogleServiceAuthError::SecondFactor>:: + Read(identity::mojom::SecondFactorDataView data, + ::GoogleServiceAuthError::SecondFactor* out) { + std::string token; + std::string prompt_text; + std::string alternate_text; + if (data.field_length() < 0 || !data.ReadToken(&token) || + !data.ReadPromptText(&prompt_text) || + !data.ReadAlternateText(&alternate_text)) { + return false; + } + + out->token = token; + out->prompt_text = prompt_text; + out->alternate_text = alternate_text; + out->field_length = data.field_length(); + + return true; +} + +} // namespace mojo
diff --git a/services/identity/public/cpp/google_service_auth_error_struct_traits.h b/services/identity/public/cpp/google_service_auth_error_struct_traits.h new file mode 100644 index 0000000..04ffd30 --- /dev/null +++ b/services/identity/public/cpp/google_service_auth_error_struct_traits.h
@@ -0,0 +1,89 @@ +// Copyright 2017 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 SERVICES_IDENTITY_PUBLIC_CPP_GOOGLE_SERVICE_AUTH_ERROR_STRUCT_TRAITS_H_ +#define SERVICES_IDENTITY_PUBLIC_CPP_GOOGLE_SERVICE_AUTH_ERROR_STRUCT_TRAITS_H_ + +#include <string> + +#include "google_apis/gaia/google_service_auth_error.h" +#include "services/identity/public/interfaces/google_service_auth_error.mojom.h" + +namespace mojo { + +template <> +struct StructTraits<identity::mojom::GoogleServiceAuthError::DataView, + ::GoogleServiceAuthError> { + static int state(const ::GoogleServiceAuthError& r) { return r.state(); } + static const ::GoogleServiceAuthError::Captcha& captcha( + const ::GoogleServiceAuthError& r) { + return r.captcha(); + } + static const ::GoogleServiceAuthError::SecondFactor& second_factor( + const ::GoogleServiceAuthError& r) { + return r.second_factor(); + } + static int network_error(const ::GoogleServiceAuthError& r) { + return r.network_error(); + } + + static const std::string& error_message(const ::GoogleServiceAuthError& r) { + return r.error_message(); + } + + static bool Read(identity::mojom::GoogleServiceAuthErrorDataView data, + ::GoogleServiceAuthError* out); +}; + +template <> +struct StructTraits<identity::mojom::Captcha::DataView, + ::GoogleServiceAuthError::Captcha> { + static const std::string& token(const ::GoogleServiceAuthError::Captcha& r) { + return r.token; + } + static const GURL& audio_url(const ::GoogleServiceAuthError::Captcha& r) { + return r.audio_url; + } + static const GURL& image_url(const ::GoogleServiceAuthError::Captcha& r) { + return r.image_url; + } + static const GURL& unlock_url(const ::GoogleServiceAuthError::Captcha& r) { + return r.unlock_url; + } + static int image_width(const ::GoogleServiceAuthError::Captcha& r) { + return r.image_width; + } + static int image_height(const ::GoogleServiceAuthError::Captcha& r) { + return r.image_height; + } + + static bool Read(identity::mojom::CaptchaDataView data, + ::GoogleServiceAuthError::Captcha* out); +}; + +template <> +struct StructTraits<identity::mojom::SecondFactor::DataView, + ::GoogleServiceAuthError::SecondFactor> { + static std::string token(const ::GoogleServiceAuthError::SecondFactor& r) { + return r.token; + } + static const std::string& prompt_text( + const ::GoogleServiceAuthError::SecondFactor& r) { + return r.prompt_text; + } + static const std::string& alternate_text( + const ::GoogleServiceAuthError::SecondFactor& r) { + return r.alternate_text; + } + static int field_length(const ::GoogleServiceAuthError::SecondFactor& r) { + return r.field_length; + } + + static bool Read(identity::mojom::SecondFactorDataView data, + ::GoogleServiceAuthError::SecondFactor* out); +}; + +} // namespace mojo + +#endif // SERVICES_IDENTITY_PUBLIC_CPP_GOOGLE_SERVICE_AUTH_ERROR_STRUCT_TRAITS_H_
diff --git a/services/identity/public/cpp/scope_set.h b/services/identity/public/cpp/scope_set.h new file mode 100644 index 0000000..f5017306 --- /dev/null +++ b/services/identity/public/cpp/scope_set.h
@@ -0,0 +1,16 @@ +// Copyright 2017 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 SERVICES_IDENTITY_PUBLIC_CPP_SCOPE_SET_H_ +#define SERVICES_IDENTITY_PUBLIC_CPP_SCOPE_SET_H_ + +#include <set> + +namespace identity { + +using ScopeSet = std::set<std::string>; + +} // namespace identity + +#endif // SERVICES_IDENTITY_PUBLIC_CPP_SCOPE_SET_H_
diff --git a/services/identity/public/cpp/scope_set.typemap b/services/identity/public/cpp/scope_set.typemap new file mode 100644 index 0000000..eec17a98 --- /dev/null +++ b/services/identity/public/cpp/scope_set.typemap
@@ -0,0 +1,12 @@ +# Copyright 2017 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. + +mojom = "//services/identity/public/interfaces/scope_set.mojom" +public_headers = [ "//services/identity/public/cpp/scope_set.h" ] +traits_headers = [ "//services/identity/public/cpp/scope_set_struct_traits.h" ] +public_deps = [ + "//services/identity/public/cpp:cpp_types", +] + +type_mappings = [ "identity.mojom.ScopeSet=::identity::ScopeSet" ]
diff --git a/services/identity/public/cpp/scope_set_struct_traits.h b/services/identity/public/cpp/scope_set_struct_traits.h new file mode 100644 index 0000000..467b9065 --- /dev/null +++ b/services/identity/public/cpp/scope_set_struct_traits.h
@@ -0,0 +1,48 @@ +// Copyright 2017 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 SERVICES_IDENTITY_PUBLIC_CPP_SCOPE_SET_STRUCT_TRAITS_H_ +#define SERVICES_IDENTITY_PUBLIC_CPP_SCOPE_SET_STRUCT_TRAITS_H_ + +#include "services/identity/public/cpp/scope_set.h" + +namespace mojo { + +template <> +struct StructTraits<identity::mojom::ScopeSet::DataView, identity::ScopeSet> { + static void* SetUpContext(const identity::ScopeSet& scope_set) { + std::vector<std::string>* scopes = new std::vector<std::string>(); + for (const auto& scope : scope_set) + scopes->push_back(scope); + return scopes; + } + + static void TearDownContext(const identity::ScopeSet& scope_set, + void* context) { + delete static_cast<std::vector<std::string>*>(context); + } + + static const std::vector<std::string>& scopes( + const identity::ScopeSet& scope_set, + void* context) { + return *(static_cast<std::vector<std::string>*>(context)); + } + + static bool Read(identity::mojom::ScopeSetDataView data, + identity::ScopeSet* out) { + ArrayDataView<StringDataView> scopes_data_view; + data.GetScopesDataView(&scopes_data_view); + for (size_t i = 0; i < scopes_data_view.size(); ++i) { + std::string scope; + if (!scopes_data_view.Read(i, &scope)) + return false; + out->insert(std::move(scope)); + } + return true; + } +}; + +} // namespace mojo + +#endif // SERVICES_IDENTITY_PUBLIC_CPP_SCOPE_SET_STRUCT_TRAITS_H_
diff --git a/services/identity/public/cpp/typemaps.gni b/services/identity/public/cpp/typemaps.gni new file mode 100644 index 0000000..19923c73 --- /dev/null +++ b/services/identity/public/cpp/typemaps.gni
@@ -0,0 +1,4 @@ +typemaps = [ + "//services/identity/public/cpp/google_service_auth_error.typemap", + "//services/identity/public/cpp/scope_set.typemap", +]
diff --git a/services/identity/public/interfaces/BUILD.gn b/services/identity/public/interfaces/BUILD.gn index f2e15ffe..faa6bad 100644 --- a/services/identity/public/interfaces/BUILD.gn +++ b/services/identity/public/interfaces/BUILD.gn
@@ -6,12 +6,16 @@ mojom("interfaces") { sources = [ + "google_service_auth_error.mojom", "identity_manager.mojom", + "scope_set.mojom", ] public_deps = [ ":constants", "//components/signin/public/interfaces", + "//mojo/common:common_custom_types", + "//url/mojo:url_mojom_gurl", ] }
diff --git a/services/identity/public/interfaces/google_service_auth_error.mojom b/services/identity/public/interfaces/google_service_auth_error.mojom new file mode 100644 index 0000000..435d2c91 --- /dev/null +++ b/services/identity/public/interfaces/google_service_auth_error.mojom
@@ -0,0 +1,46 @@ +// Copyright 2017 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. + +module identity.mojom; + +import "url/mojo/url.mojom"; + +// Defines an authentication error from a Google service. See comments on +// google_service_auth_error.h, to which these interfaces are typemapped. +// TODO(blundell): Once google_service_auth_error.* becomes part of the +// Identity Service client library, move all comments from the C++ header +// to here, and have the C++ header reference this file for documentation +// rather than the other way around. +struct Captcha { + string token; + url.mojom.Url audio_url; + url.mojom.Url image_url; + url.mojom.Url unlock_url; + // TODO(blundell): Change this to be a Size (from geometry.mojom) once + // google_service_auth_error.* becomes part of the Identity Service client + // library. + int32 image_width; + int32 image_height; +}; + +struct SecondFactor { + string token; + string prompt_text; + string alternate_text; + // TODO(blundell): Change this to be unsigned once + // google_service_auth_error.* becomes part of the Identity Service client + // library. + int32 field_length; +}; + +struct GoogleServiceAuthError { + // Must correspond to a value in the C++ GoogleServiceAuthError::State enum. + // TODO(blundell): Move the enum into mojom once google_service_auth_error.* + // becomes part of the Identity Service client library. + int32 state; + Captcha captcha; + SecondFactor second_factor; + int32 network_error; + string error_message; +};
diff --git a/services/identity/public/interfaces/scope_set.mojom b/services/identity/public/interfaces/scope_set.mojom new file mode 100644 index 0000000..f2cd469 --- /dev/null +++ b/services/identity/public/interfaces/scope_set.mojom
@@ -0,0 +1,12 @@ +// Copyright 2017 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. + +module identity.mojom; + +// Defines a set of access scopes. We don't represent this as a bare array +// in-situ in mojom because we rely on type maps to generate a set container in +// C++ which is unavailable for a bare array. +struct ScopeSet { + array<string> scopes; +};
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp index aac3f64..2fb9e7d 100644 --- a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp +++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp
@@ -42,8 +42,7 @@ } CSSMatrixComponent* CSSMatrixComponent::Perspective(double length) { - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); if (length != 0) matrix->setM34(-1 / length); @@ -51,8 +50,7 @@ } CSSMatrixComponent* CSSMatrixComponent::Rotate(double angle) { - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); matrix->rotateSelf(angle); return new CSSMatrixComponent(matrix, kRotationType); @@ -62,16 +60,14 @@ double x, double y, double z) { - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); matrix->rotateAxisAngleSelf(x, y, z, angle); return new CSSMatrixComponent(matrix, kRotation3DType); } CSSMatrixComponent* CSSMatrixComponent::Scale(double x, double y) { - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); matrix->setM11(x); matrix->setM22(y); @@ -79,8 +75,7 @@ } CSSMatrixComponent* CSSMatrixComponent::Scale3d(double x, double y, double z) { - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); matrix->setM11(x); matrix->setM22(y); @@ -92,8 +87,7 @@ double tan_ax = std::tan(deg2rad(ax)); double tan_ay = std::tan(deg2rad(ay)); - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); matrix->setM12(tan_ay); matrix->setM21(tan_ax); @@ -101,8 +95,7 @@ } CSSMatrixComponent* CSSMatrixComponent::Translate(double x, double y) { - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); matrix->setM41(x); matrix->setM42(y); @@ -112,8 +105,7 @@ CSSMatrixComponent* CSSMatrixComponent::Translate3d(double x, double y, double z) { - DOMMatrixInit init; - DOMMatrix* matrix = DOMMatrix::fromMatrix(init, ASSERT_NO_EXCEPTION); + DOMMatrix* matrix = DOMMatrix::Create(); matrix->setM41(x); matrix->setM42(y);
diff --git a/third_party/WebKit/Source/modules/sensor/Sensor.cpp b/third_party/WebKit/Source/modules/sensor/Sensor.cpp index 7cf29be..400374f 100644 --- a/third_party/WebKit/Source/modules/sensor/Sensor.cpp +++ b/third_party/WebKit/Source/modules/sensor/Sensor.cpp
@@ -310,8 +310,7 @@ } void Sensor::NotifyError(DOMException* error) { - DispatchEvent( - SensorErrorEvent::Create(EventTypeNames::error, std::move(error))); + DispatchEvent(SensorErrorEvent::Create(EventTypeNames::error, error)); } bool Sensor::CanReturnReadings() const {
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp index 186ce87e..cfffac255 100644 --- a/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp +++ b/third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp
@@ -409,7 +409,7 @@ scroll_offset_animation_curve->target_value().y()); if (WillAnimateToOffset(target_value)) { animation_curve_ = CompositorScrollOffsetAnimationCurve::Create( - std::move(scroll_offset_animation_curve)); + scroll_offset_animation_curve); start_time_ = animation_start_time; } }
diff --git a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js index 7d8bed0..e5b0b72 100644 --- a/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js +++ b/ui/file_manager/file_manager/foreground/js/file_transfer_controller.js
@@ -216,6 +216,35 @@ FileTransferController.DRAG_LABEL_Y_OFFSET_ = -32; /** + * Container for defining a copy/move operation. + * + * @param {!Array<string>} sourceURLs URLs of source entries. + * @param {!DirectoryEntry} destinationEntry Destination directory. + * @param {boolean} isMove true if move, false if copy. + * @constructor + * @struct + */ +FileTransferController.PastePlan = function( + sourceURLs, destinationEntry, isMove) { + /** + * @type {!Array<string>} + * @const + */ + this.sourceURLs = sourceURLs; + + /** + * @type {!DirectoryEntry} + */ + this.destinationEntry = destinationEntry; + + /** + * @type {boolean} + * @const + */ + this.isMove = isMove; +}; + +/** * Converts list of urls to list of Entries with granting R/W permissions to * them, which is essential when pasting files from a different profile. * @@ -390,21 +419,24 @@ }; /** - * Extracts source root URL from the |clipboardData| object. + * Extracts source root URL from the |clipboardData| or |dragAndDropData| + * object. * * @param {!ClipboardData} clipboardData DataTransfer object from the event. + * @param {Object<string>} dragAndDropData The drag and drop data from + * getDragAndDropGlobalData_(). * @return {string} URL or an empty string (if unknown). * @private */ -FileTransferController.prototype.getSourceRootURL_ = function(clipboardData) { +FileTransferController.prototype.getSourceRootURL_ = function( + clipboardData, dragAndDropData) { var sourceRootURL = clipboardData.getData('fs/sourceRootURL'); if (sourceRootURL) return sourceRootURL; // |clipboardData| in protected mode. - var globalData = this.getDragAndDropGlobalData_(); - if (globalData) - return globalData.sourceRootURL; + if (dragAndDropData) + return dragAndDropData.sourceRootURL; // Unknown source. return ''; @@ -501,7 +533,31 @@ }; /** - * Queue up a file copy operation based on the current system clipboard. + * Collects parameters of paste operation by the given command and the current + * system clipboard. + * + * @return {FileTransferController.PastePlan} + */ +FileTransferController.prototype.preparePaste = function( + clipboardData, opt_destinationEntry, opt_effect) { + var sourceURLs = clipboardData.getData('fs/sources') ? + clipboardData.getData('fs/sources').split('\n') : []; + // effectAllowed set in copy/paste handlers stay uninitialized. DnD handlers + // work fine. + var effectAllowed = clipboardData.effectAllowed !== 'uninitialized' ? + clipboardData.effectAllowed : clipboardData.getData('fs/effectallowed'); + var destinationEntry = opt_destinationEntry || + /** @type {DirectoryEntry} */ (this.directoryModel_.getCurrentDirEntry()); + var toMove = util.isDropEffectAllowed(effectAllowed, 'move') && + (!util.isDropEffectAllowed(effectAllowed, 'copy') || + opt_effect === 'move'); + return new FileTransferController.PastePlan( + sourceURLs, destinationEntry, toMove); +}; + +/** + * Queue up a file copy operation based on the current system clipboard and + * drag-and-drop global object. * * @param {!ClipboardData} clipboardData System data transfer object. * @param {DirectoryEntry=} opt_destinationEntry Paste destination. @@ -510,20 +566,24 @@ * |clipboardData.effectAllowed|. * @return {string} Either "copy" or "move". */ -FileTransferController.prototype.paste = - function(clipboardData, opt_destinationEntry, opt_effect) { - var sourceURLs = clipboardData.getData('fs/sources') ? - clipboardData.getData('fs/sources').split('\n') : []; - // effectAllowed set in copy/paste handlers stay uninitialized. DnD handlers - // work fine. - var effectAllowed = clipboardData.effectAllowed !== 'uninitialized' ? - clipboardData.effectAllowed : clipboardData.getData('fs/effectallowed'); - var toMove = util.isDropEffectAllowed(effectAllowed, 'move') && - (!util.isDropEffectAllowed(effectAllowed, 'copy') || - opt_effect === 'move'); - var destinationEntry = - opt_destinationEntry || - /** @type {DirectoryEntry} */ (this.directoryModel_.getCurrentDirEntry()); +FileTransferController.prototype.paste = function( + clipboardData, opt_destinationEntry, opt_effect) { + var pastePlan = + this.preparePaste(clipboardData, opt_destinationEntry, opt_effect); + return this.executePaste(pastePlan); +}; + +/** + * Queue up a file copy operation. + * + * @param {FileTransferController.PastePlan} pastePlan + * @return {string} Either "copy" or "move". + */ +FileTransferController.prototype.executePaste = function(pastePlan) { + var sourceURLs = pastePlan.sourceURLs; + var toMove = pastePlan.isMove; + var destinationEntry = pastePlan.destinationEntry; + var entries = []; var failureUrls; var shareEntries; @@ -828,7 +888,8 @@ var entry = this.destinationEntry_; if (!entry && !onlyIntoDirectories) entry = this.directoryModel_.getCurrentDirEntry(); - var effectAndLabel = this.selectDropEffect_(event, entry); + var effectAndLabel = + this.selectDropEffect_(event, this.getDragAndDropGlobalData_(), entry); event.dataTransfer.dropEffect = effectAndLabel.getDropEffect(); event.preventDefault(); var label = effectAndLabel.getLabel(); @@ -927,9 +988,12 @@ if (!this.canPasteOrDrop_(event.dataTransfer, destinationEntry)) return; event.preventDefault(); - this.paste(event.dataTransfer, - /** @type {DirectoryEntry} */ (destinationEntry), - this.selectDropEffect_(event, destinationEntry).getDropEffect()); + this.paste( + event.dataTransfer, + /** @type {DirectoryEntry} */ (destinationEntry), + this.selectDropEffect_( + event, this.getDragAndDropGlobalData_(), destinationEntry) + .getDropEffect()); this.clearDropTarget_(); }; @@ -1204,8 +1268,9 @@ return false; // Unsupported type of content. // Copying between different sources requires all files to be available. - if (this.getSourceRootURL_(clipboardData) !== - destinationLocationInfo.volumeInfo.fileSystem.root.toURL() && + if (this.getSourceRootURL_( + clipboardData, this.getDragAndDropGlobalData_()) !== + destinationLocationInfo.volumeInfo.fileSystem.root.toURL() && this.isMissingFileContents_(clipboardData)) return false; @@ -1321,6 +1386,8 @@ /** * @param {!Event} event Drag event. + * @param {Object<string>} dragAndDropData drag & drop data from + * getDragAndDropGlobalData_(). * @param {DirectoryEntry|FakeEntry} destinationEntry Destination entry. * @return {DropEffectAndLabel} Returns the appropriate drop query type * ('none', 'move' or copy') to the current modifiers status and the @@ -1328,8 +1395,8 @@ * not allowed. * @private */ -FileTransferController.prototype.selectDropEffect_ = - function(event, destinationEntry) { +FileTransferController.prototype.selectDropEffect_ = function( + event, dragAndDropData, destinationEntry) { if (!destinationEntry) return new DropEffectAndLabel(DropEffectType.NONE, null); var destinationLocationInfo = @@ -1359,7 +1426,7 @@ return new DropEffectAndLabel(DropEffectType.MOVE, null); // TODO(mtomasz): Use volumeId instead of comparing roots, as soon as // volumeId gets unique. - if (this.getSourceRootURL_(event.dataTransfer) === + if (this.getSourceRootURL_(event.dataTransfer, dragAndDropData) === destinationLocationInfo.volumeInfo.fileSystem.root.toURL() && !event.ctrlKey) { return new DropEffectAndLabel(DropEffectType.MOVE, null);
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 09c44ee..b1f2574c 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -364,18 +364,11 @@ if (!view_for_activation) { view_for_activation = GetWidget()->GetRootView(); } else if (view_for_activation == focus_manager->GetStoredFocusView()) { - // When desktop native widget has modal transient child, we don't - // restore focused view here, as the modal transient child window will - // get activated and focused. Thus, we are not left with multiple - // focuses. For aura child widgets, since their views are managed by - // |focus_manager|, we then allow restoring focused view. - if (!wm::GetModalTransient(GetWidget()->GetNativeView())) { - focus_manager->RestoreFocusedView(); - // Set to false if desktop native widget has activated activation - // change, so that aura window activation change focus restore - // operation can be ignored. - restore_focus_on_activate_ = false; - } + focus_manager->RestoreFocusedView(); + // Set to false if desktop native widget has activated activation + // change, so that aura window activation change focus restore operation + // can be ignored. + restore_focus_on_activate_ = false; } activation_client->ActivateWindow( view_for_activation->GetWidget()->GetNativeView());
diff --git a/ui/views/widget/widget_interactive_uitest.cc b/ui/views/widget/widget_interactive_uitest.cc index 0e20f33..a1e82b4 100644 --- a/ui/views/widget/widget_interactive_uitest.cc +++ b/ui/views/widget/widget_interactive_uitest.cc
@@ -1271,52 +1271,6 @@ widget->CloseNow(); } -#if defined(USE_AURA) && !defined(OS_CHROMEOS) -// Tests that when a desktop native widget has modal transient child, it should -// avoid restore focused view itself as the modal transient child window will do -// that, thus avoids having multiple focused view visually (crbug.com/727641). -TEST_F(WidgetTestInteractive, DesktopNativeWidgetWithModalTransientChild) { - // Create a top level desktop native widget. - Widget* top_level = CreateWidget(); - - Textfield* textfield = new Textfield; - textfield->SetBounds(0, 0, 200, 20); - top_level->GetRootView()->AddChildView(textfield); - ShowSync(top_level); - textfield->RequestFocus(); - EXPECT_TRUE(textfield->HasFocus()); - - // Create a modal dialog. - // This instance will be destroyed when the dialog is destroyed. - ModalDialogDelegate* dialog_delegate = - new ModalDialogDelegate(ui::MODAL_TYPE_WINDOW); - Widget* modal_dialog_widget = DialogDelegate::CreateDialogWidget( - dialog_delegate, nullptr, top_level->GetNativeView()); - modal_dialog_widget->SetBounds(gfx::Rect(0, 0, 100, 10)); - Textfield* dialog_textfield = new Textfield; - dialog_textfield->SetBounds(0, 0, 50, 5); - modal_dialog_widget->GetRootView()->AddChildView(dialog_textfield); - // Dialog widget doesn't need a ShowSync as it gains active status - // synchronously. - modal_dialog_widget->Show(); - dialog_textfield->RequestFocus(); - EXPECT_TRUE(dialog_textfield->HasFocus()); - EXPECT_FALSE(textfield->HasFocus()); - - DeactivateSync(top_level); - EXPECT_FALSE(dialog_textfield->HasFocus()); - EXPECT_FALSE(textfield->HasFocus()); - - // After deactivation and activation of top level widget, only modal dialog - // should restore focused view. - ActivateSync(top_level); - EXPECT_TRUE(dialog_textfield->HasFocus()); - EXPECT_FALSE(textfield->HasFocus()); - - top_level->CloseNow(); -} -#endif // defined(USE_AURA) && !defined(OS_CHROMEOS) - namespace { // Helper class for CaptureLostTrackingWidget to store whether