diff --git a/DEPS b/DEPS index aafd160..9ad3259 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': '6bdbb1f107c74e442f7ce11d281643c1632ababa', + 'v8_revision': '19769c12f2a6390893ccfc0a03a4784cebe7b180', # 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.
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index cd0ac9c..5e7c7b97 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -628,6 +628,9 @@ </message> <!-- Status tray screen share strings. --> + <message name="IDS_ASH_STATUS_TRAY_SCREEN_SHARE_TITLE" desc="The title for screen sharing notification"> + You are sharing your screen + </message> <message name="IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP" desc="label used for screen sharing stop button"> Stop </message>
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index d4e7466f..68506d0 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -80,6 +80,8 @@ "notification_feedback_button.icon", "notification_low_power_battery.icon", "notification_screen.icon", + "notification_screenshare.1x.icon", + "notification_screenshare.icon", "notification_settings.icon", "notification_timer.icon", "palette_action_capture_region.1x.icon",
diff --git a/ash/resources/vector_icons/notification_screenshare.1x.icon b/ash/resources/vector_icons/notification_screenshare.1x.icon new file mode 100644 index 0000000..945b8b71 --- /dev/null +++ b/ash/resources/vector_icons/notification_screenshare.1x.icon
@@ -0,0 +1,30 @@ +// 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. + +CANVAS_DIMENSIONS, 18, +MOVE_TO, 2.5f, 3, +R_H_LINE_TO, 13.01f, +CUBIC_TO, 16.33f, 3, 17, 3.69f, 17, 4.52f, +R_V_LINE_TO, 9.14f, +R_CUBIC_TO, 0, 0.84f, -0.67f, 1.34f, -1.49f, 1.34f, +H_LINE_TO, 2.5f, +CUBIC_TO, 1.67f, 15, 1, 14.34f, 1, 13.5f, +V_LINE_TO, 4.52f, +CUBIC_TO, 1, 3.69f, 1.67f, 3, 2.5f, 3, +CLOSE, +MOVE_TO, 2, 14, +R_H_LINE_TO, 14, +V_LINE_TO, 4, +H_LINE_TO, 2, +R_V_LINE_TO, 10, +CLOSE, +R_MOVE_TO, 8.09f, -4.08f, +R_CUBIC_TO, -2.35f, -0.04f, -4.01f, 0.45f, -5.09f, 1.74f, +R_CUBIC_TO, 0.43f, -1.85f, 1.88f, -3.59f, 5.09f, -3.59f, +V_LINE_TO, 6, +LINE_TO, 13, 9, +R_LINE_TO, -2.91f, 3, +V_LINE_TO, 9.92f, +CLOSE, +END
diff --git a/ash/resources/vector_icons/notification_screenshare.icon b/ash/resources/vector_icons/notification_screenshare.icon new file mode 100644 index 0000000..64e30fbf --- /dev/null +++ b/ash/resources/vector_icons/notification_screenshare.icon
@@ -0,0 +1,30 @@ +// 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. + +CANVAS_DIMENSIONS, 36, +MOVE_TO, 4.99f, 6, +R_H_LINE_TO, 26.02f, +CUBIC_TO, 32.66f, 6, 34, 7.37f, 34, 9.05f, +R_V_LINE_TO, 18.28f, +CUBIC_TO, 34, 29, 32.66f, 30, 31.01f, 30, +H_LINE_TO, 4.99f, +CUBIC_TO, 3.35f, 30, 2, 28.68f, 2, 27, +V_LINE_TO, 9.05f, +CUBIC_TO, 2, 7.37f, 3.35f, 6, 4.99f, 6, +CLOSE, +MOVE_TO, 4, 28, +R_H_LINE_TO, 28, +V_LINE_TO, 8, +H_LINE_TO, 4, +R_V_LINE_TO, 20, +CLOSE, +R_MOVE_TO, 16.18f, -8.15f, +R_CUBIC_TO, -4.7f, -0.07f, -8.02f, 0.9f, -10.18f, 3.49f, +R_CUBIC_TO, 0.87f, -3.7f, 3.76f, -7.17f, 10.18f, -7.18f, +V_LINE_TO, 12, +LINE_TO, 26, 18, +R_LINE_TO, -5.82f, 6, +R_V_LINE_TO, -4.15f, +CLOSE, +END
diff --git a/ash/system/screen_security/screen_share_tray_item.cc b/ash/system/screen_security/screen_share_tray_item.cc index b0f094d2..7c38f92 100644 --- a/ash/system/screen_security/screen_share_tray_item.cc +++ b/ash/system/screen_security/screen_share_tray_item.cc
@@ -7,6 +7,7 @@ #include <utility> #include "ash/resources/grit/ash_resources.h" +#include "ash/resources/vector_icons/vector_icons.h" #include "ash/shell.h" #include "ash/strings/grit/ash_strings.h" #include "ash/system/system_notifier.h" @@ -15,7 +16,9 @@ #include "ui/base/resource/resource_bundle.h" #include "ui/message_center/message_center.h" #include "ui/message_center/notification.h" +#include "ui/message_center/public/cpp/message_center_switches.h" +using message_center::MessageCenter; using message_center::Notification; namespace ash { @@ -55,14 +58,24 @@ data.buttons.push_back(message_center::ButtonInfo( l10n_util::GetStringUTF16(IDS_ASH_STATUS_TRAY_SCREEN_SHARE_STOP))); ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); - std::unique_ptr<Notification> notification(new Notification( - message_center::NOTIFICATION_TYPE_SIMPLE, kScreenShareNotificationId, - help_label_text, base::string16() /* body is blank */, - resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), - base::string16() /* display_source */, GURL(), - message_center::NotifierId(message_center::NotifierId::SYSTEM_COMPONENT, - system_notifier::kNotifierScreenShare), - data, new tray::ScreenNotificationDelegate(this))); + std::unique_ptr<Notification> notification = + system_notifier::CreateSystemNotification( + message_center::NOTIFICATION_TYPE_SIMPLE, kScreenShareNotificationId, + message_center::IsNewStyleNotificationEnabled() + ? l10n_util::GetStringUTF16( + IDS_ASH_STATUS_TRAY_SCREEN_SHARE_TITLE) + : help_label_text, + message_center::IsNewStyleNotificationEnabled() + ? help_label_text + : base::string16() /* body is blank */, + resource_bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SCREENSHARE_DARK), + base::string16() /* display_source */, GURL(), + message_center::NotifierId( + message_center::NotifierId::SYSTEM_COMPONENT, + system_notifier::kNotifierScreenShare), + data, new tray::ScreenNotificationDelegate(this), + kNotificationScreenshareIcon, + message_center::SystemNotificationWarningLevel::NORMAL); notification->SetSystemPriority(); message_center::MessageCenter::Get()->AddNotification( std::move(notification));
diff --git a/base/deferred_sequenced_task_runner.cc b/base/deferred_sequenced_task_runner.cc index 93f6ad7e..21cb99a6 100644 --- a/base/deferred_sequenced_task_runner.cc +++ b/base/deferred_sequenced_task_runner.cc
@@ -32,10 +32,9 @@ DeferredSequencedTaskRunner::~DeferredSequencedTaskRunner() { } -bool DeferredSequencedTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay) { +bool DeferredSequencedTaskRunner::PostDelayedTask(const Location& from_here, + OnceClosure task, + TimeDelta delay) { AutoLock lock(lock_); if (started_) { DCHECK(deferred_tasks_queue_.empty()); @@ -53,7 +52,7 @@ } bool DeferredSequencedTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, TimeDelta delay) { AutoLock lock(lock_); @@ -67,11 +66,10 @@ return true; } -void DeferredSequencedTaskRunner::QueueDeferredTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay, - bool is_non_nestable) { +void DeferredSequencedTaskRunner::QueueDeferredTask(const Location& from_here, + OnceClosure task, + TimeDelta delay, + bool is_non_nestable) { // Use CHECK instead of DCHECK to crash earlier. See http://crbug.com/711167 // for details. CHECK(task);
diff --git a/base/deferred_sequenced_task_runner.h b/base/deferred_sequenced_task_runner.h index e5b6d61..2beb206 100644 --- a/base/deferred_sequenced_task_runner.h +++ b/base/deferred_sequenced_task_runner.h
@@ -27,13 +27,13 @@ scoped_refptr<SequencedTaskRunner> target_runner); // TaskRunner implementation - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override; // SequencedTaskRunner implementation - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; @@ -50,7 +50,7 @@ ~DeferredTask(); DeferredTask& operator=(DeferredTask&& other); - tracked_objects::Location posted_from; + Location posted_from; OnceClosure task; // The delay this task was initially posted with. TimeDelta delay; @@ -60,7 +60,7 @@ ~DeferredSequencedTaskRunner() override; // Creates a |Task| object and adds it to |deferred_tasks_queue_|. - void QueueDeferredTask(const tracked_objects::Location& from_here, + void QueueDeferredTask(const Location& from_here, OnceClosure task, TimeDelta delay, bool is_non_nestable);
diff --git a/base/message_loop/incoming_task_queue.cc b/base/message_loop/incoming_task_queue.cc index 90b8f22..c9045d8 100644 --- a/base/message_loop/incoming_task_queue.cc +++ b/base/message_loop/incoming_task_queue.cc
@@ -56,13 +56,15 @@ message_loop_scheduled_(false), always_schedule_work_(AlwaysNotifyPump(message_loop_->type())), is_ready_for_scheduling_(false) { + // The constructing sequence is not necessarily the running sequence in the + // case of base::Thread. + DETACH_FROM_SEQUENCE(sequence_checker_); } -bool IncomingTaskQueue::AddToIncomingQueue( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay, - bool nestable) { +bool IncomingTaskQueue::AddToIncomingQueue(const Location& from_here, + OnceClosure task, + TimeDelta delay, + bool nestable) { // Use CHECK instead of DCHECK to crash earlier. See http://crbug.com/711167 // for details. CHECK(task); @@ -139,7 +141,7 @@ } void IncomingTaskQueue::RunTask(PendingTask* pending_task) { - SEQUENCE_CHECKER(sequence_checker_); + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); task_annotator_.RunTask("MessageLoop::PostTask", pending_task); }
diff --git a/base/message_loop/incoming_task_queue.h b/base/message_loop/incoming_task_queue.h index 0427688..35e1c31 100644 --- a/base/message_loop/incoming_task_queue.h +++ b/base/message_loop/incoming_task_queue.h
@@ -37,7 +37,7 @@ // Returns true if the task was successfully added to the queue, otherwise // returns false. In all cases, the ownership of |task| is transferred to the // called method. - bool AddToIncomingQueue(const tracked_objects::Location& from_here, + bool AddToIncomingQueue(const Location& from_here, OnceClosure task, TimeDelta delay, bool nestable);
diff --git a/base/message_loop/message_loop_task_runner.cc b/base/message_loop/message_loop_task_runner.cc index c7ac583..b82a4f2 100644 --- a/base/message_loop/message_loop_task_runner.cc +++ b/base/message_loop/message_loop_task_runner.cc
@@ -24,17 +24,16 @@ valid_thread_id_ = PlatformThread::CurrentId(); } -bool MessageLoopTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - base::TimeDelta delay) { +bool MessageLoopTaskRunner::PostDelayedTask(const Location& from_here, + OnceClosure task, + base::TimeDelta delay) { DCHECK(!task.is_null()) << from_here.ToString(); return incoming_queue_->AddToIncomingQueue(from_here, std::move(task), delay, true); } bool MessageLoopTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, base::TimeDelta delay) { DCHECK(!task.is_null()) << from_here.ToString();
diff --git a/base/message_loop/message_loop_task_runner.h b/base/message_loop/message_loop_task_runner.h index f3ec51f..c7d48c2 100644 --- a/base/message_loop/message_loop_task_runner.h +++ b/base/message_loop/message_loop_task_runner.h
@@ -31,12 +31,12 @@ void BindToCurrentThread(); // SingleThreadTaskRunner implementation - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, - base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + TimeDelta delay) override; + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, - base::TimeDelta delay) override; + TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override; private:
diff --git a/base/message_loop/message_pump_fuchsia.cc b/base/message_loop/message_pump_fuchsia.cc index 7ba06865d..1d06b4f 100644 --- a/base/message_loop/message_pump_fuchsia.cc +++ b/base/message_loop/message_pump_fuchsia.cc
@@ -13,7 +13,7 @@ namespace base { MessagePumpFuchsia::MxHandleWatchController::MxHandleWatchController( - const tracked_objects::Location& from_here) + const Location& from_here) : created_from_location_(from_here) {} MessagePumpFuchsia::MxHandleWatchController::~MxHandleWatchController() { @@ -70,7 +70,7 @@ } MessagePumpFuchsia::FdWatchController::FdWatchController( - const tracked_objects::Location& from_here) + const Location& from_here) : MxHandleWatchController(from_here) {} MessagePumpFuchsia::FdWatchController::~FdWatchController() {
diff --git a/base/message_loop/message_pump_fuchsia.h b/base/message_loop/message_pump_fuchsia.h index 20cd022..60a8be8 100644 --- a/base/message_loop/message_pump_fuchsia.h +++ b/base/message_loop/message_pump_fuchsia.h
@@ -41,8 +41,7 @@ // Manages an active watch on an mx_handle_t. class MxHandleWatchController { public: - explicit MxHandleWatchController( - const tracked_objects::Location& from_here); + explicit MxHandleWatchController(const Location& from_here); // Deleting the Controller implicitly calls StopWatchingMxHandle. virtual ~MxHandleWatchController(); @@ -50,9 +49,7 @@ // to do. bool StopWatchingMxHandle(); - const tracked_objects::Location& created_from_location() { - return created_from_location_; - } + const Location& created_from_location() { return created_from_location_; } protected: // This bool is used by the pump when invoking the MxHandleWatcher callback, @@ -79,7 +76,7 @@ return static_cast<uint64_t>(reinterpret_cast<uintptr_t>(this)); } - const tracked_objects::Location created_from_location_; + const Location created_from_location_; // Set directly from the inputs to WatchFileDescriptor. MxHandleWatcher* watcher_ = nullptr; @@ -104,7 +101,7 @@ class FdWatchController : public MxHandleWatchController, public MxHandleWatcher { public: - explicit FdWatchController(const tracked_objects::Location& from_here); + explicit FdWatchController(const Location& from_here); ~FdWatchController() override; bool StopWatchingFileDescriptor();
diff --git a/base/message_loop/message_pump_glib_unittest.cc b/base/message_loop/message_pump_glib_unittest.cc index 1bfa70e9..3ac58c8 100644 --- a/base/message_loop/message_pump_glib_unittest.cc +++ b/base/message_loop/message_pump_glib_unittest.cc
@@ -152,8 +152,7 @@ } // Posts a task on the current message loop. -void PostMessageLoopTask(const tracked_objects::Location& from_here, - OnceClosure task) { +void PostMessageLoopTask(const Location& from_here, OnceClosure task) { ThreadTaskRunnerHandle::Get()->PostTask(from_here, std::move(task)); }
diff --git a/base/message_loop/message_pump_io_ios.cc b/base/message_loop/message_pump_io_ios.cc index 85cb2555..74a3f15 100644 --- a/base/message_loop/message_pump_io_ios.cc +++ b/base/message_loop/message_pump_io_ios.cc
@@ -7,7 +7,7 @@ namespace base { MessagePumpIOSForIO::FileDescriptorWatcher::FileDescriptorWatcher( - const tracked_objects::Location& from_here) + const Location& from_here) : is_persistent_(false), fdref_(NULL), callback_types_(0),
diff --git a/base/message_loop/message_pump_io_ios.h b/base/message_loop/message_pump_io_ios.h index f48e957..e842a6c 100644 --- a/base/message_loop/message_pump_io_ios.h +++ b/base/message_loop/message_pump_io_ios.h
@@ -37,7 +37,7 @@ // Object returned by WatchFileDescriptor to manage further watching. class FileDescriptorWatcher { public: - explicit FileDescriptorWatcher(const tracked_objects::Location& from_here); + explicit FileDescriptorWatcher(const Location& from_here); ~FileDescriptorWatcher(); // Implicitly calls StopWatchingFileDescriptor. // NOTE: These methods aren't called StartWatching()/StopWatching() to @@ -47,9 +47,7 @@ // to do. bool StopWatchingFileDescriptor(); - const tracked_objects::Location& created_from_location() { - return created_from_location_; - } + const Location& created_from_location() { return created_from_location_; } private: friend class MessagePumpIOSForIO; @@ -77,7 +75,7 @@ base::WeakPtr<MessagePumpIOSForIO> pump_; Watcher* watcher_; - tracked_objects::Location created_from_location_; + Location created_from_location_; DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher); };
diff --git a/base/message_loop/message_pump_libevent.cc b/base/message_loop/message_pump_libevent.cc index 14bc75c..63d85c8 100644 --- a/base/message_loop/message_pump_libevent.cc +++ b/base/message_loop/message_pump_libevent.cc
@@ -44,7 +44,7 @@ namespace base { MessagePumpLibevent::FileDescriptorWatcher::FileDescriptorWatcher( - const tracked_objects::Location& from_here) + const Location& from_here) : event_(NULL), pump_(NULL), watcher_(NULL),
diff --git a/base/message_loop/message_pump_libevent.h b/base/message_loop/message_pump_libevent.h index 1124560d..e14b584 100644 --- a/base/message_loop/message_pump_libevent.h +++ b/base/message_loop/message_pump_libevent.h
@@ -38,7 +38,7 @@ // Object returned by WatchFileDescriptor to manage further watching. class FileDescriptorWatcher { public: - explicit FileDescriptorWatcher(const tracked_objects::Location& from_here); + explicit FileDescriptorWatcher(const Location& from_here); ~FileDescriptorWatcher(); // Implicitly calls StopWatchingFileDescriptor. // NOTE: These methods aren't called StartWatching()/StopWatching() to @@ -48,9 +48,7 @@ // to do. bool StopWatchingFileDescriptor(); - const tracked_objects::Location& created_from_location() { - return created_from_location_; - } + const Location& created_from_location() { return created_from_location_; } private: friend class MessagePumpLibevent; @@ -78,7 +76,7 @@ // destructor. bool* was_destroyed_; - const tracked_objects::Location created_from_location_; + const Location created_from_location_; DISALLOW_COPY_AND_ASSIGN(FileDescriptorWatcher); };
diff --git a/base/observer_list_threadsafe.h b/base/observer_list_threadsafe.h index c107a93..fb78676 100644 --- a/base/observer_list_threadsafe.h +++ b/base/observer_list_threadsafe.h
@@ -132,8 +132,7 @@ // all Observers have been Notified. The notification may still be pending // delivery. template <typename Method, typename... Params> - void Notify(const tracked_objects::Location& from_here, - Method m, Params&&... params) { + void Notify(const Location& from_here, Method m, Params&&... params) { Callback<void(ObserverType*)> method = Bind(&internal::Dispatcher<ObserverType, Method>::Run, m, std::forward<Params>(params)...); @@ -151,11 +150,11 @@ friend class RefCountedThreadSafe<ObserverListThreadSafe<ObserverType>>; struct NotificationData { - NotificationData(const tracked_objects::Location& from_here_in, + NotificationData(const Location& from_here_in, const Callback<void(ObserverType*)>& method_in) : from_here(from_here_in), method(method_in) {} - tracked_objects::Location from_here; + Location from_here; Callback<void(ObserverType*)> method; };
diff --git a/base/pending_task.cc b/base/pending_task.cc index e96d88b..3a45885 100644 --- a/base/pending_task.cc +++ b/base/pending_task.cc
@@ -9,11 +9,10 @@ namespace base { -PendingTask::PendingTask(const tracked_objects::Location& posted_from, - OnceClosure task) +PendingTask::PendingTask(const Location& posted_from, OnceClosure task) : PendingTask(posted_from, std::move(task), TimeTicks(), true) {} -PendingTask::PendingTask(const tracked_objects::Location& posted_from, +PendingTask::PendingTask(const Location& posted_from, OnceClosure task, TimeTicks delayed_run_time, bool nestable)
diff --git a/base/pending_task.h b/base/pending_task.h index d8a87cca..75183f0a 100644 --- a/base/pending_task.h +++ b/base/pending_task.h
@@ -18,8 +18,8 @@ // Contains data about a pending task. Stored in TaskQueue and DelayedTaskQueue // for use by classes that queue and execute tasks. struct BASE_EXPORT PendingTask { - PendingTask(const tracked_objects::Location& posted_from, OnceClosure task); - PendingTask(const tracked_objects::Location& posted_from, + PendingTask(const Location& posted_from, OnceClosure task); + PendingTask(const Location& posted_from, OnceClosure task, TimeTicks delayed_run_time, bool nestable); @@ -35,7 +35,7 @@ OnceClosure task; // The site this PendingTask was posted from. - tracked_objects::Location posted_from; + Location posted_from; // The time when the task should be run. base::TimeTicks delayed_run_time;
diff --git a/base/pending_task_unittest.cc b/base/pending_task_unittest.cc index 8d52daa9..5c9a122 100644 --- a/base/pending_task_unittest.cc +++ b/base/pending_task_unittest.cc
@@ -24,12 +24,11 @@ protected: using ExpectedTrace = std::vector<const void*>; - static void VerifyTraceAndPost( - const scoped_refptr<TaskRunner>& task_runner, - const tracked_objects::Location& posted_from, - const tracked_objects::Location& next_from_here, - const std::vector<const void*>& expected_trace, - Closure task) { + static void VerifyTraceAndPost(const scoped_refptr<TaskRunner>& task_runner, + const Location& posted_from, + const Location& next_from_here, + const std::vector<const void*>& expected_trace, + Closure task) { SCOPED_TRACE(StringPrintf("Callback Depth: %zu", expected_trace.size())); // Beyond depth + 1, the trace is nonsensical because there haven't been @@ -57,12 +56,12 @@ // Ensure the task backtrace populates correctly. TEST_F(PendingTaskTest, SingleThreadedSimple) { MessageLoop loop; - const tracked_objects::Location& location0 = FROM_HERE; - const tracked_objects::Location& location1 = FROM_HERE; - const tracked_objects::Location& location2 = FROM_HERE; - const tracked_objects::Location& location3 = FROM_HERE; - const tracked_objects::Location& location4 = FROM_HERE; - const tracked_objects::Location& location5 = FROM_HERE; + const Location& location0 = FROM_HERE; + const Location& location1 = FROM_HERE; + const Location& location2 = FROM_HERE; + const Location& location3 = FROM_HERE; + const Location& location4 = FROM_HERE; + const Location& location5 = FROM_HERE; Closure task5 = Bind( &PendingTaskTest::VerifyTraceAndPost, loop.task_runner(), location4, @@ -101,15 +100,15 @@ thread_b.StartAndWaitForTesting(); thread_c.StartAndWaitForTesting(); - const tracked_objects::Location& location_a0 = FROM_HERE; - const tracked_objects::Location& location_a1 = FROM_HERE; - const tracked_objects::Location& location_a2 = FROM_HERE; - const tracked_objects::Location& location_a3 = FROM_HERE; + const Location& location_a0 = FROM_HERE; + const Location& location_a1 = FROM_HERE; + const Location& location_a2 = FROM_HERE; + const Location& location_a3 = FROM_HERE; - const tracked_objects::Location& location_b0 = FROM_HERE; - const tracked_objects::Location& location_b1 = FROM_HERE; + const Location& location_b0 = FROM_HERE; + const Location& location_b1 = FROM_HERE; - const tracked_objects::Location& location_c0 = FROM_HERE; + const Location& location_c0 = FROM_HERE; // On thread c, post a task back to thread a that verifies its trace // and terminates after one more self-post.
diff --git a/base/run_loop_unittest.cc b/base/run_loop_unittest.cc index 4f14b910..176c29f 100644 --- a/base/run_loop_unittest.cc +++ b/base/run_loop_unittest.cc
@@ -67,7 +67,7 @@ public: SimpleSingleThreadTaskRunner() = default; - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, base::TimeDelta delay) override { if (delay > base::TimeDelta()) @@ -77,7 +77,7 @@ return true; } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, base::TimeDelta delay) override { return PostDelayedTask(from_here, std::move(task), delay);
diff --git a/base/sequenced_task_runner.cc b/base/sequenced_task_runner.cc index ff859c8..4f36dc4 100644 --- a/base/sequenced_task_runner.cc +++ b/base/sequenced_task_runner.cc
@@ -10,15 +10,14 @@ namespace base { -bool SequencedTaskRunner::PostNonNestableTask( - const tracked_objects::Location& from_here, - OnceClosure task) { +bool SequencedTaskRunner::PostNonNestableTask(const Location& from_here, + OnceClosure task) { return PostNonNestableDelayedTask(from_here, std::move(task), base::TimeDelta()); } bool SequencedTaskRunner::DeleteOrReleaseSoonInternal( - const tracked_objects::Location& from_here, + const Location& from_here, void (*deleter)(const void*), const void* object) { return PostNonNestableTask(from_here, BindOnce(deleter, object));
diff --git a/base/sequenced_task_runner.h b/base/sequenced_task_runner.h index fa768fb2..dde1350 100644 --- a/base/sequenced_task_runner.h +++ b/base/sequenced_task_runner.h
@@ -111,27 +111,23 @@ // TODO(akalin): Get rid of the boolean return value for the methods // below. - bool PostNonNestableTask(const tracked_objects::Location& from_here, - OnceClosure task); + bool PostNonNestableTask(const Location& from_here, OnceClosure task); - virtual bool PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - base::TimeDelta delay) = 0; + virtual bool PostNonNestableDelayedTask(const Location& from_here, + OnceClosure task, + base::TimeDelta delay) = 0; // Submits a non-nestable task to delete the given object. Returns // true if the object may be deleted at some point in the future, // and false if the object definitely will not be deleted. template <class T> - bool DeleteSoon(const tracked_objects::Location& from_here, - const T* object) { + bool DeleteSoon(const Location& from_here, const T* object) { return DeleteOrReleaseSoonInternal(from_here, &DeleteHelper<T>::DoDelete, object); } template <class T> - bool DeleteSoon(const tracked_objects::Location& from_here, - std::unique_ptr<T> object) { + bool DeleteSoon(const Location& from_here, std::unique_ptr<T> object) { return DeleteSoon(from_here, object.release()); } @@ -139,8 +135,7 @@ // true if the object may be released at some point in the future, // and false if the object definitely will not be released. template <class T> - bool ReleaseSoon(const tracked_objects::Location& from_here, - const T* object) { + bool ReleaseSoon(const Location& from_here, const T* object) { return DeleteOrReleaseSoonInternal(from_here, &ReleaseHelper<T>::DoRelease, object); } @@ -149,7 +144,7 @@ ~SequencedTaskRunner() override {} private: - bool DeleteOrReleaseSoonInternal(const tracked_objects::Location& from_here, + bool DeleteOrReleaseSoonInternal(const Location& from_here, void (*deleter)(const void*), const void* object); };
diff --git a/base/task/cancelable_task_tracker.cc b/base/task/cancelable_task_tracker.cc index 1b45bcf..864117c 100644 --- a/base/task/cancelable_task_tracker.cc +++ b/base/task/cancelable_task_tracker.cc
@@ -64,7 +64,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::PostTask( TaskRunner* task_runner, - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task) { DCHECK(sequence_checker_.CalledOnValidSequence()); @@ -74,7 +74,7 @@ CancelableTaskTracker::TaskId CancelableTaskTracker::PostTaskAndReply( TaskRunner* task_runner, - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, OnceClosure reply) { DCHECK(sequence_checker_.CalledOnValidSequence());
diff --git a/base/task/cancelable_task_tracker_unittest.cc b/base/task/cancelable_task_tracker_unittest.cc index 19429df..b73c624 100644 --- a/base/task/cancelable_task_tracker_unittest.cc +++ b/base/task/cancelable_task_tracker_unittest.cc
@@ -40,12 +40,12 @@ MessageLoop message_loop_; }; -void AddFailureAt(const tracked_objects::Location& location) { +void AddFailureAt(const Location& location) { ADD_FAILURE_AT(location.file_name(), location.line_number()); } // Returns a closure that fails if run. -Closure MakeExpectedNotRunClosure(const tracked_objects::Location& location) { +Closure MakeExpectedNotRunClosure(const Location& location) { return Bind(&AddFailureAt, location); } @@ -55,7 +55,7 @@ // before destruction. class RunChecker { public: - explicit RunChecker(const tracked_objects::Location& location) + explicit RunChecker(const Location& location) : location_(location), called_(false) {} ~RunChecker() { @@ -67,12 +67,12 @@ void Run() { called_ = true; } private: - tracked_objects::Location location_; + Location location_; bool called_; }; // Returns a closure that fails on destruction if it hasn't been run. -Closure MakeExpectedRunClosure(const tracked_objects::Location& location) { +Closure MakeExpectedRunClosure(const Location& location) { return Bind(&RunChecker::Run, Owned(new RunChecker(location))); }
diff --git a/base/task_runner.cc b/base/task_runner.cc index c3e0574..bbba7028 100644 --- a/base/task_runner.cc +++ b/base/task_runner.cc
@@ -22,8 +22,7 @@ explicit PostTaskAndReplyTaskRunner(TaskRunner* destination); private: - bool PostTask(const tracked_objects::Location& from_here, - OnceClosure task) override; + bool PostTask(const Location& from_here, OnceClosure task) override; // Non-owning. TaskRunner* destination_; @@ -34,20 +33,18 @@ DCHECK(destination_); } -bool PostTaskAndReplyTaskRunner::PostTask( - const tracked_objects::Location& from_here, - OnceClosure task) { +bool PostTaskAndReplyTaskRunner::PostTask(const Location& from_here, + OnceClosure task) { return destination_->PostTask(from_here, std::move(task)); } } // namespace -bool TaskRunner::PostTask(const tracked_objects::Location& from_here, - OnceClosure task) { +bool TaskRunner::PostTask(const Location& from_here, OnceClosure task) { return PostDelayedTask(from_here, std::move(task), base::TimeDelta()); } -bool TaskRunner::PostTaskAndReply(const tracked_objects::Location& from_here, +bool TaskRunner::PostTaskAndReply(const Location& from_here, OnceClosure task, OnceClosure reply) { return PostTaskAndReplyTaskRunner(this).PostTaskAndReply(
diff --git a/base/task_runner.h b/base/task_runner.h index 468e7e6..e4c6b41 100644 --- a/base/task_runner.h +++ b/base/task_runner.h
@@ -61,12 +61,12 @@ // will not be run. // // Equivalent to PostDelayedTask(from_here, task, 0). - bool PostTask(const tracked_objects::Location& from_here, OnceClosure task); + bool PostTask(const Location& from_here, OnceClosure task); // Like PostTask, but tries to run the posted task only after |delay_ms| // has passed. Implementations should use a tick clock, rather than wall- // clock time, to implement |delay|. - virtual bool PostDelayedTask(const tracked_objects::Location& from_here, + virtual bool PostDelayedTask(const Location& from_here, OnceClosure task, base::TimeDelta delay) = 0; @@ -129,7 +129,7 @@ // * The DataLoader object can be deleted while |task| is still running, // and the reply will cancel itself safely because it is bound to a // WeakPtr<>. - bool PostTaskAndReply(const tracked_objects::Location& from_here, + bool PostTaskAndReply(const Location& from_here, OnceClosure task, OnceClosure reply);
diff --git a/base/task_runner_util.h b/base/task_runner_util.h index e046f453..d79f5b85 100644 --- a/base/task_runner_util.h +++ b/base/task_runner_util.h
@@ -32,7 +32,7 @@ // BindOnce(&Callback)); template <typename TaskReturnType, typename ReplyArgType> bool PostTaskAndReplyWithResult(TaskRunner* task_runner, - const tracked_objects::Location& from_here, + const Location& from_here, OnceCallback<TaskReturnType()> task, OnceCallback<void(ReplyArgType)> reply) { DCHECK(task); @@ -54,7 +54,7 @@ // OnceCallback. template <typename TaskReturnType, typename ReplyArgType> bool PostTaskAndReplyWithResult(TaskRunner* task_runner, - const tracked_objects::Location& from_here, + const Location& from_here, Callback<TaskReturnType()> task, Callback<void(ReplyArgType)> reply) { return PostTaskAndReplyWithResult(
diff --git a/base/task_scheduler/post_task.cc b/base/task_scheduler/post_task.cc index ab7c1e5..9c297b8 100644 --- a/base/task_scheduler/post_task.cc +++ b/base/task_scheduler/post_task.cc
@@ -21,8 +21,7 @@ : traits_(traits) {} private: - bool PostTask(const tracked_objects::Location& from_here, - OnceClosure task) override { + bool PostTask(const Location& from_here, OnceClosure task) override { PostTaskWithTraits(from_here, traits_, std::move(task)); return true; } @@ -42,30 +41,30 @@ } // namespace -void PostTask(const tracked_objects::Location& from_here, OnceClosure task) { +void PostTask(const Location& from_here, OnceClosure task) { PostDelayedTask(from_here, std::move(task), TimeDelta()); } -void PostDelayedTask(const tracked_objects::Location& from_here, +void PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) { PostDelayedTaskWithTraits(from_here, TaskTraits(), std::move(task), delay); } -void PostTaskAndReply(const tracked_objects::Location& from_here, +void PostTaskAndReply(const Location& from_here, OnceClosure task, OnceClosure reply) { PostTaskWithTraitsAndReply(from_here, TaskTraits(), std::move(task), std::move(reply)); } -void PostTaskWithTraits(const tracked_objects::Location& from_here, +void PostTaskWithTraits(const Location& from_here, const TaskTraits& traits, OnceClosure task) { PostDelayedTaskWithTraits(from_here, traits, std::move(task), TimeDelta()); } -void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here, +void PostDelayedTaskWithTraits(const Location& from_here, const TaskTraits& traits, OnceClosure task, TimeDelta delay) { @@ -78,7 +77,7 @@ std::move(delay)); } -void PostTaskWithTraitsAndReply(const tracked_objects::Location& from_here, +void PostTaskWithTraitsAndReply(const Location& from_here, const TaskTraits& traits, OnceClosure task, OnceClosure reply) {
diff --git a/base/task_scheduler/post_task.h b/base/task_scheduler/post_task.h index 425e28c8..d757c85 100644 --- a/base/task_scheduler/post_task.h +++ b/base/task_scheduler/post_task.h
@@ -70,8 +70,7 @@ // Posts |task| to the TaskScheduler. Calling this is equivalent to calling // PostTaskWithTraits with plain TaskTraits. -BASE_EXPORT void PostTask(const tracked_objects::Location& from_here, - OnceClosure task); +BASE_EXPORT void PostTask(const Location& from_here, OnceClosure task); // Posts |task| to the TaskScheduler. |task| will not run before |delay| // expires. Calling this is equivalent to calling PostDelayedTaskWithTraits with @@ -79,7 +78,7 @@ // // Use PostDelayedTaskWithTraits to specify a BACKGROUND priority if the task // doesn't have to run as soon as |delay| expires. -BASE_EXPORT void PostDelayedTask(const tracked_objects::Location& from_here, +BASE_EXPORT void PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay); @@ -88,7 +87,7 @@ // |task| completes. Calling this is equivalent to calling // PostTaskWithTraitsAndReply with plain TaskTraits. Can only be called when // SequencedTaskRunnerHandle::IsSet(). -BASE_EXPORT void PostTaskAndReply(const tracked_objects::Location& from_here, +BASE_EXPORT void PostTaskAndReply(const Location& from_here, OnceClosure task, OnceClosure reply); @@ -98,7 +97,7 @@ // is equivalent to calling PostTaskWithTraitsAndReplyWithResult with plain // TaskTraits. Can only be called when SequencedTaskRunnerHandle::IsSet(). template <typename TaskReturnType, typename ReplyArgType> -void PostTaskAndReplyWithResult(const tracked_objects::Location& from_here, +void PostTaskAndReplyWithResult(const Location& from_here, OnceCallback<TaskReturnType()> task, OnceCallback<void(ReplyArgType)> reply) { PostTaskWithTraitsAndReplyWithResult(from_here, TaskTraits(), std::move(task), @@ -111,7 +110,7 @@ // overload resolution. // TODO(tzik): Update all callers of the Callback version to use OnceCallback. template <typename TaskReturnType, typename ReplyArgType> -void PostTaskAndReplyWithResult(const tracked_objects::Location& from_here, +void PostTaskAndReplyWithResult(const Location& from_here, Callback<TaskReturnType()> task, Callback<void(ReplyArgType)> reply) { PostTaskAndReplyWithResult( @@ -120,7 +119,7 @@ } // Posts |task| with specific |traits| to the TaskScheduler. -BASE_EXPORT void PostTaskWithTraits(const tracked_objects::Location& from_here, +BASE_EXPORT void PostTaskWithTraits(const Location& from_here, const TaskTraits& traits, OnceClosure task); @@ -129,21 +128,19 @@ // // Specify a BACKGROUND priority via |traits| if the task doesn't have to run as // soon as |delay| expires. -BASE_EXPORT void PostDelayedTaskWithTraits( - const tracked_objects::Location& from_here, - const TaskTraits& traits, - OnceClosure task, - TimeDelta delay); +BASE_EXPORT void PostDelayedTaskWithTraits(const Location& from_here, + const TaskTraits& traits, + OnceClosure task, + TimeDelta delay); // Posts |task| with specific |traits| to the TaskScheduler and posts |reply| on // the caller's execution context (i.e. same sequence or thread and same // TaskTraits if applicable) when |task| completes. Can only be called when // SequencedTaskRunnerHandle::IsSet(). -BASE_EXPORT void PostTaskWithTraitsAndReply( - const tracked_objects::Location& from_here, - const TaskTraits& traits, - OnceClosure task, - OnceClosure reply); +BASE_EXPORT void PostTaskWithTraitsAndReply(const Location& from_here, + const TaskTraits& traits, + OnceClosure task, + OnceClosure reply); // Posts |task| with specific |traits| to the TaskScheduler and posts |reply| // with the return value of |task| as argument on the caller's execution context @@ -151,7 +148,7 @@ // completes. Can only be called when SequencedTaskRunnerHandle::IsSet(). template <typename TaskReturnType, typename ReplyArgType> void PostTaskWithTraitsAndReplyWithResult( - const tracked_objects::Location& from_here, + const Location& from_here, const TaskTraits& traits, OnceCallback<TaskReturnType()> task, OnceCallback<void(ReplyArgType)> reply) { @@ -170,11 +167,10 @@ // overload resolution. // TODO(tzik): Update all callers of the Callback version to use OnceCallback. template <typename TaskReturnType, typename ReplyArgType> -void PostTaskWithTraitsAndReplyWithResult( - const tracked_objects::Location& from_here, - const TaskTraits& traits, - Callback<TaskReturnType()> task, - Callback<void(ReplyArgType)> reply) { +void PostTaskWithTraitsAndReplyWithResult(const Location& from_here, + const TaskTraits& traits, + Callback<TaskReturnType()> task, + Callback<void(ReplyArgType)> reply) { PostTaskWithTraitsAndReplyWithResult( from_here, traits, OnceCallback<TaskReturnType()>(std::move(task)), OnceCallback<void(ReplyArgType)>(std::move(reply)));
diff --git a/base/task_scheduler/scheduler_single_thread_task_runner_manager.cc b/base/task_scheduler/scheduler_single_thread_task_runner_manager.cc index b762839..39e45a705 100644 --- a/base/task_scheduler/scheduler_single_thread_task_runner_manager.cc +++ b/base/task_scheduler/scheduler_single_thread_task_runner_manager.cc
@@ -255,7 +255,7 @@ } // SingleThreadTaskRunner: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure closure, TimeDelta delay) override { auto task = @@ -276,7 +276,7 @@ return true; } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure closure, TimeDelta delay) override { // Tasks are never nested within the task scheduler.
diff --git a/base/task_scheduler/scheduler_worker_pool.cc b/base/task_scheduler/scheduler_worker_pool.cc index 97ed343..50e1985 100644 --- a/base/task_scheduler/scheduler_worker_pool.cc +++ b/base/task_scheduler/scheduler_worker_pool.cc
@@ -39,7 +39,7 @@ } // TaskRunner: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure closure, TimeDelta delay) override { // Post the task as part of a one-off single-task Sequence. @@ -74,7 +74,7 @@ } // SequencedTaskRunner: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure closure, TimeDelta delay) override { std::unique_ptr<Task> task = @@ -85,7 +85,7 @@ return worker_pool_->PostTaskWithSequence(std::move(task), sequence_); } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure closure, base::TimeDelta delay) override { // Tasks are never nested within the task scheduler.
diff --git a/base/task_scheduler/task.cc b/base/task_scheduler/task.cc index 18b9d0d..a2cf797 100644 --- a/base/task_scheduler/task.cc +++ b/base/task_scheduler/task.cc
@@ -11,7 +11,7 @@ namespace base { namespace internal { -Task::Task(const tracked_objects::Location& posted_from, +Task::Task(const Location& posted_from, OnceClosure task, const TaskTraits& traits, TimeDelta delay)
diff --git a/base/task_scheduler/task.h b/base/task_scheduler/task.h index 061bb62..5e7407224 100644 --- a/base/task_scheduler/task.h +++ b/base/task_scheduler/task.h
@@ -27,7 +27,7 @@ // must expire before the Task runs. If |delay| is non-zero and the shutdown // behavior in |traits| is BLOCK_SHUTDOWN, the shutdown behavior is // automatically adjusted to SKIP_ON_SHUTDOWN. - Task(const tracked_objects::Location& posted_from, + Task(const Location& posted_from, OnceClosure task, const TaskTraits& traits, TimeDelta delay);
diff --git a/base/task_scheduler/task_scheduler_impl.cc b/base/task_scheduler/task_scheduler_impl.cc index 2bd793f..cde76f5a 100644 --- a/base/task_scheduler/task_scheduler_impl.cc +++ b/base/task_scheduler/task_scheduler_impl.cc
@@ -98,11 +98,10 @@ service_thread_task_runner); } -void TaskSchedulerImpl::PostDelayedTaskWithTraits( - const tracked_objects::Location& from_here, - const TaskTraits& traits, - OnceClosure task, - TimeDelta delay) { +void TaskSchedulerImpl::PostDelayedTaskWithTraits(const Location& from_here, + const TaskTraits& traits, + OnceClosure task, + TimeDelta delay) { // Post |task| as part of a one-off single-task Sequence. const TaskTraits new_traits = SetUserBlockingPriorityIfNeeded(traits); GetWorkerPoolForTraits(new_traits)
diff --git a/base/task_scheduler/task_scheduler_impl.h b/base/task_scheduler/task_scheduler_impl.h index c22de25..2714989 100644 --- a/base/task_scheduler/task_scheduler_impl.h +++ b/base/task_scheduler/task_scheduler_impl.h
@@ -60,7 +60,7 @@ // TaskScheduler: void Start(const TaskScheduler::InitParams& init_params) override; - void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here, + void PostDelayedTaskWithTraits(const Location& from_here, const TaskTraits& traits, OnceClosure task, TimeDelta delay) override;
diff --git a/base/test/null_task_runner.cc b/base/test/null_task_runner.cc index 000007b7..44a41a1 100644 --- a/base/test/null_task_runner.cc +++ b/base/test/null_task_runner.cc
@@ -10,16 +10,15 @@ NullTaskRunner::~NullTaskRunner() {} -bool NullTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here, +bool NullTaskRunner::PostDelayedTask(const Location& from_here, OnceClosure task, base::TimeDelta delay) { return false; } -bool NullTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - base::TimeDelta delay) { +bool NullTaskRunner::PostNonNestableDelayedTask(const Location& from_here, + OnceClosure task, + base::TimeDelta delay) { return false; }
diff --git a/base/test/null_task_runner.h b/base/test/null_task_runner.h index 4c60177..c11ab6b0 100644 --- a/base/test/null_task_runner.h +++ b/base/test/null_task_runner.h
@@ -19,10 +19,10 @@ public: NullTaskRunner(); - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; // Always returns true to avoid triggering DCHECKs.
diff --git a/base/test/test_io_thread.cc b/base/test/test_io_thread.cc index c69a269..be82afb 100644 --- a/base/test/test_io_thread.cc +++ b/base/test/test_io_thread.cc
@@ -38,7 +38,7 @@ io_thread_started_ = false; } -void TestIOThread::PostTask(const tracked_objects::Location& from_here, +void TestIOThread::PostTask(const Location& from_here, const base::Closure& task) { task_runner()->PostTask(from_here, task); }
diff --git a/base/test/test_io_thread.h b/base/test/test_io_thread.h index 5d3885e8..825e13c 100644 --- a/base/test/test_io_thread.h +++ b/base/test/test_io_thread.h
@@ -38,8 +38,7 @@ void Stop(); // Post |task| to the IO thread. - void PostTask(const tracked_objects::Location& from_here, - const base::Closure& task); + void PostTask(const Location& from_here, const base::Closure& task); base::MessageLoopForIO* message_loop() { return static_cast<base::MessageLoopForIO*>(io_thread_.message_loop());
diff --git a/base/test/test_mock_time_task_runner.cc b/base/test/test_mock_time_task_runner.cc index 832a7ff..2f6c923 100644 --- a/base/test/test_mock_time_task_runner.cc +++ b/base/test/test_mock_time_task_runner.cc
@@ -92,12 +92,12 @@ bool RunsTasksInCurrentSequence() const override { return target_->RunsTasksInCurrentSequence(); } - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override { return target_->PostDelayedTask(from_here, std::move(task), delay); } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override { return target_->PostNonNestableDelayedTask(from_here, std::move(task), @@ -123,7 +123,7 @@ struct TestMockTimeTaskRunner::TestOrderedPendingTask : public base::TestPendingTask { TestOrderedPendingTask(); - TestOrderedPendingTask(const tracked_objects::Location& location, + TestOrderedPendingTask(const Location& location, OnceClosure task, TimeTicks post_time, TimeDelta delay, @@ -148,7 +148,7 @@ TestOrderedPendingTask&&) = default; TestMockTimeTaskRunner::TestOrderedPendingTask::TestOrderedPendingTask( - const tracked_objects::Location& location, + const Location& location, OnceClosure task, TimeTicks post_time, TimeDelta delay, @@ -287,10 +287,9 @@ return thread_checker_.CalledOnValidThread(); } -bool TestMockTimeTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay) { +bool TestMockTimeTaskRunner::PostDelayedTask(const Location& from_here, + OnceClosure task, + TimeDelta delay) { AutoLock scoped_lock(tasks_lock_); tasks_.push(TestOrderedPendingTask(from_here, std::move(task), now_ticks_, delay, next_task_ordinal_++, @@ -300,7 +299,7 @@ } bool TestMockTimeTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, TimeDelta delay) { return PostDelayedTask(from_here, std::move(task), delay);
diff --git a/base/test/test_mock_time_task_runner.h b/base/test/test_mock_time_task_runner.h index 6218734..fa318d8 100644 --- a/base/test/test_mock_time_task_runner.h +++ b/base/test/test_mock_time_task_runner.h
@@ -172,10 +172,10 @@ // SingleThreadTaskRunner: bool RunsTasksInCurrentSequence() const override; - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override;
diff --git a/base/test/test_pending_task.cc b/base/test/test_pending_task.cc index 3f71a998..999de7e 100644 --- a/base/test/test_pending_task.cc +++ b/base/test/test_pending_task.cc
@@ -11,7 +11,7 @@ TestPendingTask::TestPendingTask() : nestability(NESTABLE) {} -TestPendingTask::TestPendingTask(const tracked_objects::Location& location, +TestPendingTask::TestPendingTask(const Location& location, OnceClosure task, TimeTicks post_time, TimeDelta delay,
diff --git a/base/test/test_pending_task.h b/base/test/test_pending_task.h index 52ca592f..460de0e 100644 --- a/base/test/test_pending_task.h +++ b/base/test/test_pending_task.h
@@ -22,7 +22,7 @@ TestPendingTask(); TestPendingTask(TestPendingTask&& other); - TestPendingTask(const tracked_objects::Location& location, + TestPendingTask(const Location& location, OnceClosure task, TimeTicks post_time, TimeDelta delay, @@ -52,7 +52,7 @@ // - std::sort. bool ShouldRunBefore(const TestPendingTask& other) const; - tracked_objects::Location location; + Location location; OnceClosure task; TimeTicks post_time; TimeDelta delay;
diff --git a/base/test/test_simple_task_runner.cc b/base/test/test_simple_task_runner.cc index bdb4aac..63a22b2 100644 --- a/base/test/test_simple_task_runner.cc +++ b/base/test/test_simple_task_runner.cc
@@ -16,10 +16,9 @@ TestSimpleTaskRunner::~TestSimpleTaskRunner() = default; -bool TestSimpleTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay) { +bool TestSimpleTaskRunner::PostDelayedTask(const Location& from_here, + OnceClosure task, + TimeDelta delay) { AutoLock auto_lock(lock_); pending_tasks_.push_back(TestPendingTask(from_here, std::move(task), TimeTicks(), delay, @@ -27,10 +26,9 @@ return true; } -bool TestSimpleTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay) { +bool TestSimpleTaskRunner::PostNonNestableDelayedTask(const Location& from_here, + OnceClosure task, + TimeDelta delay) { AutoLock auto_lock(lock_); pending_tasks_.push_back(TestPendingTask(from_here, std::move(task), TimeTicks(), delay,
diff --git a/base/test/test_simple_task_runner.h b/base/test/test_simple_task_runner.h index 0514666..7a6c46a 100644 --- a/base/test/test_simple_task_runner.h +++ b/base/test/test_simple_task_runner.h
@@ -43,10 +43,10 @@ TestSimpleTaskRunner(); // SingleThreadTaskRunner implementation. - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override;
diff --git a/base/threading/post_task_and_reply_impl.cc b/base/threading/post_task_and_reply_impl.cc index 1aaa1e7..4eba45a 100644 --- a/base/threading/post_task_and_reply_impl.cc +++ b/base/threading/post_task_and_reply_impl.cc
@@ -28,7 +28,7 @@ // violations caused by invoking the Closure destructor on the wrong sequence. class PostTaskAndReplyRelay { public: - PostTaskAndReplyRelay(const tracked_objects::Location& from_here, + PostTaskAndReplyRelay(const Location& from_here, OnceClosure task, OnceClosure reply) : sequence_checker_(), @@ -64,7 +64,7 @@ } const SequenceChecker sequence_checker_; - const tracked_objects::Location from_here_; + const Location from_here_; const scoped_refptr<SequencedTaskRunner> origin_task_runner_; OnceClosure reply_; OnceClosure task_; @@ -74,10 +74,9 @@ namespace internal { -bool PostTaskAndReplyImpl::PostTaskAndReply( - const tracked_objects::Location& from_here, - OnceClosure task, - OnceClosure reply) { +bool PostTaskAndReplyImpl::PostTaskAndReply(const Location& from_here, + OnceClosure task, + OnceClosure reply) { DCHECK(!task.is_null()) << from_here.ToString(); DCHECK(!reply.is_null()) << from_here.ToString(); PostTaskAndReplyRelay* relay =
diff --git a/base/threading/post_task_and_reply_impl.h b/base/threading/post_task_and_reply_impl.h index 00aee6d..613c453 100644 --- a/base/threading/post_task_and_reply_impl.h +++ b/base/threading/post_task_and_reply_impl.h
@@ -28,13 +28,12 @@ // sequence or thread that called this. Can only be called when // SequencedTaskRunnerHandle::IsSet(). Both |task| and |reply| are guaranteed // to be deleted on the sequence or thread that called this. - bool PostTaskAndReply(const tracked_objects::Location& from_here, + bool PostTaskAndReply(const Location& from_here, OnceClosure task, OnceClosure reply); private: - virtual bool PostTask(const tracked_objects::Location& from_here, - OnceClosure task) = 0; + virtual bool PostTask(const Location& from_here, OnceClosure task) = 0; }; } // namespace internal
diff --git a/base/threading/post_task_and_reply_impl_unittest.cc b/base/threading/post_task_and_reply_impl_unittest.cc index 664c191..9578071 100644 --- a/base/threading/post_task_and_reply_impl_unittest.cc +++ b/base/threading/post_task_and_reply_impl_unittest.cc
@@ -28,8 +28,7 @@ : destination_(destination) {} private: - bool PostTask(const tracked_objects::Location& from_here, - OnceClosure task) override { + bool PostTask(const Location& from_here, OnceClosure task) override { return destination_->PostTask(from_here, std::move(task)); }
diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc index 3d727c9f..528a577 100644 --- a/base/threading/sequenced_worker_pool.cc +++ b/base/threading/sequenced_worker_pool.cc
@@ -90,7 +90,7 @@ int trace_id; int64_t sequence_task_number; SequencedWorkerPool::WorkerShutdown shutdown_behavior; - tracked_objects::Location posted_from; + Location posted_from; OnceClosure task; // Non-delayed tasks and delayed tasks are managed together by time-to-run @@ -132,7 +132,7 @@ SequencedWorkerPool::WorkerShutdown shutdown_behavior); // TaskRunner implementation - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override; @@ -155,10 +155,9 @@ SequencedWorkerPoolTaskRunner::~SequencedWorkerPoolTaskRunner() { } -bool SequencedWorkerPoolTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay) { +bool SequencedWorkerPoolTaskRunner::PostDelayedTask(const Location& from_here, + OnceClosure task, + TimeDelta delay) { if (delay.is_zero()) { return pool_->PostWorkerTaskWithShutdownBehavior(from_here, std::move(task), shutdown_behavior_); @@ -186,14 +185,14 @@ SequencedWorkerPool::WorkerShutdown shutdown_behavior); // TaskRunner implementation - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override; // SequencedTaskRunner implementation - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; @@ -222,7 +221,7 @@ ~PoolSequencedTaskRunner() = default; bool SequencedWorkerPool::PoolSequencedTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, TimeDelta delay) { if (delay.is_zero()) { @@ -239,7 +238,7 @@ } bool SequencedWorkerPool::PoolSequencedTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, TimeDelta delay) { // There's no way to run nested tasks, so simply forward to @@ -342,7 +341,7 @@ bool PostTask(const std::string* optional_token_name, SequenceToken sequence_token, WorkerShutdown shutdown_behavior, - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, TimeDelta delay); @@ -680,7 +679,7 @@ const std::string* optional_token_name, SequenceToken sequence_token, WorkerShutdown shutdown_behavior, - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, TimeDelta delay) { // Use CHECK instead of DCHECK to crash earlier. See http://crbug.com/711167 @@ -1519,32 +1518,30 @@ return new SequencedWorkerPoolTaskRunner(this, shutdown_behavior); } -bool SequencedWorkerPool::PostWorkerTask( - const tracked_objects::Location& from_here, - OnceClosure task) { +bool SequencedWorkerPool::PostWorkerTask(const Location& from_here, + OnceClosure task) { return inner_->PostTask(NULL, SequenceToken(), BLOCK_SHUTDOWN, from_here, std::move(task), TimeDelta()); } bool SequencedWorkerPool::PostWorkerTaskWithShutdownBehavior( - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, WorkerShutdown shutdown_behavior) { return inner_->PostTask(NULL, SequenceToken(), shutdown_behavior, from_here, std::move(task), TimeDelta()); } -bool SequencedWorkerPool::PostSequencedWorkerTask( - SequenceToken sequence_token, - const tracked_objects::Location& from_here, - OnceClosure task) { +bool SequencedWorkerPool::PostSequencedWorkerTask(SequenceToken sequence_token, + const Location& from_here, + OnceClosure task) { return inner_->PostTask(NULL, sequence_token, BLOCK_SHUTDOWN, from_here, std::move(task), TimeDelta()); } bool SequencedWorkerPool::PostDelayedSequencedWorkerTask( SequenceToken sequence_token, - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, TimeDelta delay) { WorkerShutdown shutdown_behavior = @@ -1555,7 +1552,7 @@ bool SequencedWorkerPool::PostNamedSequencedWorkerTask( const std::string& token_name, - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task) { DCHECK(!token_name.empty()); return inner_->PostTask(&token_name, SequenceToken(), BLOCK_SHUTDOWN, @@ -1564,17 +1561,16 @@ bool SequencedWorkerPool::PostSequencedWorkerTaskWithShutdownBehavior( SequenceToken sequence_token, - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, WorkerShutdown shutdown_behavior) { return inner_->PostTask(NULL, sequence_token, shutdown_behavior, from_here, std::move(task), TimeDelta()); } -bool SequencedWorkerPool::PostDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay) { +bool SequencedWorkerPool::PostDelayedTask(const Location& from_here, + OnceClosure task, + TimeDelta delay) { WorkerShutdown shutdown_behavior = delay.is_zero() ? BLOCK_SHUTDOWN : SKIP_ON_SHUTDOWN; return inner_->PostTask(nullptr, SequenceToken(), shutdown_behavior,
diff --git a/base/threading/worker_pool.cc b/base/threading/worker_pool.cc index 4bfb9ce9..9ce4738 100644 --- a/base/threading/worker_pool.cc +++ b/base/threading/worker_pool.cc
@@ -26,8 +26,7 @@ ~PostTaskAndReplyWorkerPool() override = default; private: - bool PostTask(const tracked_objects::Location& from_here, - OnceClosure task) override { + bool PostTask(const Location& from_here, OnceClosure task) override { return WorkerPool::PostTask(from_here, std::move(task), task_is_slow_); } @@ -44,7 +43,7 @@ explicit WorkerPoolTaskRunner(bool tasks_are_slow); // TaskRunner implementation - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override; @@ -54,10 +53,9 @@ // Helper function for posting a delayed task. Asserts that the delay is // zero because non-zero delays are not supported. - bool PostDelayedTaskAssertZeroDelay( - const tracked_objects::Location& from_here, - OnceClosure task, - base::TimeDelta delay); + bool PostDelayedTaskAssertZeroDelay(const Location& from_here, + OnceClosure task, + base::TimeDelta delay); const bool tasks_are_slow_; @@ -71,10 +69,9 @@ WorkerPoolTaskRunner::~WorkerPoolTaskRunner() { } -bool WorkerPoolTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - OnceClosure task, - TimeDelta delay) { +bool WorkerPoolTaskRunner::PostDelayedTask(const Location& from_here, + OnceClosure task, + TimeDelta delay) { return PostDelayedTaskAssertZeroDelay(from_here, std::move(task), delay); } @@ -83,7 +80,7 @@ } bool WorkerPoolTaskRunner::PostDelayedTaskAssertZeroDelay( - const tracked_objects::Location& from_here, + const Location& from_here, OnceClosure task, base::TimeDelta delay) { DCHECK_EQ(delay.InMillisecondsRoundedUp(), 0) @@ -101,7 +98,7 @@ } // namespace -bool WorkerPool::PostTaskAndReply(const tracked_objects::Location& from_here, +bool WorkerPool::PostTaskAndReply(const Location& from_here, OnceClosure task, OnceClosure reply, bool task_is_slow) {
diff --git a/base/threading/worker_pool_posix.cc b/base/threading/worker_pool_posix.cc index 3299b5e..05e25c7d 100644 --- a/base/threading/worker_pool_posix.cc +++ b/base/threading/worker_pool_posix.cc
@@ -46,7 +46,7 @@ // destructor is never called. ~WorkerPoolImpl() = delete; - void PostTask(const tracked_objects::Location& from_here, + void PostTask(const Location& from_here, base::OnceClosure task, bool task_is_slow); @@ -58,7 +58,7 @@ : pool_(new base::PosixDynamicThreadPool("WorkerPool", kIdleSecondsBeforeExit)) {} -void WorkerPoolImpl::PostTask(const tracked_objects::Location& from_here, +void WorkerPoolImpl::PostTask(const Location& from_here, base::OnceClosure task, bool task_is_slow) { pool_->PostTask(from_here, std::move(task)); @@ -108,7 +108,7 @@ } // namespace // static -bool WorkerPool::PostTask(const tracked_objects::Location& from_here, +bool WorkerPool::PostTask(const Location& from_here, base::OnceClosure task, bool task_is_slow) { g_lazy_worker_pool.Pointer()->PostTask(from_here, std::move(task), @@ -133,9 +133,8 @@ pending_tasks_.pop(); } -void PosixDynamicThreadPool::PostTask( - const tracked_objects::Location& from_here, - base::OnceClosure task) { +void PosixDynamicThreadPool::PostTask(const Location& from_here, + base::OnceClosure task) { PendingTask pending_task(from_here, std::move(task)); AddTask(&pending_task); }
diff --git a/base/threading/worker_pool_posix.h b/base/threading/worker_pool_posix.h index 0b10adf8f..9859d57 100644 --- a/base/threading/worker_pool_posix.h +++ b/base/threading/worker_pool_posix.h
@@ -51,7 +51,7 @@ int idle_seconds_before_exit); // Adds |task| to the thread pool. - void PostTask(const tracked_objects::Location& from_here, OnceClosure task); + void PostTask(const Location& from_here, OnceClosure task); // Worker thread method to wait for up to |idle_seconds_before_exit| for more // work from the thread pool. Returns NULL if no work is available.
diff --git a/base/threading/worker_pool_win.cc b/base/threading/worker_pool_win.cc index 28429a4..a12a9c7 100644 --- a/base/threading/worker_pool_win.cc +++ b/base/threading/worker_pool_win.cc
@@ -62,7 +62,7 @@ } // namespace // static -bool WorkerPool::PostTask(const tracked_objects::Location& from_here, +bool WorkerPool::PostTask(const Location& from_here, base::OnceClosure task, bool task_is_slow) { PendingTask* pending_task = new PendingTask(from_here, std::move(task));
diff --git a/base/timer/mock_timer.cc b/base/timer/mock_timer.cc index 296071e..b53c0065 100644 --- a/base/timer/mock_timer.cc +++ b/base/timer/mock_timer.cc
@@ -11,14 +11,11 @@ is_running_(false) { } -MockTimer::MockTimer(const tracked_objects::Location& posted_from, +MockTimer::MockTimer(const Location& posted_from, TimeDelta delay, const base::Closure& user_task, bool is_repeating) - : Timer(true, is_repeating), - delay_(delay), - is_running_(false) { -} + : Timer(true, is_repeating), delay_(delay), is_running_(false) {} MockTimer::~MockTimer() { } @@ -31,7 +28,7 @@ return delay_; } -void MockTimer::Start(const tracked_objects::Location& posted_from, +void MockTimer::Start(const Location& posted_from, TimeDelta delay, const base::Closure& user_task) { delay_ = delay;
diff --git a/base/timer/mock_timer.h b/base/timer/mock_timer.h index e18a5c04..49394b2 100644 --- a/base/timer/mock_timer.h +++ b/base/timer/mock_timer.h
@@ -12,7 +12,7 @@ class BASE_EXPORT MockTimer : public Timer { public: MockTimer(bool retain_user_task, bool is_repeating); - MockTimer(const tracked_objects::Location& posted_from, + MockTimer(const Location& posted_from, TimeDelta delay, const base::Closure& user_task, bool is_repeating); @@ -21,7 +21,7 @@ // base::Timer implementation. bool IsRunning() const override; base::TimeDelta GetCurrentDelay() const override; - void Start(const tracked_objects::Location& posted_from, + void Start(const Location& posted_from, base::TimeDelta delay, const base::Closure& user_task) override; void Stop() override;
diff --git a/base/timer/timer.cc b/base/timer/timer.cc index 1f6efcc..5540994d 100644 --- a/base/timer/timer.cc +++ b/base/timer/timer.cc
@@ -75,13 +75,13 @@ origin_sequence_checker_.DetachFromSequence(); } -Timer::Timer(const tracked_objects::Location& posted_from, +Timer::Timer(const Location& posted_from, TimeDelta delay, const base::Closure& user_task, bool is_repeating) : Timer(posted_from, delay, user_task, is_repeating, nullptr) {} -Timer::Timer(const tracked_objects::Location& posted_from, +Timer::Timer(const Location& posted_from, TimeDelta delay, const base::Closure& user_task, bool is_repeating, @@ -125,7 +125,7 @@ task_runner_.swap(task_runner); } -void Timer::Start(const tracked_objects::Location& posted_from, +void Timer::Start(const Location& posted_from, TimeDelta delay, const base::Closure& user_task) { DCHECK(origin_sequence_checker_.CalledOnValidSequence());
diff --git a/base/timer/timer.h b/base/timer/timer.h index ad2e22b..489921c 100644 --- a/base/timer/timer.h +++ b/base/timer/timer.h
@@ -97,11 +97,11 @@ // Construct a timer with retained task info. If |tick_clock| is provided, it // is used instead of TimeTicks::Now() to get TimeTicks when scheduling tasks. - Timer(const tracked_objects::Location& posted_from, + Timer(const Location& posted_from, TimeDelta delay, const base::Closure& user_task, bool is_repeating); - Timer(const tracked_objects::Location& posted_from, + Timer(const Location& posted_from, TimeDelta delay, const base::Closure& user_task, bool is_repeating, @@ -124,7 +124,7 @@ // Start the timer to run at the given |delay| from now. If the timer is // already running, it will be replaced to call the given |user_task|. - virtual void Start(const tracked_objects::Location& posted_from, + virtual void Start(const Location& posted_from, TimeDelta delay, const base::Closure& user_task); @@ -155,7 +155,7 @@ void set_desired_run_time(TimeTicks desired) { desired_run_time_ = desired; } void set_is_running(bool running) { is_running_ = running; } - const tracked_objects::Location& posted_from() const { return posted_from_; } + const Location& posted_from() const { return posted_from_; } bool retain_user_task() const { return retain_user_task_; } bool is_repeating() const { return is_repeating_; } bool is_running() const { return is_running_; } @@ -189,7 +189,7 @@ scoped_refptr<SequencedTaskRunner> task_runner_; // Location in user code. - tracked_objects::Location posted_from_; + Location posted_from_; // Delay requested by user. TimeDelta delay_; // |user_task_| is what the user wants to be run at |desired_run_time_|. @@ -249,7 +249,7 @@ // already running, it will be replaced to call a task formed from // |reviewer->*method|. template <class Receiver> - void Start(const tracked_objects::Location& posted_from, + void Start(const Location& posted_from, TimeDelta delay, Receiver* receiver, void (Receiver::*method)()) { @@ -290,14 +290,14 @@ class DelayTimer : protected Timer { public: template <class Receiver> - DelayTimer(const tracked_objects::Location& posted_from, + DelayTimer(const Location& posted_from, TimeDelta delay, Receiver* receiver, void (Receiver::*method)()) : DelayTimer(posted_from, delay, receiver, method, nullptr) {} template <class Receiver> - DelayTimer(const tracked_objects::Location& posted_from, + DelayTimer(const Location& posted_from, TimeDelta delay, Receiver* receiver, void (Receiver::*method)(),
diff --git a/base/trace_event/memory_dump_manager_unittest.cc b/base/trace_event/memory_dump_manager_unittest.cc index 56e16fc..bbeba6a 100644 --- a/base/trace_event/memory_dump_manager_unittest.cc +++ b/base/trace_event/memory_dump_manager_unittest.cc
@@ -92,7 +92,7 @@ } // Posts |task| to |task_runner| and blocks until it is executed. -void PostTaskAndWait(const tracked_objects::Location& from_here, +void PostTaskAndWait(const Location& from_here, SequencedTaskRunner* task_runner, base::OnceClosure task) { base::WaitableEvent event(WaitableEvent::ResetPolicy::MANUAL, @@ -144,14 +144,14 @@ void set_enabled(bool value) { enabled_ = value; } unsigned no_of_post_tasks() const { return num_of_post_tasks_; } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override { NOTREACHED(); return false; } - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const Location& from_here, OnceClosure task, TimeDelta delay) override { num_of_post_tasks_++;
diff --git a/cc/scheduler/begin_frame_tracker.cc b/cc/scheduler/begin_frame_tracker.cc index 4c1ef9a..c220552d 100644 --- a/cc/scheduler/begin_frame_tracker.cc +++ b/cc/scheduler/begin_frame_tracker.cc
@@ -6,7 +6,7 @@ namespace cc { -BeginFrameTracker::BeginFrameTracker(const tracked_objects::Location& location) +BeginFrameTracker::BeginFrameTracker(const base::Location& location) : location_(location), location_string_(location.ToString()), current_finished_at_(base::TimeTicks() +
diff --git a/cc/scheduler/begin_frame_tracker.h b/cc/scheduler/begin_frame_tracker.h index 4e237c7..33d124ad7 100644 --- a/cc/scheduler/begin_frame_tracker.h +++ b/cc/scheduler/begin_frame_tracker.h
@@ -35,7 +35,7 @@ // TODO(mithro): Record stats about the viz::BeginFrameArgs class CC_EXPORT BeginFrameTracker { public: - explicit BeginFrameTracker(const tracked_objects::Location& location); + explicit BeginFrameTracker(const base::Location& location); ~BeginFrameTracker(); // The Start and Finish methods manage the period that a BFA should be @@ -85,7 +85,7 @@ // the BFA object. Can be called at any time. bool HasFinished() const { return !current_finished_at_.is_null(); } - const tracked_objects::Location location_; + const base::Location location_; const std::string location_string_; base::TimeTicks current_updated_at_;
diff --git a/cc/tiles/image_controller_unittest.cc b/cc/tiles/image_controller_unittest.cc index 631c3d7..136f43d 100644 --- a/cc/tiles/image_controller_unittest.cc +++ b/cc/tiles/image_controller_unittest.cc
@@ -69,13 +69,13 @@ public: WorkerTaskRunner() { thread_.Start(); } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { return PostDelayedTask(from_here, std::move(task), delay); } - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { thread_.PostTask(std::move(task));
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index 3834ba3e..02b1a75 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc
@@ -58,7 +58,7 @@ // posted should run synchronously. class SynchronousSimpleTaskRunner : public base::TestSimpleTaskRunner { public: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { TestSimpleTaskRunner::PostDelayedTask(from_here, std::move(task), delay); @@ -67,7 +67,7 @@ return true; } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { return PostDelayedTask(from_here, std::move(task), delay);
diff --git a/cc/trees/blocking_task_runner.cc b/cc/trees/blocking_task_runner.cc index b6c8a49..0b87f3bb 100644 --- a/cc/trees/blocking_task_runner.cc +++ b/cc/trees/blocking_task_runner.cc
@@ -33,7 +33,7 @@ return base::PlatformThread::CurrentId() == thread_id_; } -bool BlockingTaskRunner::PostTask(const tracked_objects::Location& from_here, +bool BlockingTaskRunner::PostTask(const base::Location& from_here, base::OnceClosure task) { base::AutoLock lock(lock_); DCHECK(task_runner_.get() || capture_);
diff --git a/cc/trees/blocking_task_runner.h b/cc/trees/blocking_task_runner.h index 25d227a6..c4c111cc 100644 --- a/cc/trees/blocking_task_runner.h +++ b/cc/trees/blocking_task_runner.h
@@ -75,8 +75,7 @@ // is true. When |capture_| is true, tasks posted will be caught and stored // until the capturing stops. At that time the tasks will be run directly // instead of being posted to the SingleThreadTaskRunner. - bool PostTask(const tracked_objects::Location& from_here, - base::OnceClosure task); + bool PostTask(const base::Location& from_here, base::OnceClosure task); private: explicit BlockingTaskRunner(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java index 291e8296..57f8952c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
@@ -6,31 +6,22 @@ import android.app.Activity; import android.app.Fragment; -import android.app.PendingIntent; -import android.app.PendingIntent.CanceledException; -import android.content.Intent; import android.os.Bundle; import android.text.TextUtils; import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; import org.chromium.base.ApplicationStatus.ActivityStateListener; -import org.chromium.base.Log; import org.chromium.base.VisibleForTesting; import org.chromium.base.metrics.CachedMetrics.EnumeratedHistogramSample; import org.chromium.chrome.R; import org.chromium.chrome.browser.customtabs.CustomTabActivity; -import org.chromium.chrome.browser.customtabs.CustomTabsConnection; -import org.chromium.chrome.browser.document.ChromeLauncherActivity; -import org.chromium.chrome.browser.init.AsyncInitializationActivity; import org.chromium.chrome.browser.metrics.UmaUtils; import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings; import org.chromium.chrome.browser.preferences.datareduction.DataReductionPromoUtils; import org.chromium.chrome.browser.preferences.datareduction.DataReductionProxyUma; -import org.chromium.chrome.browser.profiles.ProfileManagerUtils; import org.chromium.chrome.browser.search_engines.TemplateUrlService; import org.chromium.chrome.browser.searchwidget.SearchWidgetProvider; -import org.chromium.chrome.browser.util.IntentUtils; import org.chromium.ui.base.LocalizationUtils; import java.lang.reflect.Constructor; @@ -48,7 +39,7 @@ * [Sign-in page] * The activity might be run more than once, e.g. 1) for ToS and sign-in, and 2) for intro. */ -public class FirstRunActivity extends AsyncInitializationActivity implements FirstRunPageDelegate { +public class FirstRunActivity extends FirstRunActivityBase implements FirstRunPageDelegate { /** Alerted about various events when FirstRunActivity performs them. */ public interface FirstRunActivityObserver { /** See {@link #onFlowIsKnown}. */ @@ -67,12 +58,9 @@ void onAbortFirstRunExperience(); } - protected static final String TAG = "FirstRunActivity"; - // Incoming parameters: public static final String EXTRA_COMING_FROM_CHROME_ICON = "Extra.ComingFromChromeIcon"; public static final String EXTRA_USE_FRE_FLOW_SEQUENCER = "Extra.UseFreFlowSequencer"; - public static final String EXTRA_START_LIGHTWEIGHT_FRE = "Extra.StartLightweightFRE"; public static final String EXTRA_CHROME_LAUNCH_INTENT = "Extra.FreChromeLaunchIntent"; static final String SHOW_WELCOME_PAGE = "ShowWelcome"; @@ -196,12 +184,6 @@ } @Override - protected boolean requiresFirstRunToBeCompleted(Intent intent) { - // The user is already in First Run. - return false; - } - - @Override protected Bundle transformSavedInstanceStateForOnCreate(Bundle savedInstanceState) { // We pass null to Activity.onCreate() so that it doesn't automatically restore // the FragmentManager state - as that may cause fragments to be loaded that have @@ -224,11 +206,6 @@ setFinishOnTouchOutside(true); - // Skip creating content view if it is to start a lightweight First Run Experience. - if (mFreProperties.getBoolean(FirstRunActivity.EXTRA_START_LIGHTWEIGHT_FRE)) { - return; - } - mPager = new FirstRunViewPager(this); mPager.setId(R.id.fre_pager); mPager.setOffscreenPageLimit(3); @@ -312,11 +289,6 @@ } } - @Override - public boolean shouldStartGpuProcess() { - return true; - } - // Activity: @Override @@ -353,20 +325,8 @@ } @Override - public void onPause() { - super.onPause(); - flushPersistentData(); - } - - @Override public void onStart() { super.onStart(); - // Since the FRE may be shown before any tab is shown, mark that this is the point at - // which Chrome went to foreground. This is needed as otherwise an assert will be hit - // in UmaUtils.getForegroundStartTime() when recording the time taken to load the first - // page (which happens after native has been initialized possibly while FRE is still - // active). - UmaUtils.recordForegroundStartTime(); stopProgressionIfNotAcceptedTermsOfService(); } @@ -502,51 +462,6 @@ jumpToPage(mPager.getCurrentItem() + 1); } - protected void flushPersistentData() { - if (mNativeSideIsInitialized) { - ProfileManagerUtils.flushPersistentDataForAllProfiles(); - } - } - - /** - * Sends the PendingIntent included with the CHROME_LAUNCH_INTENT extra if it exists. - * @param complete Whether first run completed successfully. - * @return Whether a pending intent was sent. - */ - protected final boolean sendPendingIntentIfNecessary(final boolean complete) { - PendingIntent pendingIntent = IntentUtils.safeGetParcelableExtra(getIntent(), - EXTRA_CHROME_LAUNCH_INTENT); - if (pendingIntent == null) return false; - - Intent extraDataIntent = new Intent(); - extraDataIntent.putExtra(FirstRunActivity.EXTRA_FIRST_RUN_ACTIVITY_RESULT, true); - extraDataIntent.putExtra(FirstRunActivity.EXTRA_FIRST_RUN_COMPLETE, complete); - - try { - // After the PendingIntent has been sent, send a first run callback to custom tabs if - // necessary. - PendingIntent.OnFinished onFinished = new PendingIntent.OnFinished() { - @Override - public void onSendFinished(PendingIntent pendingIntent, Intent intent, - int resultCode, String resultData, Bundle resultExtras) { - if (ChromeLauncherActivity.isCustomTabIntent(intent)) { - CustomTabsConnection.getInstance().sendFirstRunCallbackIfNecessary( - intent, complete); - } - } - }; - - // Use the PendingIntent to send the intent that originally launched Chrome. The intent - // will go back to the ChromeLauncherActivity, which will route it accordingly. - pendingIntent.send(this, complete ? Activity.RESULT_OK : Activity.RESULT_CANCELED, - extraDataIntent, onFinished, null); - return true; - } catch (CanceledException e) { - Log.e(TAG, "Unable to send PendingIntent.", e); - } - return false; - } - /** * Transitions to a given page. * @return Whether the transition to a given page was allowed.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java new file mode 100644 index 0000000..df7b33d5 --- /dev/null +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
@@ -0,0 +1,107 @@ +// Copyright 2015 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. + +package org.chromium.chrome.browser.firstrun; + +import android.app.Activity; +import android.app.PendingIntent; +import android.app.PendingIntent.CanceledException; +import android.content.Intent; +import android.os.Bundle; + +import org.chromium.base.Log; +import org.chromium.chrome.browser.customtabs.CustomTabsConnection; +import org.chromium.chrome.browser.document.ChromeLauncherActivity; +import org.chromium.chrome.browser.init.AsyncInitializationActivity; +import org.chromium.chrome.browser.metrics.UmaUtils; +import org.chromium.chrome.browser.profiles.ProfileManagerUtils; +import org.chromium.chrome.browser.util.IntentUtils; + +/** Base class for First Run Experience. */ +public abstract class FirstRunActivityBase extends AsyncInitializationActivity { + private static final String TAG = "FirstRunActivity"; + + private boolean mNativeInitialized; + + @Override + protected boolean requiresFirstRunToBeCompleted(Intent intent) { + // The user is already in First Run. + return false; + } + + @Override + public boolean shouldStartGpuProcess() { + return true; + } + + // Activity: + + @Override + public void onPause() { + super.onPause(); + flushPersistentData(); + } + + @Override + public void onStart() { + super.onStart(); + // Since the FRE may be shown before any tab is shown, mark that this is the point at + // which Chrome went to foreground. This is needed as otherwise an assert will be hit + // in UmaUtils.getForegroundStartTime() when recording the time taken to load the first + // page (which happens after native has been initialized possibly while FRE is still + // active). + UmaUtils.recordForegroundStartTime(); + } + + @Override + public void finishNativeInitialization() { + super.finishNativeInitialization(); + mNativeInitialized = true; + } + + protected void flushPersistentData() { + if (mNativeInitialized) { + ProfileManagerUtils.flushPersistentDataForAllProfiles(); + } + } + + /** + * Sends the PendingIntent included with the CHROME_LAUNCH_INTENT extra if it exists. + * @param complete Whether first run completed successfully. + * @return Whether a pending intent was sent. + */ + protected final boolean sendPendingIntentIfNecessary(final boolean complete) { + PendingIntent pendingIntent = IntentUtils.safeGetParcelableExtra( + getIntent(), FirstRunActivity.EXTRA_CHROME_LAUNCH_INTENT); + if (pendingIntent == null) return false; + + Intent extraDataIntent = new Intent(); + extraDataIntent.putExtra(FirstRunActivity.EXTRA_FIRST_RUN_ACTIVITY_RESULT, true); + extraDataIntent.putExtra(FirstRunActivity.EXTRA_FIRST_RUN_COMPLETE, complete); + + try { + // After the PendingIntent has been sent, send a first run callback to custom tabs if + // necessary. + PendingIntent.OnFinished onFinished = new PendingIntent.OnFinished() { + @Override + public void onSendFinished(PendingIntent pendingIntent, Intent intent, + int resultCode, String resultData, Bundle resultExtras) { + if (ChromeLauncherActivity.isCustomTabIntent(intent)) { + CustomTabsConnection.getInstance().sendFirstRunCallbackIfNecessary( + intent, complete); + } + } + }; + + // Use the PendingIntent to send the intent that originally launched Chrome. The intent + // will go back to the ChromeLauncherActivity, which will route it accordingly. + pendingIntent.send(this, complete ? Activity.RESULT_OK : Activity.RESULT_CANCELED, + extraDataIntent, onFinished, null); + return true; + } catch (CanceledException e) { + Log.e(TAG, "Unable to send PendingIntent.", e); + } + return false; + } +}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java index 997936b..d88016c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java
@@ -297,7 +297,6 @@ Intent intent = new Intent(); intent.setClassName(context, LightweightFirstRunActivity.class.getName()); intent.putExtra(FirstRunActivity.EXTRA_COMING_FROM_CHROME_ICON, fromChromeIcon); - intent.putExtra(FirstRunActivity.EXTRA_START_LIGHTWEIGHT_FRE, true); return intent; } @@ -369,8 +368,7 @@ List<WeakReference<Activity>> activities = ApplicationStatus.getRunningActivities(); for (WeakReference<Activity> weakActivity : activities) { Activity activity = weakActivity.get(); - if (activity instanceof FirstRunActivity - && !(activity instanceof LightweightFirstRunActivity)) { + if (activity instanceof FirstRunActivity) { isGenericFreActive = true; break; }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/LightweightFirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/LightweightFirstRunActivity.java index 9bd1508..ecbf83d4 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/LightweightFirstRunActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/LightweightFirstRunActivity.java
@@ -23,18 +23,19 @@ /** * Lightweight FirstRunActivity. It shows ToS dialog only. */ -public class LightweightFirstRunActivity extends FirstRunActivity { +public class LightweightFirstRunActivity extends FirstRunActivityBase { private Button mOkButton; private boolean mNativeInitialized; private boolean mTriggerAcceptAfterNativeInit; @Override public void setContentView() { - super.setContentView(); if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)) { completeFirstRunExperience(); } + setFinishOnTouchOutside(true); + setContentView(LayoutInflater.from(LightweightFirstRunActivity.this) .inflate(R.layout.lightweight_fre_tos, null)); @@ -88,6 +89,15 @@ } @Override + public void onBackPressed() { + abortFirstRunExperience(); + } + + public void abortFirstRunExperience() { + finish(); + sendPendingIntentIfNecessary(false); + } + public void completeFirstRunExperience() { FirstRunStatus.setLightweightFirstRunFlowComplete(true); finish();
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni index d18872d..9b3fa3bf 100644 --- a/chrome/android/java_sources.gni +++ b/chrome/android/java_sources.gni
@@ -403,6 +403,7 @@ "java/src/org/chromium/chrome/browser/firstrun/FirstRunChooserView.java", "java/src/org/chromium/chrome/browser/firstrun/LightweightFirstRunActivity.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java", + "java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunFlowSequencer.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunPage.java", "java/src/org/chromium/chrome/browser/firstrun/FirstRunPageDelegate.java",
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index c67384e..78ecd75f 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd
@@ -1900,25 +1900,20 @@ <!-- Bookmark app bubble --> <if expr="use_ash"> - <message name="IDS_ADD_TO_SHELF_BUBBLE_TITLE" desc="Title of the bubble for adding a bookmark app to the shelf."> + <message name="IDS_ADD_TO_OS_LAUNCH_SURFACE_BUBBLE_TITLE" desc="Title of the bubble for adding a bookmark app to the shelf."> Add to shelf </message> </if> - <if expr="not use_titlecase"> - <message name="IDS_ADD_TO_DESKTOP_BUBBLE_TITLE" desc="Title of the bubble for adding a bookmark app to the desktop."> - Add to desktop - </message> - </if> - <if expr="use_titlecase and not is_macosx"> - <message name="IDS_ADD_TO_DESKTOP_BUBBLE_TITLE" desc="Title of the bubble for adding a bookmark app to the desktop."> - Add to Desktop - </message> - </if> <if expr="is_macosx"> - <message name="IDS_ADD_TO_DESKTOP_BUBBLE_TITLE" desc="Title of the bubble adding a bookmark app to the Applications Folder on Mac."> + <message name="IDS_ADD_TO_OS_LAUNCH_SURFACE_BUBBLE_TITLE" desc="In Title Case: Title of the bubble adding a bookmark app to the Applications Folder on Mac. Note `Applications` should match the name that appears under Favourites in Finder on macOS."> Add to Applications </message> </if> + <if expr="not use_ash and not is_macosx"> + <message name="IDS_ADD_TO_OS_LAUNCH_SURFACE_BUBBLE_TITLE" desc="Title of the bubble for adding a bookmark app to the desktop."> + Add to desktop + </message> + </if> <message name="IDS_BOOKMARK_APP_AX_BUBBLE_NAME_LABEL" desc="Text preceding the name of a bookmark app, read by spoken feedback."> Shortcut name @@ -1944,24 +1939,19 @@ </if> <!-- "Create application shortcuts" menu item --> - <if expr="is_macosx"> - <message name="IDS_ADD_TO_APPLICATIONS" desc="Button text for adding a bookmark app to the Applications Folder."> - Add to Applications... - </message> - </if> <if expr="use_ash"> - <message name="IDS_ADD_TO_SHELF" desc="Button text for adding a bookmark app to the shelf."> + <message name="IDS_ADD_TO_OS_LAUNCH_SURFACE" desc="Button text for adding a bookmark app to the shelf."> Add to shelf... </message> </if> - <if expr="not use_titlecase"> - <message name="IDS_ADD_TO_DESKTOP" desc="Button text for adding a bookmark app to the desktop."> - Add to desktop... + <if expr="is_macosx"> + <message name="IDS_ADD_TO_OS_LAUNCH_SURFACE" desc="In Title Case: Button text for adding a bookmark app to the Applications Folder. Note `Applications` should match the name that appears under Favourites in Finder on macOS"> + Add to Applications... </message> </if> - <if expr="use_titlecase"> - <message name="IDS_ADD_TO_DESKTOP" desc="Button text for adding a bookmark app to the desktop."> - Add to Desktop... + <if expr="not use_ash and not is_macosx"> + <message name="IDS_ADD_TO_OS_LAUNCH_SURFACE" desc="Button text for adding a bookmark app to the desktop."> + Add to desktop... </message> </if>
diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_startup_task_utils.cc index 8e8071b..aa7ce57 100644 --- a/chrome/browser/after_startup_task_utils.cc +++ b/chrome/browser/after_startup_task_utils.cc
@@ -34,13 +34,13 @@ namespace { struct AfterStartupTask { - AfterStartupTask(const tracked_objects::Location& from_here, + AfterStartupTask(const base::Location& from_here, const scoped_refptr<base::TaskRunner>& task_runner, base::OnceClosure task) : from_here(from_here), task_runner(task_runner), task(std::move(task)) {} ~AfterStartupTask() {} - const tracked_objects::Location from_here; + const base::Location from_here; const scoped_refptr<base::TaskRunner> task_runner; base::OnceClosure task; }; @@ -71,7 +71,7 @@ const int kMinDelaySec = 0; const int kMaxDelaySec = 10; scoped_refptr<base::TaskRunner> target_runner = queued_task->task_runner; - tracked_objects::Location from_here = queued_task->from_here; + base::Location from_here = queued_task->from_here; target_runner->PostDelayedTask( from_here, base::BindOnce(&RunTask, base::Passed(std::move(queued_task))), base::TimeDelta::FromSeconds(base::RandInt(kMinDelaySec, kMaxDelaySec))); @@ -215,7 +215,7 @@ AfterStartupTaskUtils::Runner::~Runner() = default; bool AfterStartupTaskUtils::Runner::PostDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { DCHECK(delay.is_zero()); @@ -234,7 +234,7 @@ } void AfterStartupTaskUtils::PostTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, const scoped_refptr<base::TaskRunner>& destination_runner, base::OnceClosure task) { if (IsBrowserStartupComplete()) {
diff --git a/chrome/browser/after_startup_task_utils.h b/chrome/browser/after_startup_task_utils.h index 95323525..e9c039c 100644 --- a/chrome/browser/after_startup_task_utils.h +++ b/chrome/browser/after_startup_task_utils.h
@@ -25,7 +25,7 @@ explicit Runner(scoped_refptr<base::TaskRunner> destination_runner); // Overrides from base::TaskRunner: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override; @@ -45,7 +45,7 @@ // for chrome. Tasks are queued until startup is complete. // Note: see browser_thread.h static void PostTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, const scoped_refptr<base::TaskRunner>& destination_runner, base::OnceClosure task);
diff --git a/chrome/browser/after_startup_task_utils_unittest.cc b/chrome/browser/after_startup_task_utils_unittest.cc index ff0a88a5..6f31639 100644 --- a/chrome/browser/after_startup_task_utils_unittest.cc +++ b/chrome/browser/after_startup_task_utils_unittest.cc
@@ -24,7 +24,7 @@ explicit WrappedTaskRunner(scoped_refptr<TaskRunner> real_runner) : real_task_runner_(std::move(real_runner)) {} - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { ++posted_task_count_; @@ -91,7 +91,7 @@ // Hop to the background sequence and call PostAfterStartupTask. void PostAfterStartupTaskFromBackgroundSequence( - const tracked_objects::Location& from_here, + const base::Location& from_here, scoped_refptr<base::TaskRunner> task_runner, base::OnceClosure task) { base::RunLoop run_loop;
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc index a1902ca..85d38d0a 100644 --- a/chrome/browser/android/vr_shell/vr_shell.cc +++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -260,7 +260,7 @@ g_instance = nullptr; } -void VrShell::PostToGlThread(const tracked_objects::Location& from_here, +void VrShell::PostToGlThread(const base::Location& from_here, const base::Closure& task) { gl_thread_->message_loop()->task_runner()->PostTask(from_here, task); }
diff --git a/chrome/browser/android/vr_shell/vr_shell.h b/chrome/browser/android/vr_shell/vr_shell.h index a7eae86..cdc7886c 100644 --- a/chrome/browser/android/vr_shell/vr_shell.h +++ b/chrome/browser/android/vr_shell/vr_shell.h
@@ -207,7 +207,7 @@ private: ~VrShell() override; - void PostToGlThread(const tracked_objects::Location& from_here, + void PostToGlThread(const base::Location& from_here, const base::Closure& task); void SetUiState();
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index d4c0cf59..82a5d58 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc
@@ -906,7 +906,7 @@ } void ChromeContentBrowserClient::PostAfterStartupTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, const scoped_refptr<base::TaskRunner>& task_runner, base::OnceClosure task) { AfterStartupTaskUtils::PostTask(from_here, task_runner, std::move(task));
diff --git a/chrome/browser/chrome_content_browser_client.h b/chrome/browser/chrome_content_browser_client.h index 6b861b2..450623b 100644 --- a/chrome/browser/chrome_content_browser_client.h +++ b/chrome/browser/chrome_content_browser_client.h
@@ -72,7 +72,7 @@ content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) override; - void PostAfterStartupTask(const tracked_objects::Location& from_here, + void PostAfterStartupTask(const base::Location& from_here, const scoped_refptr<base::TaskRunner>& task_runner, base::OnceClosure task) override; bool IsBrowserStartupComplete() override;
diff --git a/chrome/browser/chromeos/attestation/attestation_policy_observer.cc b/chrome/browser/chromeos/attestation/attestation_policy_observer.cc index 5b3b4a78..c3579514 100644 --- a/chrome/browser/chromeos/attestation/attestation_policy_observer.cc +++ b/chrome/browser/chromeos/attestation/attestation_policy_observer.cc
@@ -51,7 +51,7 @@ void DBusBoolRedirectCallback(const base::Closure& on_true, const base::Closure& on_false, const base::Closure& on_failure, - const tracked_objects::Location& from_here, + const base::Location& from_here, chromeos::DBusMethodCallStatus status, bool value) { if (status != chromeos::DBUS_METHOD_CALL_SUCCESS) { @@ -76,7 +76,7 @@ void DBusStringCallback( const base::Callback<void(const std::string&)> on_success, const base::Closure& on_failure, - const tracked_objects::Location& from_here, + const base::Location& from_here, chromeos::DBusMethodCallStatus status, bool result, const std::string& data) {
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.cc b/chrome/browser/chromeos/login/session/user_session_manager.cc index 3349ae9..af65a496 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.cc +++ b/chrome/browser/chromeos/login/session/user_session_manager.cc
@@ -1196,33 +1196,49 @@ // Call FinalizePrepareProfile directly and skip RestoreAuthSessionImpl // because there is no need to merge session for Active Directory users. base::ThreadTaskRunnerHandle::Get()->PostTask( - FROM_HERE, base::BindOnce(&UserSessionManager::FinalizePrepareProfile, - AsWeakPtr(), profile)); + FROM_HERE, + base::BindOnce(&UserSessionManager::PrepareTpmDeviceAndFinalizeProfile, + AsWeakPtr(), profile)); return; } - FinalizePrepareProfile(profile); + PrepareTpmDeviceAndFinalizeProfile(profile); } void UserSessionManager::CompleteProfileCreateAfterAuthTransfer( Profile* profile) { RestoreAuthSessionImpl(profile, has_auth_cookies_); + PrepareTpmDeviceAndFinalizeProfile(profile); +} + +void UserSessionManager::PrepareTpmDeviceAndFinalizeProfile(Profile* profile) { + BootTimesRecorder::Get()->AddLoginTimeMarker("TPMOwn-Start", false); + + // Own TPM device if, for any reason, it has not been done in EULA screen. + if (!cryptohome_util::TpmIsEnabled() || cryptohome_util::TpmIsBeingOwned()) { + FinalizePrepareProfile(profile); + return; + } + + VoidDBusMethodCallback callback = + base::BindOnce(&UserSessionManager::OnCryptohomeOperationCompleted, + AsWeakPtr(), profile); + CryptohomeClient* client = DBusThreadManager::Get()->GetCryptohomeClient(); + if (cryptohome_util::TpmIsOwned()) + client->TpmClearStoredPassword(std::move(callback)); + else + client->TpmCanAttemptOwnership(std::move(callback)); +} + +void UserSessionManager::OnCryptohomeOperationCompleted( + Profile* profile, + DBusMethodCallStatus call_status) { + DCHECK_EQ(DBUS_METHOD_CALL_SUCCESS, call_status); FinalizePrepareProfile(profile); } void UserSessionManager::FinalizePrepareProfile(Profile* profile) { - BootTimesRecorder* btl = BootTimesRecorder::Get(); - - // Own TPM device if, for any reason, it has not been done in EULA screen. - CryptohomeClient* client = DBusThreadManager::Get()->GetCryptohomeClient(); - btl->AddLoginTimeMarker("TPMOwn-Start", false); - if (cryptohome_util::TpmIsEnabled() && !cryptohome_util::TpmIsBeingOwned()) { - if (cryptohome_util::TpmIsOwned()) - client->CallTpmClearStoredPasswordAndBlock(); - else - client->TpmCanAttemptOwnership(EmptyVoidDBusMethodCallback()); - } - btl->AddLoginTimeMarker("TPMOwn-End", false); + BootTimesRecorder::Get()->AddLoginTimeMarker("TPMOwn-End", false); user_manager::UserManager* user_manager = user_manager::UserManager::Get(); if (user_manager->IsLoggedInAsUserWithGaiaAccount()) {
diff --git a/chrome/browser/chromeos/login/session/user_session_manager.h b/chrome/browser/chromeos/login/session/user_session_manager.h index 5e9ab645..a319760 100644 --- a/chrome/browser/chromeos/login/session/user_session_manager.h +++ b/chrome/browser/chromeos/login/session/user_session_manager.h
@@ -316,6 +316,14 @@ // the authentication profile. void CompleteProfileCreateAfterAuthTransfer(Profile* profile); + // Asynchronously prepares TPM devices and calls FinalizePrepareProfile on UI + // thread. + void PrepareTpmDeviceAndFinalizeProfile(Profile* profile); + + // Called on UI thread once Cryptohome operation completes. + void OnCryptohomeOperationCompleted(Profile* profile, + DBusMethodCallStatus call_status); + // Finalized profile preparation. void FinalizePrepareProfile(Profile* profile);
diff --git a/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc b/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc index a04b029..1dcb01e 100644 --- a/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc +++ b/chrome/browser/chromeos/login/users/fake_chrome_user_manager.cc
@@ -39,7 +39,7 @@ private: // base::TaskRunner overrides. - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { std::move(task).Run();
diff --git a/chrome/browser/chromeos/login/users/mock_user_manager.cc b/chrome/browser/chromeos/login/users/mock_user_manager.cc index ce927cde..0ead43d 100644 --- a/chrome/browser/chromeos/login/users/mock_user_manager.cc +++ b/chrome/browser/chromeos/login/users/mock_user_manager.cc
@@ -12,7 +12,7 @@ class FakeTaskRunner : public base::TaskRunner { public: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { std::move(task).Run();
diff --git a/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc b/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc index 81c8c05..c8bf905 100644 --- a/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc +++ b/chrome/browser/chromeos/platform_keys/platform_keys_nss.cc
@@ -80,7 +80,7 @@ // Called if an error occurred during the execution of the NSS operation // described by this object. - virtual void OnError(const tracked_objects::Location& from, + virtual void OnError(const base::Location& from, const std::string& error_message) = 0; crypto::ScopedPK11Slot slot_; @@ -163,12 +163,12 @@ const subtle::GenerateKeyCallback& callback); ~GenerateRSAKeyState() override {} - void OnError(const tracked_objects::Location& from, + void OnError(const base::Location& from, const std::string& error_message) override { CallBack(from, std::string() /* no public key */, error_message); } - void CallBack(const tracked_objects::Location& from, + void CallBack(const base::Location& from, const std::string& public_key_spki_der, const std::string& error_message) { origin_task_runner_->PostTask( @@ -191,12 +191,12 @@ const subtle::SignCallback& callback); ~SignRSAState() override {} - void OnError(const tracked_objects::Location& from, + void OnError(const base::Location& from, const std::string& error_message) override { CallBack(from, std::string() /* no signature */, error_message); } - void CallBack(const tracked_objects::Location& from, + void CallBack(const base::Location& from, const std::string& signature, const std::string& error_message) { origin_task_runner_->PostTask( @@ -232,13 +232,13 @@ const subtle::SelectCertificatesCallback& callback); ~SelectCertificatesState() override {} - void OnError(const tracked_objects::Location& from, + void OnError(const base::Location& from, const std::string& error_message) override { CallBack(from, std::unique_ptr<net::CertificateList>() /* no matches */, error_message); } - void CallBack(const tracked_objects::Location& from, + void CallBack(const base::Location& from, std::unique_ptr<net::CertificateList> matches, const std::string& error_message) { origin_task_runner_->PostTask( @@ -260,14 +260,14 @@ explicit GetCertificatesState(const GetCertificatesCallback& callback); ~GetCertificatesState() override {} - void OnError(const tracked_objects::Location& from, + void OnError(const base::Location& from, const std::string& error_message) override { CallBack(from, std::unique_ptr<net::CertificateList>() /* no certificates */, error_message); } - void CallBack(const tracked_objects::Location& from, + void CallBack(const base::Location& from, std::unique_ptr<net::CertificateList> certs, const std::string& error_message) { origin_task_runner_->PostTask( @@ -287,13 +287,12 @@ const ImportCertificateCallback& callback); ~ImportCertificateState() override {} - void OnError(const tracked_objects::Location& from, + void OnError(const base::Location& from, const std::string& error_message) override { CallBack(from, error_message); } - void CallBack(const tracked_objects::Location& from, - const std::string& error_message) { + void CallBack(const base::Location& from, const std::string& error_message) { origin_task_runner_->PostTask(from, base::Bind(callback_, error_message)); } @@ -310,13 +309,12 @@ const RemoveCertificateCallback& callback); ~RemoveCertificateState() override {} - void OnError(const tracked_objects::Location& from, + void OnError(const base::Location& from, const std::string& error_message) override { CallBack(from, error_message); } - void CallBack(const tracked_objects::Location& from, - const std::string& error_message) { + void CallBack(const base::Location& from, const std::string& error_message) { origin_task_runner_->PostTask(from, base::Bind(callback_, error_message)); } @@ -332,14 +330,14 @@ explicit GetTokensState(const GetTokensCallback& callback); ~GetTokensState() override {} - void OnError(const tracked_objects::Location& from, + void OnError(const base::Location& from, const std::string& error_message) override { CallBack(from, std::unique_ptr<std::vector<std::string>>() /* no token ids */, error_message); } - void CallBack(const tracked_objects::Location& from, + void CallBack(const base::Location& from, std::unique_ptr<std::vector<std::string>> token_ids, const std::string& error_message) { origin_task_runner_->PostTask(
diff --git a/chrome/browser/data_usage/tab_id_provider.cc b/chrome/browser/data_usage/tab_id_provider.cc index 52debf16..3d49f13 100644 --- a/chrome/browser/data_usage/tab_id_provider.cc +++ b/chrome/browser/data_usage/tab_id_provider.cc
@@ -76,7 +76,7 @@ }; TabIdProvider::TabIdProvider(base::TaskRunner* task_runner, - const tracked_objects::Location& from_here, + const base::Location& from_here, const TabIdGetter& tab_id_getter) : is_tab_info_ready_(false), tab_info_(-1), weak_ptr_factory_(this) { std::unique_ptr<CallbackRunner> callback_runner(new CallbackRunner());
diff --git a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc index 2e8594e7..3141855 100644 --- a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc
@@ -107,7 +107,7 @@ // syncer::SyncChangeProcessor implementation. syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override { if (fail_all_requests_) { return syncer::SyncError( @@ -256,7 +256,7 @@ } template <typename Func> - void PostOnBackendSequenceAndWait(const tracked_objects::Location& from_here, + void PostOnBackendSequenceAndWait(const base::Location& from_here, Func func) { GetBackendTaskRunner()->PostTask( from_here, base::Bind(&ExtensionSettingsSyncTest::RunFunc<Func>, func));
diff --git a/chrome/browser/extensions/api/storage/sync_storage_backend.cc b/chrome/browser/extensions/api/storage/sync_storage_backend.cc index 86aa995..73ab825 100644 --- a/chrome/browser/extensions/api/storage/sync_storage_backend.cc +++ b/chrome/browser/extensions/api/storage/sync_storage_backend.cc
@@ -227,7 +227,7 @@ } syncer::SyncError SyncStorageBackend::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& sync_changes) { DCHECK(IsOnBackendSequence()); DCHECK(sync_processor_.get());
diff --git a/chrome/browser/extensions/api/storage/sync_storage_backend.h b/chrome/browser/extensions/api/storage/sync_storage_backend.h index e3b61ed..6eeaadb 100644 --- a/chrome/browser/extensions/api/storage/sync_storage_backend.h +++ b/chrome/browser/extensions/api/storage/sync_storage_backend.h
@@ -55,7 +55,7 @@ std::unique_ptr<syncer::SyncChangeProcessor> sync_processor, std::unique_ptr<syncer::SyncErrorFactory> sync_error_factory) override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; void StopSyncing(syncer::ModelType type) override;
diff --git a/chrome/browser/extensions/extension_service_sync_unittest.cc b/chrome/browser/extensions/extension_service_sync_unittest.cc index cd1ac904..ba2d365 100644 --- a/chrome/browser/extensions/extension_service_sync_unittest.cc +++ b/chrome/browser/extensions/extension_service_sync_unittest.cc
@@ -148,7 +148,7 @@ // the FakeSyncChangeProcessor's SyncDataList as a map keyed by extension // id. syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override { syncer::FakeSyncChangeProcessor::ProcessSyncChanges(from_here, change_list); for (const auto& change : change_list) {
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc index 27685b7..d30af03 100644 --- a/chrome/browser/extensions/extension_sync_service.cc +++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -252,7 +252,7 @@ } syncer::SyncError ExtensionSyncService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { for (const syncer::SyncChange& sync_change : change_list) { std::unique_ptr<ExtensionSyncData> extension_sync_data(
diff --git a/chrome/browser/extensions/extension_sync_service.h b/chrome/browser/extensions/extension_sync_service.h index 413a49e0..efa3be4 100644 --- a/chrome/browser/extensions/extension_sync_service.h +++ b/chrome/browser/extensions/extension_sync_service.h
@@ -62,7 +62,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; void SetSyncStartFlareForTesting(
diff --git a/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.cc b/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.cc index 0990e47..ee97a4236 100644 --- a/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.cc +++ b/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.cc
@@ -367,13 +367,9 @@ MTPDeviceDelegateImplLinux::PendingTaskInfo::PendingTaskInfo( const base::FilePath& path, content::BrowserThread::ID thread_id, - const tracked_objects::Location& location, + const base::Location& location, const base::Closure& task) - : path(path), - thread_id(thread_id), - location(location), - task(task) { -} + : path(path), thread_id(thread_id), location(location), task(task) {} MTPDeviceDelegateImplLinux::PendingTaskInfo::PendingTaskInfo( const PendingTaskInfo& other) = default;
diff --git a/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.h b/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.h index 3bd4773a..31c12d06 100644 --- a/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.h +++ b/chrome/browser/media_galleries/chromeos/mtp_device_delegate_impl_chromeos.h
@@ -48,7 +48,7 @@ struct PendingTaskInfo { PendingTaskInfo(const base::FilePath& path, content::BrowserThread::ID thread_id, - const tracked_objects::Location& location, + const base::Location& location, const base::Closure& task); PendingTaskInfo(const PendingTaskInfo& other); ~PendingTaskInfo(); @@ -56,7 +56,7 @@ base::FilePath path; base::FilePath cached_path; const content::BrowserThread::ID thread_id; - const tracked_objects::Location location; + const base::Location location; const base::Closure task; };
diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc index 9de2e33c..76d2560 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc
@@ -350,13 +350,10 @@ } MTPDeviceDelegateImplWin::PendingTaskInfo::PendingTaskInfo( - const tracked_objects::Location& location, + const base::Location& location, const base::Callback<base::File::Error(void)>& task, const base::Callback<void(base::File::Error)>& reply) - : location(location), - task(task), - reply(reply) { -} + : location(location), task(task), reply(reply) {} MTPDeviceDelegateImplWin::PendingTaskInfo::PendingTaskInfo( const PendingTaskInfo& other) = default;
diff --git a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h index c1f7b24..becddda 100644 --- a/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h +++ b/chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h
@@ -73,13 +73,13 @@ // Used to represent pending task details. struct PendingTaskInfo { - PendingTaskInfo(const tracked_objects::Location& location, + PendingTaskInfo(const base::Location& location, const base::Callback<base::File::Error(void)>& task, const base::Callback<void(base::File::Error)>& reply); PendingTaskInfo(const PendingTaskInfo& other); ~PendingTaskInfo(); - const tracked_objects::Location location; + const base::Location location; const base::Callback<base::File::Error(void)> task; const base::Callback<void(base::File::Error)> reply; };
diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc index 10dc904..fce991e 100644 --- a/chrome/browser/metrics/thread_watcher.cc +++ b/chrome/browser/metrics/thread_watcher.cc
@@ -744,23 +744,22 @@ } // static -bool WatchDogThread::PostTask(const tracked_objects::Location& from_here, +bool WatchDogThread::PostTask(const base::Location& from_here, const base::Closure& task) { return PostTaskHelper(from_here, task, base::TimeDelta()); } // static -bool WatchDogThread::PostDelayedTask(const tracked_objects::Location& from_here, +bool WatchDogThread::PostDelayedTask(const base::Location& from_here, const base::Closure& task, base::TimeDelta delay) { return PostTaskHelper(from_here, task, delay); } // static -bool WatchDogThread::PostTaskHelper( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) { +bool WatchDogThread::PostTaskHelper(const base::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) { { base::AutoLock lock(g_watchdog_lock.Get());
diff --git a/chrome/browser/metrics/thread_watcher.h b/chrome/browser/metrics/thread_watcher.h index 4a50cff..69451fa6 100644 --- a/chrome/browser/metrics/thread_watcher.h +++ b/chrome/browser/metrics/thread_watcher.h
@@ -576,9 +576,9 @@ // They return true iff the watchdog thread existed and the task was posted. // Note that even if the task is posted, there's no guarantee that it will // run, since the target thread may already have a Quit message in its queue. - static bool PostTask(const tracked_objects::Location& from_here, + static bool PostTask(const base::Location& from_here, const base::Closure& task); - static bool PostDelayedTask(const tracked_objects::Location& from_here, + static bool PostDelayedTask(const base::Location& from_here, const base::Closure& task, base::TimeDelta delay); @@ -590,10 +590,9 @@ // This method returns true if Init() is called. bool Started() const; - static bool PostTaskHelper( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay); + static bool PostTaskHelper(const base::Location& from_here, + const base::Closure& task, + base::TimeDelta delay); DISALLOW_COPY_AND_ASSIGN(WatchDogThread); };
diff --git a/chrome/browser/notifications/notification_permission_context.cc b/chrome/browser/notifications/notification_permission_context.cc index d3cd3690..f242f0f 100644 --- a/chrome/browser/notifications/notification_permission_context.cc +++ b/chrome/browser/notifications/notification_permission_context.cc
@@ -36,7 +36,7 @@ // Runs |task| after the WebContents has been visible for a consecutive // duration of at least |visible_delay|. - void PostTaskAfterVisibleDelay(const tracked_objects::Location& from_here, + void PostTaskAfterVisibleDelay(const base::Location& from_here, const base::Closure& task, base::TimeDelta visible_delay, const PermissionRequestID& id); @@ -98,7 +98,7 @@ } void VisibilityTimerTabHelper::PostTaskAfterVisibleDelay( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task, base::TimeDelta visible_delay, const PermissionRequestID& id) {
diff --git a/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc b/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc index c179e06..d10ab2d 100644 --- a/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc +++ b/chrome/browser/notifications/notification_platform_bridge_linux_unittest.cc
@@ -165,7 +165,8 @@ ACTION_P(RegisterSignalCallback, callback_addr) { *callback_addr = arg2; - arg3.Run("" /* interface_name */, "" /* signal_name */, true /* success */); + std::move(*arg3).Run("" /* interface_name */, "" /* signal_name */, + true /* success */); } ACTION_P2(OnNotify, verifier, id) { @@ -242,14 +243,14 @@ .WillOnce(Return(ByMove(std::move(response)))); if (connect_signals) { - EXPECT_CALL( - *mock_notification_proxy_.get(), - ConnectToSignal(kFreedesktopNotificationsName, "ActionInvoked", _, _)) + EXPECT_CALL(*mock_notification_proxy_.get(), + DoConnectToSignal(kFreedesktopNotificationsName, + "ActionInvoked", _, _)) .WillOnce(RegisterSignalCallback(&action_invoked_callback_)); EXPECT_CALL(*mock_notification_proxy_.get(), - ConnectToSignal(kFreedesktopNotificationsName, - "NotificationClosed", _, _)) + DoConnectToSignal(kFreedesktopNotificationsName, + "NotificationClosed", _, _)) .WillOnce(RegisterSignalCallback(¬ification_closed_callback_)); }
diff --git a/chrome/browser/permissions/permission_request_manager.cc b/chrome/browser/permissions/permission_request_manager.cc index ff752d8..45116a5b 100644 --- a/chrome/browser/permissions/permission_request_manager.cc +++ b/chrome/browser/permissions/permission_request_manager.cc
@@ -117,14 +117,10 @@ view_factory_(base::Bind(&PermissionPrompt::Create)), view_(nullptr), main_frame_has_fully_loaded_(false), - tab_can_show_prompts_(false), + tab_can_show_prompts_(web_contents->IsVisible()), persist_(true), auto_response_for_test_(NONE), - weak_factory_(this) { -#if defined(OS_ANDROID) - tab_can_show_prompts_ = true; -#endif -} + weak_factory_(this) {} PermissionRequestManager::~PermissionRequestManager() { DCHECK(requests_.empty()); @@ -229,13 +225,6 @@ NOTREACHED(); // Callers should not cancel requests that are not pending. } -void PermissionRequestManager::HideBubble() { - tab_can_show_prompts_ = false; - - if (view_) - DeleteBubble(); -} - void PermissionRequestManager::DisplayPendingRequests() { tab_can_show_prompts_ = true; @@ -246,7 +235,11 @@ DequeueRequestsAndShowBubble(); } else { // We switched tabs away and back while a prompt was active. +#if defined(OS_ANDROID) + DCHECK(view_); +#else ShowBubble(); +#endif } } @@ -304,6 +297,19 @@ // returning from this function is the only safe thing to do. } +void PermissionRequestManager::WasShown() { + DisplayPendingRequests(); +} + +void PermissionRequestManager::WasHidden() { + tab_can_show_prompts_ = false; + +#if !defined(OS_ANDROID) + if (view_) + DeleteBubble(); +#endif +} + const std::vector<PermissionRequest*>& PermissionRequestManager::Requests() { return requests_; }
diff --git a/chrome/browser/permissions/permission_request_manager.h b/chrome/browser/permissions/permission_request_manager.h index cd1ae65..a6b8cbc 100644 --- a/chrome/browser/permissions/permission_request_manager.h +++ b/chrome/browser/permissions/permission_request_manager.h
@@ -75,14 +75,9 @@ // at which time the caller is free to delete the request. void CancelRequest(PermissionRequest* request); - // Temporarily hides the bubble, and destroys the prompt UI surface. Any - // existing requests will be reshown when DisplayPendingRequests is called - // (e.g. when switching tabs away and back to a page with a prompt). - // TODO(timloh): Rename this to something more fitting (e.g. TabSwitchedAway). - void HideBubble(); - // Will show a permission bubble if there is a pending permission request on // the web contents that the PermissionRequestManager belongs to. + // TODO(timloh): Remove this from the public API. void DisplayPendingRequests(); // Will reposition the bubble (may change parent if necessary). @@ -131,6 +126,8 @@ void DocumentLoadedInFrame( content::RenderFrameHost* render_frame_host) override; void WebContentsDestroyed() override; + void WasShown() override; + void WasHidden() override; // PermissionPrompt::Delegate: const std::vector<PermissionRequest*>& Requests() override; @@ -184,10 +181,11 @@ PermissionPrompt::Factory view_factory_; // The UI surface for an active permission prompt if we're displaying one. + // On Desktop, we destroy this upon tab switching, while on Android we keep + // the object alive. The infobar system hides the actual infobar UI and modals + // prevent tab switching. std::unique_ptr<PermissionPrompt> view_; - // We only show prompts when both of these are true. On Desktop, we hide any - // active prompt on tab switching, while on Android we let the infobar system - // handle it. + // We only show new prompts when both of these are true. bool main_frame_has_fully_loaded_; bool tab_can_show_prompts_;
diff --git a/chrome/browser/permissions/permission_request_manager_unittest.cc b/chrome/browser/permissions/permission_request_manager_unittest.cc index a3b39c5..76d96e4b 100644 --- a/chrome/browser/permissions/permission_request_manager_unittest.cc +++ b/chrome/browser/permissions/permission_request_manager_unittest.cc
@@ -95,9 +95,9 @@ base::RunLoop().RunUntilIdle(); } - void MockTabSwitchAway() { manager_->HideBubble(); } + void MockTabSwitchAway() { manager_->WasHidden(); } - void MockTabSwitchBack() { manager_->DisplayPendingRequests(); } + void MockTabSwitchBack() { manager_->WasShown(); } virtual void NavigationEntryCommitted( const content::LoadCommittedDetails& details) { @@ -193,7 +193,11 @@ ASSERT_EQ(prompt_factory_->request_count(), 2); MockTabSwitchAway(); +#if defined(OS_ANDROID) + EXPECT_TRUE(prompt_factory_->is_visible()); +#else EXPECT_FALSE(prompt_factory_->is_visible()); +#endif MockTabSwitchBack(); WaitForBubbleToBeShown(); @@ -211,7 +215,11 @@ WaitForBubbleToBeShown(); EXPECT_TRUE(prompt_factory_->is_visible()); MockTabSwitchAway(); +#if defined(OS_ANDROID) + EXPECT_TRUE(prompt_factory_->is_visible()); +#else EXPECT_FALSE(prompt_factory_->is_visible()); +#endif manager_->CancelRequest(&request1_); EXPECT_TRUE(request1_.finished()); } @@ -222,14 +230,16 @@ EXPECT_FALSE(prompt_factory_->is_visible()); } -#if !defined(OS_ANDROID) TEST_F(PermissionRequestManagerTest, PermissionRequestWhileTabSwitchedAway) { + MockTabSwitchAway(); manager_->AddRequest(&request1_); - // Don't mark the tab as active. WaitForBubbleToBeShown(); EXPECT_FALSE(prompt_factory_->is_visible()); + + MockTabSwitchBack(); + WaitForBubbleToBeShown(); + EXPECT_TRUE(prompt_factory_->is_visible()); } -#endif TEST_F(PermissionRequestManagerTest, TwoRequestsDoNotCoalesce) { manager_->DisplayPendingRequests();
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc index c0b285d4..a8ea05a 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_tables.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_tables.cc
@@ -184,7 +184,7 @@ } void ResourcePrefetchPredictorTables::ScheduleDBTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, DBTask task) { GetTaskRunner()->PostTask( from_here,
diff --git a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc index 70b8654f..798d8d0 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc
@@ -69,8 +69,7 @@ scoped_refptr<base::SequencedTaskRunner> db_task_runner) : ResourcePrefetchPredictorTables(std::move(db_task_runner)) {} - void ScheduleDBTask(const tracked_objects::Location& from_here, - DBTask task) override { + void ScheduleDBTask(const base::Location& from_here, DBTask task) override { ExecuteDBTaskOnDBSequence(std::move(task)); }
diff --git a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc index f287e72d..c37a82da 100644 --- a/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc +++ b/chrome/browser/prerender/prerender_nostate_prefetch_browsertest.cc
@@ -29,6 +29,7 @@ #include "content/public/browser/appcache_service.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/storage_partition.h" +#include "content/public/common/content_features.h" #include "content/public/common/result_codes.h" #include "content/public/common/url_constants.h" #include "content/public/test/browser_test_utils.h" @@ -66,9 +67,18 @@ "prerender/prefetch_subresource_redirect.html"; class NoStatePrefetchBrowserTest - : public test_utils::PrerenderInProcessBrowserTest { + : public test_utils::PrerenderInProcessBrowserTest, + public testing::WithParamInterface<bool> { public: - NoStatePrefetchBrowserTest() {} + NoStatePrefetchBrowserTest() { + if (GetParam()) { + feature_list_.InitAndEnableFeature( + features::kKeepAliveRendererForKeepaliveRequests); + } else { + feature_list_.InitAndDisableFeature( + features::kKeepAliveRendererForKeepaliveRequests); + } + } void SetUpOnMainThread() override { test_utils::PrerenderInProcessBrowserTest::SetUpOnMainThread(); @@ -191,12 +201,14 @@ callback); } + base::test::ScopedFeatureList feature_list_; + DISALLOW_COPY_AND_ASSIGN(NoStatePrefetchBrowserTest); }; // Checks that a page is correctly prefetched in the case of a // <link rel=prerender> tag and the JavaScript on the page is not executed. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchSimple) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchSimple) { RequestCounter main_counter; CountRequestFor(kPrefetchPage, &main_counter); RequestCounter script_counter; @@ -215,7 +227,7 @@ } // Check that the LOAD_PREFETCH flag is set. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchLoadFlag) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchLoadFlag) { RequestCounter main_counter; RequestCounter script_counter; auto verify_prefetch_only = base::Bind([](net::URLRequest* request) { @@ -242,7 +254,7 @@ // histograms. Note that other histogram testing is done in // browser/page_load_metrics, in particular, testing the combinations of // Warm/Cold and Cacheable/NoCacheable. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchHistograms) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchHistograms) { PrefetchFromFile(kPrefetchPage, FINAL_STATUS_NOSTATE_PREFETCH_FINISHED); histogram_tester().ExpectTotalCount( "Prerender.websame_PrefetchTTFCP.Warm.Cacheable.Visible", 0); @@ -262,7 +274,7 @@ } // Checks the prefetch of an img tag. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchImage) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchImage) { RequestCounter image_counter; CountRequestFor(kPrefetchJpeg, &image_counter); GURL main_page_url = @@ -273,7 +285,7 @@ } // Checks that a cross-domain prefetching works correctly. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchCrossDomain) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchCrossDomain) { static const std::string secondary_domain = "www.foo.com"; GURL cross_domain_url(base::StringPrintf( "http://%s:%d/%s", secondary_domain.c_str(), @@ -285,7 +297,7 @@ } // Checks that response header CSP is respected. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, ResponseHeaderCSP) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, ResponseHeaderCSP) { static const std::string secondary_domain = "foo.bar"; RequestCounter main_page; CountRequestFor(kPrefetchResponseHeaderCSP, &main_page); @@ -306,7 +318,7 @@ // Checks that CSP in the meta tag cancels the prefetch. // TODO(mattcary): probably this behavior should be consistent with // response-header CSP. See crbug/656581. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, MetaTagCSP) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, MetaTagCSP) { static const std::string secondary_domain = "foo.bar"; RequestCounter main_page; CountRequestFor(kPrefetchMetaCSP, &main_page); @@ -326,7 +338,7 @@ // Checks that the second prefetch request succeeds. This test waits for // Prerender Stop before starting the second request. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchMultipleRequest) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchMultipleRequest) { RequestCounter first_main_counter; CountRequestFor(kPrefetchPage, &first_main_counter); RequestCounter second_main_counter; @@ -346,7 +358,7 @@ // Checks that a second prefetch request, started before the first stops, // succeeds. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchSimultaneous) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchSimultaneous) { RequestCounter second_main_counter; CountRequestFor(kPrefetchPage2, &second_main_counter); RequestCounter second_script_counter; @@ -373,13 +385,13 @@ } // Checks a prefetch to a nonexisting page. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchNonexisting) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchNonexisting) { std::unique_ptr<TestPrerender> test_prerender = PrefetchFromFile( "nonexisting-page.html", FINAL_STATUS_UNSUPPORTED_SCHEME); } // Checks that a 301 redirect is followed. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, Prefetch301Redirect) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, Prefetch301Redirect) { RequestCounter script_counter; CountRequestFor(kPrefetchScript, &script_counter); PrefetchFromFile( @@ -391,7 +403,7 @@ // Checks that the load flags are set correctly for all resources in a 301 // redirect chain. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, Prefetch301LoadFlags) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, Prefetch301LoadFlags) { std::string redirect_path = "/server-redirect/?" + net::EscapeQueryParamValue(MakeAbsolute(kPrefetchPage), false); @@ -412,7 +424,7 @@ } // Checks that a subresource 301 redirect is followed. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, Prefetch301Subresource) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, Prefetch301Subresource) { RequestCounter script_counter; CountRequestFor(kPrefetchScript, &script_counter); PrefetchFromFile(kPrefetchSubresourceRedirectPage, @@ -421,7 +433,7 @@ } // Checks a client redirect is not followed. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchClientRedirect) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchClientRedirect) { RequestCounter script_counter; CountRequestFor(kPrefetchScript, &script_counter); // A complete load of kPrefetchPage2 is used as a sentinal. Otherwise the test @@ -439,7 +451,7 @@ script_counter.WaitForCount(0); } -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, PrefetchHttps) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrefetchHttps) { UseHttpsSrcServer(); RequestCounter main_counter; CountRequestFor(kPrefetchPage, &main_counter); @@ -451,7 +463,7 @@ } // Checks that an SSL error prevents prefetch. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, SSLError) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, SSLError) { // Only send the loaded page, not the loader, through SSL. net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS); https_server.SetSSLConfig(net::EmbeddedTestServer::CERT_MISMATCHED_NAME); @@ -465,7 +477,7 @@ // Checks that a subresource failing SSL does not prevent prefetch on the rest // of the page. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, SSLSubresourceError) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, SSLSubresourceError) { // First confirm that the image loads as expected. // A separate HTTPS server is started for the subresource; src_server() is @@ -488,7 +500,7 @@ script_counter.WaitForCount(1); } -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, Loop) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, Loop) { RequestCounter script_counter; CountRequestFor(kPrefetchScript, &script_counter); RequestCounter main_counter; @@ -500,7 +512,7 @@ script_counter.WaitForCount(1); } -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, RendererCrash) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, RendererCrash) { // Navigate to about:blank to get the session storage namespace. ui_test_utils::NavigateToURL(current_browser(), GURL(url::kAboutBlankURL)); content::SessionStorageNamespace* storage_namespace = @@ -523,7 +535,7 @@ } // Checks that the prefetch of png correctly loads the png. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, Png) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, Png) { RequestCounter counter; CountRequestFor(kPrefetchPng, &counter); PrefetchFromFile(kPrefetchPng, FINAL_STATUS_NOSTATE_PREFETCH_FINISHED); @@ -531,7 +543,7 @@ } // Checks that the prefetch of png correctly loads the jpeg. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, Jpeg) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, Jpeg) { RequestCounter counter; CountRequestFor(kPrefetchJpeg, &counter); PrefetchFromFile(kPrefetchJpeg, FINAL_STATUS_NOSTATE_PREFETCH_FINISHED); @@ -539,7 +551,7 @@ } // If the main resource is unsafe, the whole prefetch is cancelled. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrerenderSafeBrowsingTopLevel) { GURL url = src_server()->GetURL(MakeAbsolute(kPrefetchPage)); GetFakeSafeBrowsingDatabaseManager()->SetThreatTypeForUrl( @@ -561,7 +573,7 @@ } // If a subresource is unsafe, the corresponding request is cancelled. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, PrerenderSafeBrowsingSubresource) { GURL url = src_server()->GetURL(MakeAbsolute(kPrefetchScript)); GetFakeSafeBrowsingDatabaseManager()->SetThreatTypeForUrl( @@ -580,7 +592,7 @@ } // Checks that prefetching a page does not add it to browsing history. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, HistoryUntouchedByPrefetch) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, HistoryUntouchedByPrefetch) { // Initialize. Profile* profile = current_browser()->profile(); ASSERT_TRUE(profile); @@ -610,7 +622,7 @@ } // Checks that prefetch requests have net::IDLE priority. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, IssuesIdlePriorityRequests) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, IssuesIdlePriorityRequests) { GURL script_url = src_server()->GetURL(MakeAbsolute(kPrefetchScript)); RequestCounter script_counter; prerender::test_utils::InterceptRequestAndCount( @@ -630,7 +642,7 @@ // Checks that a registered ServiceWorker (SW) that is not currently running // will intercepts a prefetch request. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, ServiceWorkerIntercept) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, ServiceWorkerIntercept) { // Register and launch a SW. base::string16 expected_title = base::ASCIIToUTF16("SW READY"); content::TitleWatcher title_watcher(GetActiveWebContents(), expected_title); @@ -670,7 +682,7 @@ // Checks that prefetching happens if an appcache is mentioned in the html tag // but is uninitialized. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, AppCacheHtmlUninitialized) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, AppCacheHtmlUninitialized) { RequestCounter image_counter; CountRequestFor(kPrefetchPng, &image_counter); PrefetchFromFile(kPrefetchAppcache, FINAL_STATUS_NOSTATE_PREFETCH_FINISHED); @@ -679,7 +691,7 @@ // Checks that prefetching does not if an initialized appcache is mentioned in // the html tag. -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, AppCacheHtmlInitialized) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, AppCacheHtmlInitialized) { base::TimeTicks current_time = GetPrerenderManager()->GetCurrentTimeTicks(); auto* clock = OverridePrerenderManagerTimeTicks(); // Some navigations have already occurred in test setup. In order to track @@ -725,7 +737,7 @@ #else #define MAYBE_AppCacheRegistered AppCacheRegistered #endif -IN_PROC_BROWSER_TEST_F(NoStatePrefetchBrowserTest, MAYBE_AppCacheRegistered) { +IN_PROC_BROWSER_TEST_P(NoStatePrefetchBrowserTest, MAYBE_AppCacheRegistered) { base::TimeTicks current_time = GetPrerenderManager()->GetCurrentTimeTicks(); auto* clock = OverridePrerenderManagerTimeTicks(); // Some navigations have already occurred in test setup. In order to track @@ -764,4 +776,8 @@ page_counter.WaitForCount(0); } +INSTANTIATE_TEST_CASE_P(NoStatePrefetchBrowserTest, + NoStatePrefetchBrowserTest, + ::testing::Values(false, true)); + } // namespace prerender
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc index a884d98..445e383 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc
@@ -353,7 +353,7 @@ return thread_.IsRunning(); } -bool PrintJobWorker::PostTask(const tracked_objects::Location& from_here, +bool PrintJobWorker::PostTask(const base::Location& from_here, const base::Closure& task) { if (task_runner_.get()) return task_runner_->PostTask(from_here, task);
diff --git a/chrome/browser/printing/print_job_worker.h b/chrome/browser/printing/print_job_worker.h index f11ae6b..e5a63ee5 100644 --- a/chrome/browser/printing/print_job_worker.h +++ b/chrome/browser/printing/print_job_worker.h
@@ -75,8 +75,7 @@ bool IsRunning() const; // Posts the given task to be run. - bool PostTask(const tracked_objects::Location& from_here, - const base::Closure& task); + bool PostTask(const base::Location& from_here, const base::Closure& task); // Signals the thread to exit in the near future. void StopSoon();
diff --git a/chrome/browser/printing/print_job_worker_owner.cc b/chrome/browser/printing/print_job_worker_owner.cc index ea08de2..60b8473 100644 --- a/chrome/browser/printing/print_job_worker_owner.cc +++ b/chrome/browser/printing/print_job_worker_owner.cc
@@ -20,7 +20,7 @@ return task_runner_->RunsTasksInCurrentSequence(); } -bool PrintJobWorkerOwner::PostTask(const tracked_objects::Location& from_here, +bool PrintJobWorkerOwner::PostTask(const base::Location& from_here, const base::Closure& task) { return task_runner_->PostTask(from_here, task); }
diff --git a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc index 09d5d8f..1a5341ed 100644 --- a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc +++ b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc
@@ -84,7 +84,7 @@ return profile_path; } - void SetupDefaultProfileShortcut(const tracked_objects::Location& location) { + void SetupDefaultProfileShortcut(const base::Location& location) { ASSERT_EQ(0u, profile_attributes_storage_->GetNumberOfProfiles()) << location.ToString(); ASSERT_FALSE(ProfileShortcutExistsAtDefaultPath(profile_1_name_)) @@ -100,7 +100,7 @@ ValidateNonProfileShortcut(location); } - void SetupAndCreateTwoShortcuts(const tracked_objects::Location& location) { + void SetupAndCreateTwoShortcuts(const base::Location& location) { SetupDefaultProfileShortcut(location); CreateProfileWithShortcut(location, profile_2_name_, profile_2_path_); ValidateProfileShortcut(location, profile_1_name_, profile_1_path_); @@ -122,7 +122,7 @@ // Posts a task to call base::win::ValidateShortcut on the COM thread. void PostValidateShortcut( - const tracked_objects::Location& location, + const base::Location& location, const base::FilePath& shortcut_path, const base::win::ShortcutProperties& expected_properties) { base::CreateCOMSTATaskRunnerWithTraits({})->PostTask( @@ -133,7 +133,7 @@ // Calls base::win::ValidateShortcut() with expected properties for the // shortcut at |shortcut_path| for the profile at |profile_path|. - void ValidateProfileShortcutAtPath(const tracked_objects::Location& location, + void ValidateProfileShortcutAtPath(const base::Location& location, const base::FilePath& shortcut_path, const base::FilePath& profile_path) { EXPECT_TRUE(base::PathExists(shortcut_path)) << location.ToString(); @@ -157,16 +157,15 @@ // Calls base::win::ValidateShortcut() with expected properties for // |profile_name|'s shortcut. - void ValidateProfileShortcut(const tracked_objects::Location& location, + void ValidateProfileShortcut(const base::Location& location, const base::string16& profile_name, const base::FilePath& profile_path) { ValidateProfileShortcutAtPath( location, GetDefaultShortcutPathForProfile(profile_name), profile_path); } - void ValidateNonProfileShortcutAtPath( - const tracked_objects::Location& location, - const base::FilePath& shortcut_path) { + void ValidateNonProfileShortcutAtPath(const base::Location& location, + const base::FilePath& shortcut_path) { EXPECT_TRUE(base::PathExists(shortcut_path)) << location.ToString(); base::win::ShortcutProperties expected_properties; @@ -178,13 +177,13 @@ PostValidateShortcut(location, shortcut_path, expected_properties); } - void ValidateNonProfileShortcut(const tracked_objects::Location& location) { + void ValidateNonProfileShortcut(const base::Location& location) { const base::FilePath shortcut_path = GetDefaultShortcutPathForProfile(base::string16()); ValidateNonProfileShortcutAtPath(location, shortcut_path); } - void CreateProfileWithShortcut(const tracked_objects::Location& location, + void CreateProfileWithShortcut(const base::Location& location, const base::string16& profile_name, const base::FilePath& profile_path) { ASSERT_FALSE(ProfileShortcutExistsAtDefaultPath(profile_name)) @@ -199,7 +198,7 @@ // Posts a task to call ShellUtil::CreateOrUpdateShortcut on the COM thread. void PostCreateOrUpdateShortcut( - const tracked_objects::Location& location, + const base::Location& location, const ShellUtil::ShortcutProperties& properties) { base::PostTaskAndReplyWithResult( base::CreateCOMSTATaskRunnerWithTraits({base::MayBlock()}).get(), @@ -214,7 +213,7 @@ // Creates a regular (non-profile) desktop shortcut with the given name and // returns its path. Fails the test if an error occurs. base::FilePath CreateRegularShortcutWithName( - const tracked_objects::Location& location, + const base::Location& location, const base::string16& shortcut_name) { const base::FilePath shortcut_path = GetUserShortcutsDirectory().Append(shortcut_name + installer::kLnkExt); @@ -231,7 +230,7 @@ } base::FilePath CreateRegularSystemLevelShortcut( - const tracked_objects::Location& location) { + const base::Location& location) { BrowserDistribution* distribution = GetDistribution(); installer::Product product(distribution); ShellUtil::ShortcutProperties properties(ShellUtil::SYSTEM_LEVEL); @@ -245,7 +244,7 @@ return system_level_shortcut_path; } - void RenameProfile(const tracked_objects::Location& location, + void RenameProfile(const base::Location& location, const base::FilePath& profile_path, const base::string16& new_profile_name) { ProfileAttributesEntry* entry;
diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc index 5309ac9..67664e18 100644 --- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc +++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc
@@ -100,7 +100,7 @@ // Store a copy of all the changes passed in so we can examine them later. syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override { @@ -135,7 +135,7 @@ } syncer::SyncError TestChangeProcessor::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { if (erroneous_) return syncer::SyncError(
diff --git a/chrome/browser/sessions/session_service_test_helper.cc b/chrome/browser/sessions/session_service_test_helper.cc index f48bda8..6b0492c6 100644 --- a/chrome/browser/sessions/session_service_test_helper.cc +++ b/chrome/browser/sessions/session_service_test_helper.cc
@@ -117,7 +117,7 @@ } void SessionServiceTestHelper::RunTaskOnBackendThread( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { sessions::BaseSessionServiceTestHelper test_helper( service_->GetBaseSessionServiceForTest());
diff --git a/chrome/browser/sessions/session_service_test_helper.h b/chrome/browser/sessions/session_service_test_helper.h index 8edfa77..273da262 100644 --- a/chrome/browser/sessions/session_service_test_helper.h +++ b/chrome/browser/sessions/session_service_test_helper.h
@@ -76,7 +76,7 @@ SessionService* ReleaseService(); SessionService* service() { return service_.get(); } - void RunTaskOnBackendThread(const tracked_objects::Location& from_here, + void RunTaskOnBackendThread(const base::Location& from_here, const base::Closure& task); private:
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc index 16188145..7667a71 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary.cc
@@ -346,7 +346,7 @@ } syncer::SyncError SpellcheckCustomDictionary::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { DCHECK_CURRENTLY_ON(BrowserThread::UI); std::unique_ptr<Change> dictionary_change(new Change);
diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc index 8c9c19e..ec7e30e8 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc
@@ -125,9 +125,8 @@ ~SyncErrorFactoryStub() override {} // Overridden from syncer::SyncErrorFactory: - syncer::SyncError CreateAndUploadError( - const tracked_objects::Location& location, - const std::string& message) override { + syncer::SyncError CreateAndUploadError(const base::Location& location, + const std::string& message) override { (*error_counter_)++; return syncer::SyncError(location, syncer::SyncError::DATATYPE_ERROR,
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc index ee5a7093..76cd64b 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_registration_utility_unittest.cc
@@ -54,7 +54,7 @@ ~MockChangeProcessor() override {} // SyncChangeProcessor implementation: - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override; SyncDataList GetAllSyncData(syncer::ModelType type) const override { @@ -68,7 +68,7 @@ }; SyncError MockChangeProcessor::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { change_list_ = change_list; return SyncError();
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc index e16fcd6..8cc09bf 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.cc
@@ -314,7 +314,7 @@ } syncer::SyncError SupervisedUserSharedSettingsService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { for (const SyncChange& sync_change : change_list) { SyncData data = sync_change.sync_data();
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h index 5ccaaab..ccdaa07 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h +++ b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service.h
@@ -99,7 +99,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; private:
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc index 2c6b4b1a..02494f2 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_shared_settings_service_unittest.cc
@@ -43,9 +43,8 @@ ~MockSyncErrorFactory() override; // SyncErrorFactory implementation: - syncer::SyncError CreateAndUploadError( - const tracked_objects::Location& location, - const std::string& message) override; + syncer::SyncError CreateAndUploadError(const base::Location& location, + const std::string& message) override; private: syncer::ModelType type_; @@ -59,7 +58,7 @@ MockSyncErrorFactory::~MockSyncErrorFactory() {} syncer::SyncError MockSyncErrorFactory::CreateAndUploadError( - const tracked_objects::Location& location, + const base::Location& location, const std::string& message) { return syncer::SyncError(location, SyncError::DATATYPE_ERROR, message, type_); }
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc index 195c6a1..7c07522 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.cc
@@ -486,7 +486,7 @@ } SyncError SupervisedUserSyncService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { SyncError error; DictionaryPrefUpdate update(prefs_, prefs::kSupervisedUsers);
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h index fe8d81e7..50e59f2 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h +++ b/chrome/browser/supervised_user/legacy/supervised_user_sync_service.h
@@ -121,7 +121,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; private:
diff --git a/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc b/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc index 7053973..d19205b 100644 --- a/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc +++ b/chrome/browser/supervised_user/legacy/supervised_user_sync_service_unittest.cc
@@ -50,7 +50,7 @@ ~MockChangeProcessor() override {} // SyncChangeProcessor implementation: - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override; SyncDataList GetAllSyncData(syncer::ModelType type) const override { @@ -65,7 +65,7 @@ }; SyncError MockChangeProcessor::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { change_list_ = change_list; return SyncError();
diff --git a/chrome/browser/supervised_user/supervised_user_settings_service.cc b/chrome/browser/supervised_user/supervised_user_settings_service.cc index b87c453..ce71d9e 100644 --- a/chrome/browser/supervised_user/supervised_user_settings_service.cc +++ b/chrome/browser/supervised_user/supervised_user_settings_service.cc
@@ -351,7 +351,7 @@ } SyncError SupervisedUserSettingsService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { for (const SyncChange& sync_change : change_list) { SyncData data = sync_change.sync_data();
diff --git a/chrome/browser/supervised_user/supervised_user_settings_service.h b/chrome/browser/supervised_user/supervised_user_settings_service.h index 64912ba..c5ef215 100644 --- a/chrome/browser/supervised_user/supervised_user_settings_service.h +++ b/chrome/browser/supervised_user/supervised_user_settings_service.h
@@ -138,7 +138,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; // PrefStore::Observer implementation:
diff --git a/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc b/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc index 39743f1..d2f472c 100644 --- a/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc +++ b/chrome/browser/supervised_user/supervised_user_settings_service_unittest.cc
@@ -28,9 +28,8 @@ ~MockSyncErrorFactory() override; // SyncErrorFactory implementation: - syncer::SyncError CreateAndUploadError( - const tracked_objects::Location& location, - const std::string& message) override; + syncer::SyncError CreateAndUploadError(const base::Location& location, + const std::string& message) override; private: syncer::ModelType type_; @@ -44,7 +43,7 @@ MockSyncErrorFactory::~MockSyncErrorFactory() {} syncer::SyncError MockSyncErrorFactory::CreateAndUploadError( - const tracked_objects::Location& location, + const base::Location& location, const std::string& message) { return syncer::SyncError(location, syncer::SyncError::DATATYPE_ERROR,
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc index 901fa2ef..2d25280 100644 --- a/chrome/browser/supervised_user/supervised_user_whitelist_service.cc +++ b/chrome/browser/supervised_user/supervised_user_whitelist_service.cc
@@ -233,7 +233,7 @@ } syncer::SyncError SupervisedUserWhitelistService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { bool whitelists_removed = false; syncer::SyncError error;
diff --git a/chrome/browser/supervised_user/supervised_user_whitelist_service.h b/chrome/browser/supervised_user/supervised_user_whitelist_service.h index 53268fa..daee28d 100644 --- a/chrome/browser/supervised_user/supervised_user_whitelist_service.h +++ b/chrome/browser/supervised_user/supervised_user_whitelist_service.h
@@ -85,7 +85,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; private:
diff --git a/chrome/browser/sync_file_system/drive_backend/callback_helper.h b/chrome/browser/sync_file_system/drive_backend/callback_helper.h index 16aef64..f608b6e 100644 --- a/chrome/browser/sync_file_system/drive_backend/callback_helper.h +++ b/chrome/browser/sync_file_system/drive_backend/callback_helper.h
@@ -37,7 +37,7 @@ class CallbackHolder { public: CallbackHolder(const scoped_refptr<base::SequencedTaskRunner>& task_runner, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Callback<T>& callback) : task_runner_(task_runner), from_here_(from_here), @@ -52,12 +52,12 @@ } base::SequencedTaskRunner* task_runner() const { return task_runner_.get(); } - const tracked_objects::Location& from_here() const { return from_here_; } + const base::Location& from_here() const { return from_here_; } const base::Callback<T>& callback() const { return *callback_; } private: scoped_refptr<base::SequencedTaskRunner> task_runner_; - const tracked_objects::Location from_here_; + const base::Location from_here_; std::unique_ptr<base::Callback<T>> callback_; DISALLOW_COPY_AND_ASSIGN(CallbackHolder); @@ -80,7 +80,7 @@ template <typename T> base::Callback<T> RelayCallbackToTaskRunner( const scoped_refptr<base::SequencedTaskRunner>& task_runner, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Callback<T>& callback) { DCHECK(task_runner->RunsTasksInCurrentSequence()); @@ -94,7 +94,7 @@ template <typename T> base::Callback<T> RelayCallbackToCurrentThread( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Callback<T>& callback) { return RelayCallbackToTaskRunner( base::ThreadTaskRunnerHandle::Get(),
diff --git a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc index 8c39c285c..0985d6e 100644 --- a/chrome/browser/sync_file_system/drive_backend/metadata_database.cc +++ b/chrome/browser/sync_file_system/drive_backend/metadata_database.cc
@@ -1548,7 +1548,7 @@ } void MetadataDatabase::UpdateByFileMetadata( - const tracked_objects::Location& from_where, + const base::Location& from_where, std::unique_ptr<FileMetadata> metadata, UpdateOption option) { DCHECK(metadata);
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc index 7ec188ea..f893b67 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_manager.cc
@@ -84,11 +84,10 @@ status); } -void SyncTaskManager::ScheduleTask( - const tracked_objects::Location& from_here, - const Task& task, - Priority priority, - const SyncStatusCallback& callback) { +void SyncTaskManager::ScheduleTask(const base::Location& from_here, + const Task& task, + Priority priority, + const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequence()); ScheduleSyncTask(from_here, @@ -96,11 +95,10 @@ priority, callback); } -void SyncTaskManager::ScheduleSyncTask( - const tracked_objects::Location& from_here, - std::unique_ptr<SyncTask> task, - Priority priority, - const SyncStatusCallback& callback) { +void SyncTaskManager::ScheduleSyncTask(const base::Location& from_here, + std::unique_ptr<SyncTask> task, + Priority priority, + const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequence()); std::unique_ptr<SyncTaskToken> token(GetToken(from_here, callback)); @@ -115,10 +113,9 @@ RunTask(std::move(token), std::move(task)); } -bool SyncTaskManager::ScheduleTaskIfIdle( - const tracked_objects::Location& from_here, - const Task& task, - const SyncStatusCallback& callback) { +bool SyncTaskManager::ScheduleTaskIfIdle(const base::Location& from_here, + const Task& task, + const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequence()); return ScheduleSyncTaskIfIdle( @@ -127,7 +124,7 @@ } bool SyncTaskManager::ScheduleSyncTaskIfIdle( - const tracked_objects::Location& from_here, + const base::Location& from_here, std::unique_ptr<SyncTask> task, const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequence()); @@ -330,7 +327,7 @@ if (background_task_token) { background_task_token->set_task_blocker(std::move(task_blocker)); } else { - tracked_objects::Location from_here = foreground_task_token->location(); + base::Location from_here = foreground_task_token->location(); SyncStatusCallback callback = foreground_task_token->callback(); foreground_task_token->clear_callback(); @@ -349,7 +346,7 @@ } std::unique_ptr<SyncTaskToken> SyncTaskManager::GetToken( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncStatusCallback& callback) { DCHECK(sequence_checker_.CalledOnValidSequence());
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc b/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc index 96920f27..d6962457 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_token.cc
@@ -51,7 +51,7 @@ SyncStatusCallback())); } -void SyncTaskToken::UpdateTask(const tracked_objects::Location& location, +void SyncTaskToken::UpdateTask(const base::Location& location, const SyncStatusCallback& callback) { DCHECK(callback_.is_null()); location_ = location;
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_task_token.h b/chrome/browser/sync_file_system/drive_backend/sync_task_token.h index f18e1d4..86841121 100644 --- a/chrome/browser/sync_file_system/drive_backend/sync_task_token.h +++ b/chrome/browser/sync_file_system/drive_backend/sync_task_token.h
@@ -45,10 +45,10 @@ int64_t token_id, std::unique_ptr<TaskBlocker> task_blocker); - void UpdateTask(const tracked_objects::Location& location, + void UpdateTask(const base::Location& location, const SyncStatusCallback& callback); - const tracked_objects::Location& location() const { return location_; } + const base::Location& location() const { return location_; } virtual ~SyncTaskToken(); static SyncStatusCallback WrapToCallback( @@ -82,7 +82,7 @@ base::WeakPtr<SyncTaskManager> manager_; scoped_refptr<base::SequencedTaskRunner> task_runner_; - tracked_objects::Location location_; + base::Location location_; int64_t token_id_; SyncStatusCallback callback_;
diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc index 55d88459..b080de3 100644 --- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc +++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.cc
@@ -61,7 +61,7 @@ template <typename R, typename CallbackType> R RunOnThread(base::SingleThreadTaskRunner* task_runner, - const tracked_objects::Location& location, + const base::Location& location, base::OnceCallback<void(CallbackType callback)> task) { R result; base::RunLoop run_loop; @@ -77,7 +77,7 @@ } void RunOnThread(base::SingleThreadTaskRunner* task_runner, - const tracked_objects::Location& location, + const base::Location& location, base::OnceClosure task) { base::RunLoop run_loop; task_runner->PostTaskAndReply(
diff --git a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc index 4bdb42e..738e1e1 100644 --- a/chrome/browser/sync_file_system/local/local_file_change_tracker.cc +++ b/chrome/browser/sync_file_system/local/local_file_change_tracker.cc
@@ -62,7 +62,7 @@ SyncStatusCode Init(RecoveryOption recovery_option); SyncStatusCode Repair(const std::string& db_path); - void HandleError(const tracked_objects::Location& from_here, + void HandleError(const base::Location& from_here, const leveldb::Status& status); const base::FilePath base_path_; @@ -538,7 +538,7 @@ // TODO(nhiroki): factor out the common methods into somewhere else. void LocalFileChangeTracker::TrackerDB::HandleError( - const tracked_objects::Location& from_here, + const base::Location& from_here, const leveldb::Status& status) { LOG(ERROR) << "LocalFileChangeTracker::TrackerDB failed at: " << from_here.ToString() << " with error: " << status.ToString();
diff --git a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc index b7486626..508fec65 100644 --- a/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc +++ b/chrome/browser/sync_file_system/local/local_file_sync_service_unittest.cc
@@ -52,7 +52,7 @@ const char kOrigin[] = "http://example.com"; -void DidPrepareForProcessRemoteChange(const tracked_objects::Location& where, +void DidPrepareForProcessRemoteChange(const base::Location& where, const base::Closure& oncompleted, SyncStatusCode expected_status, const SyncFileMetadata& expected_metadata, @@ -67,7 +67,7 @@ oncompleted.Run(); } -void OnSyncCompleted(const tracked_objects::Location& where, +void OnSyncCompleted(const base::Location& where, const base::Closure& oncompleted, SyncStatusCode expected_status, const FileSystemURL& expected_url, @@ -79,7 +79,7 @@ oncompleted.Run(); } -void OnGetFileMetadata(const tracked_objects::Location& where, +void OnGetFileMetadata(const base::Location& where, const base::Closure& oncompleted, SyncStatusCode* status_out, SyncFileMetadata* metadata_out, @@ -157,7 +157,7 @@ void PrepareForProcessRemoteChange( const FileSystemURL& url, - const tracked_objects::Location& where, + const base::Location& where, SyncStatusCode expected_status, const SyncFileMetadata& expected_metadata) { base::RunLoop run_loop;
diff --git a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc index 9079410e..507e0775 100644 --- a/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc +++ b/chrome/browser/sync_file_system/local/syncable_file_operation_runner_unittest.cc
@@ -109,19 +109,19 @@ callback_count_ = 0; } - StatusCallback ExpectStatus(const tracked_objects::Location& location, + StatusCallback ExpectStatus(const base::Location& location, File::Error expect) { return base::Bind(&SyncableFileOperationRunnerTest::DidFinish, weak_factory_.GetWeakPtr(), location, expect); } FileSystemOperation::WriteCallback GetWriteCallback( - const tracked_objects::Location& location) { + const base::Location& location) { return base::Bind(&SyncableFileOperationRunnerTest::DidWrite, weak_factory_.GetWeakPtr(), location); } - void DidWrite(const tracked_objects::Location& location, + void DidWrite(const base::Location& location, File::Error status, int64_t bytes, bool complete) { @@ -132,8 +132,9 @@ ++callback_count_; } - void DidFinish(const tracked_objects::Location& location, - File::Error expect, File::Error status) { + void DidFinish(const base::Location& location, + File::Error expect, + File::Error status) { SCOPED_TRACE(testing::Message() << location.ToString()); EXPECT_EQ(expect, status); ++callback_count_;
diff --git a/chrome/browser/sync_file_system/logger.cc b/chrome/browser/sync_file_system/logger.cc index 6d6d980..9eb6111c 100644 --- a/chrome/browser/sync_file_system/logger.cc +++ b/chrome/browser/sync_file_system/logger.cc
@@ -40,7 +40,7 @@ } void Log(logging::LogSeverity severity, - const tracked_objects::Location& location, + const base::Location& location, const char* format, ...) { std::string what;
diff --git a/chrome/browser/sync_file_system/logger.h b/chrome/browser/sync_file_system/logger.h index af64661..e3d4520 100644 --- a/chrome/browser/sync_file_system/logger.h +++ b/chrome/browser/sync_file_system/logger.h
@@ -23,7 +23,7 @@ // Logs a message using printf format. // This function can be called from any thread. void Log(logging::LogSeverity level, - const tracked_objects::Location& location, + const base::Location& location, _Printf_format_string_ const char* format, ...) PRINTF_FORMAT(3, 4);
diff --git a/chrome/browser/sync_file_system/sync_process_runner.cc b/chrome/browser/sync_file_system/sync_process_runner.cc index 1c0753d6..7fc376f7 100644 --- a/chrome/browser/sync_file_system/sync_process_runner.cc +++ b/chrome/browser/sync_file_system/sync_process_runner.cc
@@ -31,7 +31,7 @@ bool IsRunning() override { return timer_.IsRunning(); } - void Start(const tracked_objects::Location& from_here, + void Start(const base::Location& from_here, const base::TimeDelta& delay, const base::Closure& closure) override { timer_.Start(from_here, delay, closure);
diff --git a/chrome/browser/sync_file_system/sync_process_runner.h b/chrome/browser/sync_file_system/sync_process_runner.h index eeb5d19b..1b9b0dc 100644 --- a/chrome/browser/sync_file_system/sync_process_runner.h +++ b/chrome/browser/sync_file_system/sync_process_runner.h
@@ -59,7 +59,7 @@ public: virtual ~TimerHelper() {} virtual bool IsRunning() = 0; - virtual void Start(const tracked_objects::Location& from_here, + virtual void Start(const base::Location& from_here, const base::TimeDelta& delay, const base::Closure& closure) = 0; virtual base::TimeTicks Now() const = 0;
diff --git a/chrome/browser/sync_file_system/sync_process_runner_unittest.cc b/chrome/browser/sync_file_system/sync_process_runner_unittest.cc index 998db15..55cac1be 100644 --- a/chrome/browser/sync_file_system/sync_process_runner_unittest.cc +++ b/chrome/browser/sync_file_system/sync_process_runner_unittest.cc
@@ -44,7 +44,7 @@ bool IsRunning() override { return !timer_task_.is_null(); } - void Start(const tracked_objects::Location& from_here, + void Start(const base::Location& from_here, const base::TimeDelta& delay, const base::Closure& closure) override { scheduled_time_ = current_time_ + delay;
diff --git a/chrome/browser/sync_file_system/syncable_file_system_util.cc b/chrome/browser/sync_file_system/syncable_file_system_util.cc index 25a2e40a..ce2aac2 100644 --- a/chrome/browser/sync_file_system/syncable_file_system_util.cc +++ b/chrome/browser/sync_file_system/syncable_file_system_util.cc
@@ -109,8 +109,7 @@ return profile_base_dir.Append(kSyncFileSystemDir); } -void RunSoon(const tracked_objects::Location& from_here, - const base::Closure& callback) { +void RunSoon(const base::Location& from_here, const base::Closure& callback) { base::ThreadTaskRunnerHandle::Get()->PostTask(from_here, callback); }
diff --git a/chrome/browser/themes/theme_syncable_service.cc b/chrome/browser/themes/theme_syncable_service.cc index f51a203..97e2af2 100644 --- a/chrome/browser/themes/theme_syncable_service.cc +++ b/chrome/browser/themes/theme_syncable_service.cc
@@ -129,7 +129,7 @@ } syncer::SyncError ThemeSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/chrome/browser/themes/theme_syncable_service.h b/chrome/browser/themes/theme_syncable_service.h index ea58f10c..59d4d0a 100644 --- a/chrome/browser/themes/theme_syncable_service.h +++ b/chrome/browser/themes/theme_syncable_service.h
@@ -44,7 +44,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; // Client tag and tile of theme node in sync.
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.cc b/chrome/browser/ui/app_list/app_list_syncable_service.cc index 01b18af..72f7de7 100644 --- a/chrome/browser/ui/app_list/app_list_syncable_service.cc +++ b/chrome/browser/ui/app_list/app_list_syncable_service.cc
@@ -899,7 +899,7 @@ } syncer::SyncError AppListSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { if (!sync_processor_.get()) { return syncer::SyncError(FROM_HERE,
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service.h b/chrome/browser/ui/app_list/app_list_syncable_service.h index dd83921..c95ab4c4 100644 --- a/chrome/browser/ui/app_list/app_list_syncable_service.h +++ b/chrome/browser/ui/app_list/app_list_syncable_service.h
@@ -144,7 +144,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; private:
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc b/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc index f62a78a6..4e42d819 100644 --- a/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc +++ b/chrome/browser/ui/app_list/app_list_syncable_service_unittest.cc
@@ -364,7 +364,7 @@ CreateAppRemoteData(kItemId2, "item_name2x", GenerateId("parent_id2x"), "ordinalx", "pinordinalx"))); - app_list_syncable_service()->ProcessSyncChanges(tracked_objects::Location(), + app_list_syncable_service()->ProcessSyncChanges(base::Location(), change_list); content::RunAllBlockingPoolTasksUntilIdle(); @@ -407,7 +407,7 @@ } // Validate items with bad data are processed without crashing. - app_list_syncable_service()->ProcessSyncChanges(tracked_objects::Location(), + app_list_syncable_service()->ProcessSyncChanges(base::Location(), change_list); content::RunAllBlockingPoolTasksUntilIdle();
diff --git a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc index 49d979f..90bfa4a 100644 --- a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc +++ b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.cc
@@ -198,7 +198,7 @@ } syncer::SyncError ArcPackageSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { if (!sync_processor_.get()) { return syncer::SyncError(FROM_HERE, syncer::SyncError::DATATYPE_ERROR,
diff --git a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.h b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.h index d3e17365..1821e6e7 100644 --- a/chrome/browser/ui/app_list/arc/arc_package_syncable_service.h +++ b/chrome/browser/ui/app_list/arc/arc_package_syncable_service.h
@@ -63,7 +63,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; bool SyncStarted();
diff --git a/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc b/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc index 201047a2..48b0dd1 100644 --- a/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc +++ b/chrome/browser/ui/ash/multi_user/user_switch_util_unittest.cc
@@ -7,6 +7,7 @@ #include "ash/shell.h" #include "ash/system/screen_security/screen_tray_item.h" #include "ash/system/tray/system_tray.h" +#include "ash/system/web_notification/web_notification_tray.h" #include "ash/test/ash_test_base.h" #include "ash/wm/overview/window_selector_controller.h" #include "base/run_loop.h" @@ -40,6 +41,13 @@ capture_item_ = system_tray->GetScreenCaptureItem(); EXPECT_TRUE(share_item_); EXPECT_TRUE(capture_item_); + WebNotificationTray::DisableAnimationsForTest(true); + } + + void TearDown() override { + RunAllPendingInMessageLoop(); + WebNotificationTray::DisableAnimationsForTest(false); + AshTestBase::TearDown(); } // Accessing the capture session functionality.
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm index f439407c..3bf9a2d 100644 --- a/chrome/browser/ui/cocoa/browser_window_controller.mm +++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -1076,20 +1076,6 @@ - (void)onActiveTabChanged:(content::WebContents*)oldContents to:(content::WebContents*)newContents { - // No need to remove previous bubble. It will close itself. - PermissionRequestManager* manager(nullptr); - if (oldContents) { - manager = PermissionRequestManager::FromWebContents(oldContents); - if (manager) - manager->HideBubble(); - } - - if (newContents) { - manager = PermissionRequestManager::FromWebContents(newContents); - if (manager) - manager->DisplayPendingRequests(); - } - if ([self isInAnyFullscreenMode]) { [[self fullscreenToolbarController] revealToolbarForWebContents:newContents inForeground:YES]; @@ -1529,14 +1515,6 @@ - (void)onTabDetachedWithContents:(WebContents*)contents { [infoBarContainerController_ tabDetachedWithContents:contents]; - - // If there are permission requests, hide them. This may be checked again in - // -onActiveTabChanged:, but not if this was the last tab in the window, in - // which case there is nothing to change to. - if (PermissionRequestManager* manager = - PermissionRequestManager::FromWebContents(contents)) { - manager->HideBubble(); - } } - (void)onTabInsertedWithContents:(content::WebContents*)contents
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc index 8a63b61..10f23d7 100644 --- a/chrome/browser/ui/toolbar/app_menu_model.cc +++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -41,6 +41,7 @@ #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h" #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" #include "chrome/browser/upgrade_detector.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/profiling.h" @@ -187,15 +188,11 @@ void ToolsMenuModel::Build(Browser* browser) { AddItemWithStringId(IDC_SAVE_PAGE, IDS_SAVE_PAGE); - if (extensions::util::IsNewBookmarkAppsEnabled()) { - int string_id = IDS_ADD_TO_DESKTOP; -#if defined(OS_MACOSX) - string_id = IDS_ADD_TO_APPLICATIONS; -#endif -#if defined(USE_ASH) - string_id = IDS_ADD_TO_SHELF; -#endif // defined(USE_ASH) - AddItemWithStringId(IDC_CREATE_HOSTED_APP, string_id); + if (extensions::util::IsNewBookmarkAppsEnabled() && + // If kExperimentalAppBanners is enabled, this is moved to the top level + // menu. + !base::FeatureList::IsEnabled(features::kExperimentalAppBanners)) { + AddItemWithStringId(IDC_CREATE_HOSTED_APP, IDS_ADD_TO_OS_LAUNCH_SURFACE); } AddSeparator(ui::NORMAL_SEPARATOR); @@ -732,6 +729,11 @@ AddItemWithStringId(IDC_ROUTE_MEDIA, IDS_MEDIA_ROUTER_MENU_ITEM_TITLE); AddItemWithStringId(IDC_FIND, IDS_FIND); + if (extensions::util::IsNewBookmarkAppsEnabled() && + base::FeatureList::IsEnabled(features::kExperimentalAppBanners)) { + AddItemWithStringId(IDC_CREATE_HOSTED_APP, IDS_ADD_TO_OS_LAUNCH_SURFACE); + } + if (base::CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableDomDistiller)) AddItemWithStringId(IDC_DISTILL_PAGE, IDS_DISTILL_PAGE);
diff --git a/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc b/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc index 50a16cd..c4c10ed 100644 --- a/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc +++ b/chrome/browser/ui/views/extensions/bookmark_app_confirmation_view.cc
@@ -128,13 +128,7 @@ } base::string16 BookmarkAppConfirmationView::GetWindowTitle() const { -#if defined(USE_ASH) - int ids = IDS_ADD_TO_SHELF_BUBBLE_TITLE; -#else - int ids = IDS_ADD_TO_DESKTOP_BUBBLE_TITLE; -#endif - - return l10n_util::GetStringUTF16(ids); + return l10n_util::GetStringUTF16(IDS_ADD_TO_OS_LAUNCH_SURFACE_BUBBLE_TITLE); } bool BookmarkAppConfirmationView::ShouldShowCloseButton() const {
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index cd887fd..aedfe51 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -765,14 +765,6 @@ infobar_container_->ChangeInfoBarManager( InfoBarService::FromWebContents(new_contents)); - if (old_contents && PermissionRequestManager::FromWebContents(old_contents)) - PermissionRequestManager::FromWebContents(old_contents)->HideBubble(); - - if (new_contents && PermissionRequestManager::FromWebContents(new_contents)) { - PermissionRequestManager::FromWebContents(new_contents) - ->DisplayPendingRequests(); - } - UpdateUIForContents(new_contents); RevealTabStripIfNeeded(); @@ -1453,9 +1445,6 @@ } void BrowserView::TabDetachedAt(WebContents* contents, int index) { - if (PermissionRequestManager::FromWebContents(contents)) - PermissionRequestManager::FromWebContents(contents)->HideBubble(); - // We use index here rather than comparing |contents| because by this time // the model has already removed |contents| from its list, so // browser_->GetActiveWebContents() will return null or something else. @@ -1471,9 +1460,6 @@ } void BrowserView::TabDeactivated(WebContents* contents) { - if (PermissionRequestManager::FromWebContents(contents)) - PermissionRequestManager::FromWebContents(contents)->HideBubble(); - // We do not store the focus when closing the tab to work-around bug 4633. // Some reports seem to show that the focus manager and/or focused view can // be garbage at that point, it is not clear why.
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc index 8b1f2ea..cbeb67e 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -95,7 +95,7 @@ CloudPrintProxyFrontend* frontend() { return backend_->frontend_; } - bool PostFrontendTask(const tracked_objects::Location& from_here, + bool PostFrontendTask(const base::Location& from_here, const base::Closure& task); bool CurrentlyOnFrontendThread() const; @@ -228,9 +228,8 @@ core_)); } -bool CloudPrintProxyBackend::PostCoreTask( - const tracked_objects::Location& from_here, - const base::Closure& task) { +bool CloudPrintProxyBackend::PostCoreTask(const base::Location& from_here, + const base::Closure& task) { return core_thread_.task_runner()->PostTask(from_here, task); } @@ -250,7 +249,7 @@ } bool CloudPrintProxyBackend::Core::PostFrontendTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { return backend_->frontend_task_runner_->PostTask(from_here, task); }
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.h b/chrome/service/cloud_print/cloud_print_proxy_backend.h index 251e526..2f54c6e 100644 --- a/chrome/service/cloud_print/cloud_print_proxy_backend.h +++ b/chrome/service/cloud_print/cloud_print_proxy_backend.h
@@ -76,8 +76,7 @@ void UnregisterPrinters(); private: - bool PostCoreTask(const tracked_objects::Location& from_here, - const base::Closure& task); + bool PostCoreTask(const base::Location& from_here, const base::Closure& task); // The real guts of CloudPrintProxyBackend, to keep the public client API // clean.
diff --git a/chrome/service/cloud_print/print_system_win.cc b/chrome/service/cloud_print/print_system_win.cc index 2cc2aaba..a5cd7155 100644 --- a/chrome/service/cloud_print/print_system_win.cc +++ b/chrome/service/cloud_print/print_system_win.cc
@@ -39,7 +39,7 @@ return g_service_process->io_task_runner()->BelongsToCurrentThread(); } -bool PostIOThreadTask(const tracked_objects::Location& from_here, +bool PostIOThreadTask(const base::Location& from_here, const base::Closure& task) { return g_service_process->io_task_runner()->PostTask(from_here, task); }
diff --git a/chromecast/base/system_time_change_notifier_unittest.cc b/chromecast/base/system_time_change_notifier_unittest.cc index e4ee44d..09a30fc 100644 --- a/chromecast/base/system_time_change_notifier_unittest.cc +++ b/chromecast/base/system_time_change_notifier_unittest.cc
@@ -27,14 +27,14 @@ SequencedTaskRunnerNoDelay() {} // base::SequencedTaskRunner implementation: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { base::ThreadTaskRunnerHandle::Get()->PostTask(from_here, std::move(task)); return true; } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { return true;
diff --git a/chromecast/media/cma/base/balanced_media_task_runner_factory.cc b/chromecast/media/cma/base/balanced_media_task_runner_factory.cc index 845f3d89..f2747c3 100644 --- a/chromecast/media/cma/base/balanced_media_task_runner_factory.cc +++ b/chromecast/media/cma/base/balanced_media_task_runner_factory.cc
@@ -33,10 +33,9 @@ const base::Closure& shutdown_cb); // MediaTaskRunner implementation. - bool PostMediaTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta timestamp) override; + bool PostMediaTask(const base::Location& from_here, + const base::Closure& task, + base::TimeDelta timestamp) override; private: ~MediaTaskRunnerWithNotification() override; @@ -63,7 +62,7 @@ } bool MediaTaskRunnerWithNotification::PostMediaTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task, base::TimeDelta timestamp) { bool may_run_in_future = @@ -94,10 +93,9 @@ base::TimeDelta GetMediaTimestamp() const; // MediaTaskRunner implementation. - bool PostMediaTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta timestamp) override; + bool PostMediaTask(const base::Location& from_here, + const base::Closure& task, + base::TimeDelta timestamp) override; private: ~BalancedMediaTaskRunner() override; @@ -108,7 +106,7 @@ mutable base::Lock lock_; // Possible pending media task. - tracked_objects::Location from_here_; + base::Location from_here_; base::Closure pending_task_; // Timestamp of the last posted task. @@ -147,10 +145,9 @@ return last_timestamp_; } -bool BalancedMediaTaskRunner::PostMediaTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta timestamp) { +bool BalancedMediaTaskRunner::PostMediaTask(const base::Location& from_here, + const base::Closure& task, + base::TimeDelta timestamp) { DCHECK(!task.is_null()); // Pass through for a task with no timestamp.
diff --git a/chromecast/media/cma/base/media_task_runner.h b/chromecast/media/cma/base/media_task_runner.h index e5d040ad..fe09a10 100644 --- a/chromecast/media/cma/base/media_task_runner.h +++ b/chromecast/media/cma/base/media_task_runner.h
@@ -25,10 +25,9 @@ // detail of derived classes. // Returns true if the task may be run at some point in the future, and false // if the task definitely will not be run. - virtual bool PostMediaTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta timestamp) = 0; + virtual bool PostMediaTask(const base::Location& from_here, + const base::Closure& task, + base::TimeDelta timestamp) = 0; protected: virtual ~MediaTaskRunner();
diff --git a/chromecast/media/cma/base/simple_media_task_runner.cc b/chromecast/media/cma/base/simple_media_task_runner.cc index c4a5439..8618648 100644 --- a/chromecast/media/cma/base/simple_media_task_runner.cc +++ b/chromecast/media/cma/base/simple_media_task_runner.cc
@@ -17,10 +17,9 @@ SimpleMediaTaskRunner::~SimpleMediaTaskRunner() { } -bool SimpleMediaTaskRunner::PostMediaTask( - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta timestamp) { +bool SimpleMediaTaskRunner::PostMediaTask(const base::Location& from_here, + const base::Closure& task, + base::TimeDelta timestamp) { return task_runner_->PostTask(from_here, task); }
diff --git a/chromecast/media/cma/base/simple_media_task_runner.h b/chromecast/media/cma/base/simple_media_task_runner.h index 67979f70..68fac4791 100644 --- a/chromecast/media/cma/base/simple_media_task_runner.h +++ b/chromecast/media/cma/base/simple_media_task_runner.h
@@ -24,7 +24,7 @@ const scoped_refptr<base::SingleThreadTaskRunner>& task_runner); // MediaTaskRunner implementation. - bool PostMediaTask(const tracked_objects::Location& from_here, + bool PostMediaTask(const base::Location& from_here, const base::Closure& task, base::TimeDelta timestamp) override;
diff --git a/chromeos/dbus/auth_policy_client.cc b/chromeos/dbus/auth_policy_client.cc index 10ab093..7068558 100644 --- a/chromeos/dbus/auth_policy_client.cc +++ b/chromeos/dbus/auth_policy_client.cc
@@ -147,7 +147,7 @@ dbus::ObjectProxy::OnConnectedCallback on_connected_callback) override { proxy_->ConnectToSignal(authpolicy::kAuthPolicyInterface, std::move(signal_name), std::move(signal_callback), - on_connected_callback); + std::move(on_connected_callback)); } protected:
diff --git a/chromeos/dbus/biod/biod_client_unittest.cc b/chromeos/dbus/biod/biod_client_unittest.cc index 0d179f0..a60b430 100644 --- a/chromeos/dbus/biod/biod_client_unittest.cc +++ b/chromeos/dbus/biod/biod_client_unittest.cc
@@ -77,7 +77,7 @@ .WillRepeatedly(Return(proxy_.get())); // Save |client_|'s signal callback. - EXPECT_CALL(*proxy_.get(), ConnectToSignal(kInterface, _, _, _)) + EXPECT_CALL(*proxy_.get(), DoConnectToSignal(kInterface, _, _, _)) .WillRepeatedly(Invoke(this, &BiodClientTest::ConnectToSignal)); client_.reset(BiodClient::Create(REAL_DBUS_CLIENT_IMPLEMENTATION)); @@ -176,12 +176,13 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { EXPECT_EQ(interface_name, kInterface); signal_callbacks_[signal_name] = signal_callback; message_loop_.task_runner()->PostTask( - FROM_HERE, base::Bind(on_connected_callback, interface_name, - signal_name, true /* success */)); + FROM_HERE, + base::BindOnce(std::move(*on_connected_callback), interface_name, + signal_name, true /* success */)); } // Handles calls to |proxy_|'s CallMethod().
diff --git a/chromeos/dbus/blocking_method_caller_unittest.cc b/chromeos/dbus/blocking_method_caller_unittest.cc index 3ffa197..c047493 100644 --- a/chromeos/dbus/blocking_method_caller_unittest.cc +++ b/chromeos/dbus/blocking_method_caller_unittest.cc
@@ -27,7 +27,7 @@ class FakeTaskRunner : public base::TaskRunner { public: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { std::move(task).Run();
diff --git a/chromeos/dbus/cras_audio_client_unittest.cc b/chromeos/dbus/cras_audio_client_unittest.cc index 7ce50a9..040e986e7 100644 --- a/chromeos/dbus/cras_audio_client_unittest.cc +++ b/chromeos/dbus/cras_audio_client_unittest.cc
@@ -282,7 +282,7 @@ // callback. EXPECT_CALL( *mock_cras_proxy_.get(), - ConnectToSignal(interface_name_, cras::kOutputMuteChanged, _, _)) + DoConnectToSignal(interface_name_, cras::kOutputMuteChanged, _, _)) .WillRepeatedly( Invoke(this, &CrasAudioClientTest::OnConnectToOutputMuteChanged)); @@ -291,47 +291,43 @@ // callback. EXPECT_CALL( *mock_cras_proxy_.get(), - ConnectToSignal(interface_name_, cras::kInputMuteChanged, _, _)) + DoConnectToSignal(interface_name_, cras::kInputMuteChanged, _, _)) .WillRepeatedly( Invoke(this, &CrasAudioClientTest::OnConnectToInputMuteChanged)); // Set an expectation so mock_cras_proxy's monitoring NodesChanged // ConnectToSignal will use OnConnectToNodesChanged() to run the callback. - EXPECT_CALL( - *mock_cras_proxy_.get(), - ConnectToSignal(interface_name_, cras::kNodesChanged, _, _)) + EXPECT_CALL(*mock_cras_proxy_.get(), + DoConnectToSignal(interface_name_, cras::kNodesChanged, _, _)) .WillRepeatedly( Invoke(this, &CrasAudioClientTest::OnConnectToNodesChanged)); // Set an expectation so mock_cras_proxy's monitoring // ActiveOutputNodeChanged ConnectToSignal will use // OnConnectToActiveOutputNodeChanged() to run the callback. - EXPECT_CALL( - *mock_cras_proxy_.get(), - ConnectToSignal(interface_name_, cras::kActiveOutputNodeChanged, _, _)) - .WillRepeatedly( - Invoke(this, - &CrasAudioClientTest::OnConnectToActiveOutputNodeChanged)); + EXPECT_CALL(*mock_cras_proxy_.get(), + DoConnectToSignal(interface_name_, + cras::kActiveOutputNodeChanged, _, _)) + .WillRepeatedly(Invoke( + this, &CrasAudioClientTest::OnConnectToActiveOutputNodeChanged)); // Set an expectation so mock_cras_proxy's monitoring // ActiveInputNodeChanged ConnectToSignal will use // OnConnectToActiveInputNodeChanged() to run the callback. EXPECT_CALL( *mock_cras_proxy_.get(), - ConnectToSignal(interface_name_, cras::kActiveInputNodeChanged, _, _)) - .WillRepeatedly( - Invoke(this, - &CrasAudioClientTest::OnConnectToActiveInputNodeChanged)); + DoConnectToSignal(interface_name_, cras::kActiveInputNodeChanged, _, _)) + .WillRepeatedly(Invoke( + this, &CrasAudioClientTest::OnConnectToActiveInputNodeChanged)); // Set an expectation so mock_cras_proxy's monitoring // OutputNodeVolumeChanged ConnectToSignal will use // OnConnectToOutputNodeVolumeChanged() to run the callback. - EXPECT_CALL( - *mock_cras_proxy_.get(), - ConnectToSignal(interface_name_, cras::kOutputNodeVolumeChanged, _, _)) - .WillRepeatedly( - Invoke(this, - &CrasAudioClientTest::OnConnectToOutputNodeVolumeChanged)); + EXPECT_CALL(*mock_cras_proxy_.get(), + DoConnectToSignal(interface_name_, + cras::kOutputNodeVolumeChanged, _, _)) + .WillRepeatedly(Invoke( + this, &CrasAudioClientTest::OnConnectToOutputNodeVolumeChanged)); // Set an expectation so mock_bus's GetObjectProxy() for the given // service name and the object path will return mock_cras_proxy_. @@ -438,14 +434,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { output_mute_changed_handler_ = signal_callback; const bool success = true; - message_loop_.task_runner()->PostTask(FROM_HERE, - base::Bind(on_connected_callback, - interface_name, - signal_name, - success)); + message_loop_.task_runner()->PostTask( + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } // Checks the requested interface name and signal name. @@ -454,14 +448,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { input_mute_changed_handler_ = signal_callback; const bool success = true; - message_loop_.task_runner()->PostTask(FROM_HERE, - base::Bind(on_connected_callback, - interface_name, - signal_name, - success)); + message_loop_.task_runner()->PostTask( + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } // Checks the requested interface name and signal name. @@ -470,14 +462,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { nodes_changed_handler_ = signal_callback; const bool success = true; - message_loop_.task_runner()->PostTask(FROM_HERE, - base::Bind(on_connected_callback, - interface_name, - signal_name, - success)); + message_loop_.task_runner()->PostTask( + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } // Checks the requested interface name and signal name. @@ -486,14 +476,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { active_output_node_changed_handler_ = signal_callback; const bool success = true; - message_loop_.task_runner()->PostTask(FROM_HERE, - base::Bind(on_connected_callback, - interface_name, - signal_name, - success)); + message_loop_.task_runner()->PostTask( + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } // Checks the requested interface name and signal name. @@ -502,14 +490,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { active_input_node_changed_handler_ = signal_callback; const bool success = true; - message_loop_.task_runner()->PostTask(FROM_HERE, - base::Bind(on_connected_callback, - interface_name, - signal_name, - success)); + message_loop_.task_runner()->PostTask( + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } // Checks the requested interface name and signal name. @@ -518,14 +504,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { output_node_volume_changed_handler_ = signal_callback; const bool success = true; - message_loop_.task_runner()->PostTask(FROM_HERE, - base::Bind(on_connected_callback, - interface_name, - signal_name, - success)); + message_loop_.task_runner()->PostTask( + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } // Checks the content of the method call and returns the response.
diff --git a/chromeos/dbus/fake_auth_policy_client.cc b/chromeos/dbus/fake_auth_policy_client.cc index 8a0f8b2..013d3f98 100644 --- a/chromeos/dbus/fake_auth_policy_client.cc +++ b/chromeos/dbus/fake_auth_policy_client.cc
@@ -231,8 +231,8 @@ const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, dbus::ObjectProxy::OnConnectedCallback on_connected_callback) { - on_connected_callback.Run(authpolicy::kAuthPolicyInterface, signal_name, - true /* success */); + std::move(on_connected_callback) + .Run(authpolicy::kAuthPolicyInterface, signal_name, true /* success */); PostDelayedClosure( base::BindOnce(RunSignalCallback, authpolicy::kAuthPolicyInterface, signal_name, signal_callback),
diff --git a/chromeos/dbus/gsm_sms_client_unittest.cc b/chromeos/dbus/gsm_sms_client_unittest.cc index 0d81d4c..ac1e678 100644 --- a/chromeos/dbus/gsm_sms_client_unittest.cc +++ b/chromeos/dbus/gsm_sms_client_unittest.cc
@@ -75,10 +75,8 @@ // Set an expectation so mock_proxy's ConnectToSignal() will use // OnConnectToSignal() to run the callback. EXPECT_CALL(*mock_proxy_.get(), - ConnectToSignal(modemmanager::kModemManagerSMSInterface, - modemmanager::kSMSReceivedSignal, - _, - _)) + DoConnectToSignal(modemmanager::kModemManagerSMSInterface, + modemmanager::kSMSReceivedSignal, _, _)) .WillRepeatedly(Invoke(this, &GsmSMSClientTest::OnConnectToSignal)); // Set an expectation so mock_bus's GetObjectProxy() for the given @@ -174,12 +172,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { sms_received_callback_ = signal_callback; const bool success = true; message_loop_.task_runner()->PostTask( - FROM_HERE, base::Bind(on_connected_callback, interface_name, - signal_name, success)); + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } };
diff --git a/chromeos/dbus/modem_messaging_client_unittest.cc b/chromeos/dbus/modem_messaging_client_unittest.cc index 55aafd67..98450f8 100644 --- a/chromeos/dbus/modem_messaging_client_unittest.cc +++ b/chromeos/dbus/modem_messaging_client_unittest.cc
@@ -70,13 +70,12 @@ // Set an expectation so mock_proxy's ConnectToSignal() will use // OnConnectToSignal() to run the callback. - EXPECT_CALL(*mock_proxy_.get(), - ConnectToSignal(modemmanager::kModemManager1MessagingInterface, - modemmanager::kSMSAddedSignal, - _, - _)) + EXPECT_CALL( + *mock_proxy_.get(), + DoConnectToSignal(modemmanager::kModemManager1MessagingInterface, + modemmanager::kSMSAddedSignal, _, _)) .WillRepeatedly( - Invoke(this, &ModemMessagingClientTest::OnConnectToSignal)); + Invoke(this, &ModemMessagingClientTest::OnConnectToSignal)); // Set an expectation so mock_bus's GetObjectProxy() for the given // service name and the object path will return mock_proxy_. @@ -154,12 +153,12 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { sms_received_callback_ = signal_callback; const bool success = true; message_loop_.task_runner()->PostTask( - FROM_HERE, base::Bind(on_connected_callback, interface_name, - signal_name, success)); + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } };
diff --git a/chromeos/dbus/power_manager_client_unittest.cc b/chromeos/dbus/power_manager_client_unittest.cc index 8a3fb38..1a1b0e1ec 100644 --- a/chromeos/dbus/power_manager_client_unittest.cc +++ b/chromeos/dbus/power_manager_client_unittest.cc
@@ -204,7 +204,7 @@ .WillRepeatedly(Return(proxy_.get())); // Save |client_|'s signal and name-owner-changed callbacks. - EXPECT_CALL(*proxy_.get(), ConnectToSignal(kInterface, _, _, _)) + EXPECT_CALL(*proxy_.get(), DoConnectToSignal(kInterface, _, _, _)) .WillRepeatedly(Invoke(this, &PowerManagerClientTest::ConnectToSignal)); EXPECT_CALL(*proxy_.get(), SetNameOwnerChangedCallback(_)) .WillRepeatedly(SaveArg<0>(&name_owner_changed_callback_)); @@ -300,13 +300,14 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { CHECK_EQ(interface_name, power_manager::kPowerManagerInterface); signal_callbacks_[signal_name] = signal_callback; message_loop_.task_runner()->PostTask( - FROM_HERE, base::Bind(on_connected_callback, interface_name, - signal_name, true /* success */)); + FROM_HERE, + base::BindOnce(std::move(*on_connected_callback), interface_name, + signal_name, true /* success */)); } // Handles calls to |proxy_|'s CallMethod() method to register suspend delays.
diff --git a/chromeos/dbus/services/service_provider_test_helper.cc b/chromeos/dbus/services/service_provider_test_helper.cc index 721e09f..163bf57 100644 --- a/chromeos/dbus/services/service_provider_test_helper.cc +++ b/chromeos/dbus/services/service_provider_test_helper.cc
@@ -92,11 +92,12 @@ // |mock_object_proxy_|'s ConnectToSignal will use // MockConnectToSignal(). EXPECT_CALL(*mock_object_proxy_.get(), - ConnectToSignal(interface_name, signal_name, _, _)) + DoConnectToSignal(interface_name, signal_name, _, _)) .WillOnce(Invoke(this, &ServiceProviderTestHelper::MockConnectToSignal)); mock_object_proxy_->ConnectToSignal(interface_name, signal_name, - signal_callback, on_connected_callback); + signal_callback, + std::move(on_connected_callback)); } std::unique_ptr<dbus::Response> ServiceProviderTestHelper::CallMethod( @@ -141,9 +142,9 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* connected_callback) { // Tell the callback that the object proxy is connected to the signal. - connected_callback.Run(interface_name, signal_name, true); + std::move(*connected_callback).Run(interface_name, signal_name, true); // Capture the callback, so we can run this at a later time. on_signal_callback_ = signal_callback; }
diff --git a/chromeos/dbus/services/service_provider_test_helper.h b/chromeos/dbus/services/service_provider_test_helper.h index caccb66..a2871bb 100644 --- a/chromeos/dbus/services/service_provider_test_helper.h +++ b/chromeos/dbus/services/service_provider_test_helper.h
@@ -79,7 +79,7 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback connected_callback); + dbus::ObjectProxy::OnConnectedCallback* connected_callback); // Behaves as |mock_exported_object_|'s SendSignal(). void MockSendSignal(dbus::Signal* signal);
diff --git a/chromeos/dbus/shill_client_unittest_base.cc b/chromeos/dbus/shill_client_unittest_base.cc index e96a1399..ff4a3b1 100644 --- a/chromeos/dbus/shill_client_unittest_base.cc +++ b/chromeos/dbus/shill_client_unittest_base.cc
@@ -119,19 +119,19 @@ // OnConnectToPropertyChanged() to run the callback. EXPECT_CALL( *mock_proxy_.get(), - ConnectToSignal(interface_name_, shill::kMonitorPropertyChanged, _, _)) + DoConnectToSignal(interface_name_, shill::kMonitorPropertyChanged, _, _)) .WillRepeatedly( - Invoke(this, &ShillClientUnittestBase::OnConnectToPropertyChanged)); + Invoke(this, &ShillClientUnittestBase::OnConnectToPropertyChanged)); - EXPECT_CALL( - *mock_proxy_.get(), - ConnectToSignal(interface_name_, shill::kOnPlatformMessageFunction, _, _)) + EXPECT_CALL(*mock_proxy_.get(), + DoConnectToSignal(interface_name_, + shill::kOnPlatformMessageFunction, _, _)) .WillRepeatedly( Invoke(this, &ShillClientUnittestBase::OnConnectToPlatformMessage)); - EXPECT_CALL( - *mock_proxy_.get(), - ConnectToSignal(interface_name_, shill::kOnPacketReceivedFunction, _, _)) + EXPECT_CALL(*mock_proxy_.get(), + DoConnectToSignal(interface_name_, + shill::kOnPacketReceivedFunction, _, _)) .WillRepeatedly( Invoke(this, &ShillClientUnittestBase::OnConnectToPacketReceived)); @@ -385,36 +385,36 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { platform_message_handler_ = signal_callback; const bool success = true; message_loop_.task_runner()->PostTask( - FROM_HERE, - base::Bind(on_connected_callback, interface_name, signal_name, success)); + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } void ShillClientUnittestBase::OnConnectToPacketReceived( const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { packet_receieved__handler_ = signal_callback; const bool success = true; message_loop_.task_runner()->PostTask( - FROM_HERE, - base::Bind(on_connected_callback, interface_name, signal_name, success)); + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } void ShillClientUnittestBase::OnConnectToPropertyChanged( const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { property_changed_handler_ = signal_callback; const bool success = true; message_loop_.task_runner()->PostTask( - FROM_HERE, - base::Bind(on_connected_callback, interface_name, signal_name, success)); + FROM_HERE, base::BindOnce(std::move(*on_connected_callback), + interface_name, signal_name, success)); } void ShillClientUnittestBase::OnCallMethod(
diff --git a/chromeos/dbus/shill_client_unittest_base.h b/chromeos/dbus/shill_client_unittest_base.h index 830b8c1d..1b4bd06c 100644 --- a/chromeos/dbus/shill_client_unittest_base.h +++ b/chromeos/dbus/shill_client_unittest_base.h
@@ -187,7 +187,7 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback); + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback); // Checks the requested interface name and signal name. // Used to implement the mock proxy. @@ -195,7 +195,7 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback); + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback); // Checks the requested interface name and signal name. // Used to implement the mock proxy. @@ -203,7 +203,7 @@ const std::string& interface_name, const std::string& signal_name, const dbus::ObjectProxy::SignalCallback& signal_callback, - const dbus::ObjectProxy::OnConnectedCallback& on_connected_callback); + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback); // Checks the content of the method call and returns the response. // Used to implement the mock proxy.
diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc index c37bafa2..bf9c72d 100644 --- a/chromeos/network/managed_network_configuration_handler_impl.cc +++ b/chromeos/network/managed_network_configuration_handler_impl.cc
@@ -72,7 +72,7 @@ error_callback, service_path, error_name, error_msg); } -void LogErrorWithDict(const tracked_objects::Location& from_where, +void LogErrorWithDict(const base::Location& from_where, const std::string& error_name, std::unique_ptr<base::DictionaryValue> error_data) { device_event_log::AddEntry(from_where.file_name(), from_where.line_number(),
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc index 884ba3a..c17d8c2 100644 --- a/chromeos/network/network_state_handler.cc +++ b/chromeos/network/network_state_handler.cc
@@ -129,9 +129,8 @@ return handler; } -void NetworkStateHandler::AddObserver( - NetworkStateHandlerObserver* observer, - const tracked_objects::Location& from_here) { +void NetworkStateHandler::AddObserver(NetworkStateHandlerObserver* observer, + const base::Location& from_here) { observers_.AddObserver(observer); device_event_log::AddEntry( from_here.file_name(), from_here.line_number(), @@ -139,9 +138,8 @@ base::StringPrintf("NetworkStateHandler::AddObserver: 0x%p", observer)); } -void NetworkStateHandler::RemoveObserver( - NetworkStateHandlerObserver* observer, - const tracked_objects::Location& from_here) { +void NetworkStateHandler::RemoveObserver(NetworkStateHandlerObserver* observer, + const base::Location& from_here) { observers_.RemoveObserver(observer); device_event_log::AddEntry( from_here.file_name(), from_here.line_number(),
diff --git a/chromeos/network/policy_applicator.cc b/chromeos/network/policy_applicator.cc index 66070bb..069ac77 100644 --- a/chromeos/network/policy_applicator.cc +++ b/chromeos/network/policy_applicator.cc
@@ -27,7 +27,7 @@ namespace { -void LogErrorMessage(const tracked_objects::Location& from_where, +void LogErrorMessage(const base::Location& from_where, const std::string& error_name, const std::string& error_message) { LOG(ERROR) << from_where.ToString() << ": " << error_message;
diff --git a/chromeos/tpm/tpm_token_info_getter_unittest.cc b/chromeos/tpm/tpm_token_info_getter_unittest.cc index f7ddf3ab..fed94ee 100644 --- a/chromeos/tpm/tpm_token_info_getter_unittest.cc +++ b/chromeos/tpm/tpm_token_info_getter_unittest.cc
@@ -60,7 +60,7 @@ explicit FakeTaskRunner(std::vector<int64_t>* delays) : delays_(delays) {} // base::TaskRunner overrides: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { delays_->push_back(delay.InMilliseconds());
diff --git a/components/autofill/core/browser/webdata/autocomplete_syncable_service.cc b/components/autofill/core/browser/webdata/autocomplete_syncable_service.cc index c0e86025..6053afa 100644 --- a/components/autofill/core/browser/webdata/autocomplete_syncable_service.cc +++ b/components/autofill/core/browser/webdata/autocomplete_syncable_service.cc
@@ -193,7 +193,7 @@ } syncer::SyncError AutocompleteSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(sync_processor_);
diff --git a/components/autofill/core/browser/webdata/autocomplete_syncable_service.h b/components/autofill/core/browser/webdata/autocomplete_syncable_service.h index 9d603cc1..72a22f7 100644 --- a/components/autofill/core/browser/webdata/autocomplete_syncable_service.h +++ b/components/autofill/core/browser/webdata/autocomplete_syncable_service.h
@@ -74,7 +74,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; // AutofillWebDataServiceObserverOnDBSequence:
diff --git a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc index e67793de..3839432 100644 --- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc +++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.cc
@@ -227,7 +227,7 @@ } syncer::SyncError AutofillProfileSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (!sync_processor_.get()) {
diff --git a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h index 9ab9586..8566101 100644 --- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h +++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service.h
@@ -75,7 +75,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; // AutofillWebDataServiceObserverOnDBSequence implementation.
diff --git a/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc b/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc index 7c84046..ce2a59ec 100644 --- a/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_profile_syncable_service_unittest.cc
@@ -107,7 +107,7 @@ ~MockSyncChangeProcessor() override {} MOCK_METHOD2(ProcessSyncChanges, - syncer::SyncError(const tracked_objects::Location&, + syncer::SyncError(const base::Location&, const syncer::SyncChangeList&)); syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override { return syncer::SyncDataList(); @@ -120,7 +120,7 @@ ~TestSyncChangeProcessor() override {} syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& location, + const base::Location& location, const syncer::SyncChangeList& changes) override { changes_ = changes; return syncer::SyncError();
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc index 7d47212..a1720b4 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc +++ b/components/autofill/core/browser/webdata/autofill_wallet_metadata_syncable_service.cc
@@ -387,7 +387,7 @@ } syncer::SyncError AutofillWalletMetadataSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& changes_from_sync) { DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc b/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc index 3938297..90d6408 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc +++ b/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.cc
@@ -238,7 +238,7 @@ } syncer::SyncError AutofillWalletSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { DCHECK(thread_checker_.CalledOnValidThread()); // Don't bother handling incremental updates. Wallet data changes very rarely
diff --git a/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.h b/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.h index 4156f6cd..9e823ae9 100644 --- a/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.h +++ b/components/autofill/core/browser/webdata/autofill_wallet_syncable_service.h
@@ -39,7 +39,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; // Creates a new AutofillWalletSyncableService and hangs it off of
diff --git a/components/browser_sync/profile_sync_components_factory_impl.h b/components/browser_sync/profile_sync_components_factory_impl.h index 9fc0538c..351e688 100644 --- a/components/browser_sync/profile_sync_components_factory_impl.h +++ b/components/browser_sync/profile_sync_components_factory_impl.h
@@ -102,7 +102,7 @@ syncer::ModelTypeSet enabled_types); void DisableBrokenType(syncer::ModelType type, - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& message); // Client/platform specific members.
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc index 6bb12ee..e033379 100644 --- a/components/browser_sync/profile_sync_service.cc +++ b/components/browser_sync/profile_sync_service.cc
@@ -815,14 +815,13 @@ void ProfileSyncService::ClearUnrecoverableError() { unrecoverable_error_reason_ = ERROR_REASON_UNSET; unrecoverable_error_message_.clear(); - unrecoverable_error_location_ = tracked_objects::Location(); + unrecoverable_error_location_ = base::Location(); } // An invariant has been violated. Transition to an error state where we try // to do as little work as possible, to avoid further corruption or crashes. -void ProfileSyncService::OnUnrecoverableError( - const tracked_objects::Location& from_here, - const std::string& message) { +void ProfileSyncService::OnUnrecoverableError(const base::Location& from_here, + const std::string& message) { DCHECK(thread_checker_.CalledOnValidThread()); // Unrecoverable errors that arrive via the syncer::UnrecoverableErrorHandler // interface are assumed to originate within the syncer. @@ -831,7 +830,7 @@ } void ProfileSyncService::OnUnrecoverableErrorImpl( - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& message, bool delete_sync_database) { DCHECK(HasUnrecoverableError()); @@ -2219,7 +2218,7 @@ } void ProfileSyncService::OnInternalUnrecoverableError( - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& message, bool delete_sync_database, UnrecoverableErrorReason reason) { @@ -2382,8 +2381,7 @@ return unrecoverable_error_message_; } -tracked_objects::Location ProfileSyncService::unrecoverable_error_location() - const { +base::Location ProfileSyncService::unrecoverable_error_location() const { DCHECK(thread_checker_.CalledOnValidThread()); return unrecoverable_error_location_; }
diff --git a/components/browser_sync/profile_sync_service.h b/components/browser_sync/profile_sync_service.h index 58ad6d37..c7c3d53 100644 --- a/components/browser_sync/profile_sync_service.h +++ b/components/browser_sync/profile_sync_service.h
@@ -301,7 +301,7 @@ std::unique_ptr<base::Value> GetTypeStatusMap() override; const GURL& sync_service_url() const override; std::string unrecoverable_error_message() const override; - tracked_objects::Location unrecoverable_error_location() const override; + base::Location unrecoverable_error_location() const override; void AddProtocolEventObserver( syncer::ProtocolEventObserver* observer) override; void RemoveProtocolEventObserver( @@ -444,7 +444,7 @@ virtual bool IsManaged() const; // syncer::UnrecoverableErrorHandler implementation. - void OnUnrecoverableError(const tracked_objects::Location& from_here, + void OnUnrecoverableError(const base::Location& from_here, const std::string& message) override; // The functions below (until ActivateDataType()) should only be @@ -638,7 +638,7 @@ // Helper for OnUnrecoverableError. // TODO(tim): Use an enum for |delete_sync_database| here, in ShutdownImpl, // and in SyncEngine::Shutdown. - void OnUnrecoverableErrorImpl(const tracked_objects::Location& from_here, + void OnUnrecoverableErrorImpl(const base::Location& from_here, const std::string& message, bool delete_sync_database); @@ -685,7 +685,7 @@ // Internal unrecoverable error handler. Used to track error reason via // Sync.UnrecoverableErrors histogram. - void OnInternalUnrecoverableError(const tracked_objects::Location& from_here, + void OnInternalUnrecoverableError(const base::Location& from_here, const std::string& message, bool delete_sync_database, UnrecoverableErrorReason reason); @@ -793,7 +793,7 @@ // Information describing an unrecoverable error. UnrecoverableErrorReason unrecoverable_error_reason_; std::string unrecoverable_error_message_; - tracked_objects::Location unrecoverable_error_location_; + base::Location unrecoverable_error_location_; // Manages the start and stop of the data types. std::unique_ptr<syncer::DataTypeManager> data_type_manager_;
diff --git a/components/browser_sync/profile_sync_service_autofill_unittest.cc b/components/browser_sync/profile_sync_service_autofill_unittest.cc index 94ddc3e..ee553e5 100644 --- a/components/browser_sync/profile_sync_service_autofill_unittest.cc +++ b/components/browser_sync/profile_sync_service_autofill_unittest.cc
@@ -706,7 +706,7 @@ // Overload write transaction to use custom NotifyTransactionComplete class WriteTransactionTest : public WriteTransaction { public: - WriteTransactionTest(const tracked_objects::Location& from_here, + WriteTransactionTest(const base::Location& from_here, WriterTag writer, syncer::syncable::Directory* directory, WaitableEvent* wait_for_syncapi)
diff --git a/components/browser_sync/profile_sync_service_mock.h b/components/browser_sync/profile_sync_service_mock.h index 1df3ffb..688be7a 100644 --- a/components/browser_sync/profile_sync_service_mock.h +++ b/components/browser_sync/profile_sync_service_mock.h
@@ -45,7 +45,7 @@ void(bool sync_everything, syncer::ModelTypeSet chosen_types)); MOCK_METHOD2(OnUnrecoverableError, - void(const tracked_objects::Location& location, + void(const base::Location& location, const std::string& message)); MOCK_CONST_METHOD0(GetUserShare, syncer::UserShare*()); MOCK_METHOD0(RequestStart, void());
diff --git a/components/cronet/android/cronet_url_request_context_adapter.cc b/components/cronet/android/cronet_url_request_context_adapter.cc index 388d831..54c1c7e 100644 --- a/components/cronet/android/cronet_url_request_context_adapter.cc +++ b/components/cronet/android/cronet_url_request_context_adapter.cc
@@ -526,7 +526,7 @@ } void CronetURLRequestContextAdapter::PostTaskToNetworkThread( - const tracked_objects::Location& posted_from, + const base::Location& posted_from, const base::Closure& callback) { GetNetworkTaskRunner()->PostTask( posted_from, base::Bind(&CronetURLRequestContextAdapter::
diff --git a/components/cronet/android/cronet_url_request_context_adapter.h b/components/cronet/android/cronet_url_request_context_adapter.h index cdfa4ee..75fccdd 100644 --- a/components/cronet/android/cronet_url_request_context_adapter.h +++ b/components/cronet/android/cronet_url_request_context_adapter.h
@@ -68,7 +68,7 @@ // Posts a task that might depend on the context being initialized // to the network thread. - void PostTaskToNetworkThread(const tracked_objects::Location& posted_from, + void PostTaskToNetworkThread(const base::Location& posted_from, const base::Closure& callback); bool IsOnNetworkThread() const;
diff --git a/components/cronet/ios/cronet_environment.h b/components/cronet/ios/cronet_environment.h index d76aade..c9a3003 100644 --- a/components/cronet/ios/cronet_environment.h +++ b/components/cronet/ios/cronet_environment.h
@@ -146,7 +146,7 @@ base::SingleThreadTaskRunner* GetNetworkThreadTaskRunner(); // Runs a closure on the network thread. - void PostToNetworkThread(const tracked_objects::Location& from_here, + void PostToNetworkThread(const base::Location& from_here, const base::Closure& task); // Helper methods that start/stop net logging on the network thread.
diff --git a/components/cronet/ios/cronet_environment.mm b/components/cronet/ios/cronet_environment.mm index 4ad2a44..1506e49 100644 --- a/components/cronet/ios/cronet_environment.mm +++ b/components/cronet/ios/cronet_environment.mm
@@ -107,9 +107,8 @@ return ios_global_state::GetSharedNetworkIOThreadTaskRunner().get(); } -void CronetEnvironment::PostToNetworkThread( - const tracked_objects::Location& from_here, - const base::Closure& task) { +void CronetEnvironment::PostToNetworkThread(const base::Location& from_here, + const base::Closure& task) { GetNetworkThreadTaskRunner()->PostTask(from_here, task); }
diff --git a/components/dom_distiller/core/dom_distiller_store.cc b/components/dom_distiller/core/dom_distiller_store.cc index 53797a0..0d293a6 100644 --- a/components/dom_distiller/core/dom_distiller_store.cc +++ b/components/dom_distiller/core/dom_distiller_store.cc
@@ -310,7 +310,7 @@ } SyncError DomDistillerStore::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { DCHECK(database_loaded_); SyncChangeList database_changes; @@ -400,9 +400,8 @@ } } -bool DomDistillerStore::ApplyChangesToSync( - const tracked_objects::Location& from_here, - const SyncChangeList& change_list) { +bool DomDistillerStore::ApplyChangesToSync(const base::Location& from_here, + const SyncChangeList& change_list) { if (!sync_processor_) { return false; }
diff --git a/components/dom_distiller/core/dom_distiller_store.h b/components/dom_distiller/core/dom_distiller_store.h index a14e38e..26aefdd 100644 --- a/components/dom_distiller/core/dom_distiller_store.h +++ b/components/dom_distiller/core/dom_distiller_store.h
@@ -150,7 +150,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; private: @@ -185,7 +185,7 @@ syncer::SyncChangeList* changes_to_apply, syncer::SyncChangeList* changes_missing); - bool ApplyChangesToSync(const tracked_objects::Location& from_here, + bool ApplyChangesToSync(const base::Location& from_here, const syncer::SyncChangeList& change_list); bool ApplyChangesToDatabase(const syncer::SyncChangeList& change_list);
diff --git a/components/dom_distiller/core/dom_distiller_store_unittest.cc b/components/dom_distiller/core/dom_distiller_store_unittest.cc index c8dfacfc..8bcc9657 100644 --- a/components/dom_distiller/core/dom_distiller_store_unittest.cc +++ b/components/dom_distiller/core/dom_distiller_store_unittest.cc
@@ -55,9 +55,8 @@ class FakeSyncErrorFactory : public syncer::SyncErrorFactory { public: - syncer::SyncError CreateAndUploadError( - const tracked_objects::Location& location, - const std::string& message) override { + syncer::SyncError CreateAndUploadError(const base::Location& location, + const std::string& message) override { return syncer::SyncError(); } }; @@ -71,7 +70,7 @@ return syncer::SyncDataList(); } - SyncError ProcessSyncChanges(const tracked_objects::Location&, + SyncError ProcessSyncChanges(const base::Location&, const syncer::SyncChangeList& changes) override { for (SyncChangeList::const_iterator it = changes.begin(); it != changes.end(); ++it) {
diff --git a/components/domain_reliability/test_util.cc b/components/domain_reliability/test_util.cc index 5bfbb2e..8a8c950 100644 --- a/components/domain_reliability/test_util.cc +++ b/components/domain_reliability/test_util.cc
@@ -28,7 +28,7 @@ ~MockTimer() override {} // MockableTime::Timer implementation: - void Start(const tracked_objects::Location& posted_from, + void Start(const base::Location& posted_from, base::TimeDelta delay, const base::Closure& user_task) override { DCHECK(!user_task.is_null());
diff --git a/components/domain_reliability/util.cc b/components/domain_reliability/util.cc index 8a9eb54..ea25394 100644 --- a/components/domain_reliability/util.cc +++ b/components/domain_reliability/util.cc
@@ -213,7 +213,7 @@ ~ActualTimer() override {} // MockableTime::Timer implementation: - void Start(const tracked_objects::Location& posted_from, + void Start(const base::Location& posted_from, base::TimeDelta delay, const base::Closure& user_task) override { base_timer_.Start(posted_from, delay, user_task);
diff --git a/components/domain_reliability/util.h b/components/domain_reliability/util.h index 3ef2e75..dd159cf 100644 --- a/components/domain_reliability/util.h +++ b/components/domain_reliability/util.h
@@ -66,7 +66,7 @@ public: virtual ~Timer(); - virtual void Start(const tracked_objects::Location& posted_from, + virtual void Start(const base::Location& posted_from, base::TimeDelta delay, const base::Closure& user_task) = 0; virtual void Stop() = 0;
diff --git a/components/drive/drive_api_util.cc b/components/drive/drive_api_util.cc index 6b240aad..b910ca5 100644 --- a/components/drive/drive_api_util.cc +++ b/components/drive/drive_api_util.cc
@@ -201,7 +201,7 @@ } void RunAsyncTask(base::TaskRunner* task_runner, - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceCallback<FileError()> task, base::OnceCallback<void(FileError)> reply) { PostTaskAndReplyWithResult(task_runner, from_here, std::move(task),
diff --git a/components/exo/BUILD.gn b/components/exo/BUILD.gn index 7689e5e..cc78d33 100644 --- a/components/exo/BUILD.gn +++ b/components/exo/BUILD.gn
@@ -129,6 +129,7 @@ sources = [ "buffer_unittest.cc", + "data_device_unittest.cc", "data_offer_unittest.cc", "display_unittest.cc", "keyboard_unittest.cc",
diff --git a/components/exo/data_device_unittest.cc b/components/exo/data_device_unittest.cc new file mode 100644 index 0000000..9f8d958 --- /dev/null +++ b/components/exo/data_device_unittest.cc
@@ -0,0 +1,214 @@ +// 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 "components/exo/data_device.h" + +#include <memory> +#include <string> +#include <vector> + +#include "base/strings/string16.h" +#include "base/strings/utf_string_conversions.h" +#include "components/exo/data_device_delegate.h" +#include "components/exo/data_offer.h" +#include "components/exo/data_offer_delegate.h" +#include "components/exo/file_helper.h" +#include "components/exo/surface.h" +#include "components/exo/test/exo_test_base.h" +#include "ui/base/dragdrop/drag_drop_types.h" +#include "ui/base/dragdrop/drop_target_event.h" +#include "ui/base/dragdrop/os_exchange_data.h" +#include "ui/events/event.h" + +namespace exo { +namespace { + +enum class DragEvent { kOffer, kEnter, kLeave, kMotion, kDrop, kDestroy }; + +class TestDataOfferDelegate : public DataOfferDelegate { + public: + ~TestDataOfferDelegate() override {} + + // Overridden from DataOfferDelegate: + void OnDataOfferDestroying(DataOffer* offer) override { delete this; } + void OnOffer(const std::string& mime_type) override {} + void OnSourceActions( + const base::flat_set<DndAction>& source_actions) override {} + void OnAction(DndAction action) override {} +}; + +class TestDataDeviceDelegate : public DataDeviceDelegate { + public: + TestDataDeviceDelegate() {} + + size_t PopEvents(std::vector<DragEvent>* out) { + out->swap(events_); + events_.clear(); + return out->size(); + } + Surface* entered_surface() const { return entered_surface_; } + void DeleteDataOffer() { data_offer_.reset(); } + void set_can_accept_data_events_for_surface(bool value) { + can_accept_data_events_for_surface_ = value; + } + + // Overridden from DataDeviceDelegate: + void OnDataDeviceDestroying(DataDevice* data_device) override { + events_.push_back(DragEvent::kDestroy); + } + DataOffer* OnDataOffer() override { + events_.push_back(DragEvent::kOffer); + data_offer_.reset(new DataOffer(new TestDataOfferDelegate)); + return data_offer_.get(); + } + void OnEnter(Surface* surface, + const gfx::PointF& location, + const DataOffer& data_offer) override { + events_.push_back(DragEvent::kEnter); + entered_surface_ = surface; + } + void OnLeave() override { events_.push_back(DragEvent::kLeave); } + void OnMotion(base::TimeTicks time_stamp, + const gfx::PointF& location) override { + events_.push_back(DragEvent::kMotion); + } + void OnDrop() override { events_.push_back(DragEvent::kDrop); } + void OnSelection(const DataOffer& data_offer) override {} + bool CanAcceptDataEventsForSurface(Surface* surface) override { + return can_accept_data_events_for_surface_; + } + + private: + std::vector<DragEvent> events_; + std::unique_ptr<DataOffer> data_offer_; + Surface* entered_surface_ = nullptr; + bool can_accept_data_events_for_surface_ = true; + + DISALLOW_COPY_AND_ASSIGN(TestDataDeviceDelegate); +}; + +class TestFileHelper : public FileHelper { + public: + TestFileHelper() = default; + + // Overridden from FileHelper: + std::string GetMimeTypeForUriList() const override { return ""; } + bool ConvertPathToUrl(const base::FilePath& path, GURL* out) override { + return true; + } + + private: + DISALLOW_COPY_AND_ASSIGN(TestFileHelper); +}; + +class DataDeviceTest : public test::ExoTestBase { + public: + void SetUp() override { + test::ExoTestBase::SetUp(); + device_ = base::MakeUnique<DataDevice>(&delegate_, &file_helper_); + data_.SetString(base::string16(base::ASCIIToUTF16("Test data"))); + surface_ = base::MakeUnique<Surface>(); + } + + void TearDown() override { + surface_.reset(); + device_.reset(); + test::ExoTestBase::TearDown(); + } + + protected: + TestDataDeviceDelegate delegate_; + TestFileHelper file_helper_; + std::unique_ptr<DataDevice> device_; + ui::OSExchangeData data_; + std::unique_ptr<Surface> surface_; +}; + +TEST_F(DataDeviceTest, Destroy) { + std::vector<DragEvent> events; + device_.reset(); + ASSERT_EQ(1u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kDestroy, events[0]); +} + +TEST_F(DataDeviceTest, DragEventsDrop) { + ui::DropTargetEvent event(data_, gfx::Point(), gfx::Point(), + ui::DragDropTypes::DRAG_MOVE); + ui::Event::DispatcherApi(&event).set_target(surface_->window()); + + std::vector<DragEvent> events; + device_->OnDragEntered(event); + ASSERT_EQ(2u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kOffer, events[0]); + EXPECT_EQ(DragEvent::kEnter, events[1]); + + EXPECT_EQ(ui::DragDropTypes::DRAG_LINK, device_->OnDragUpdated(event)); + ASSERT_EQ(1u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kMotion, events[0]); + + device_->OnPerformDrop(event); + ASSERT_EQ(1u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kDrop, events[0]); +} + +TEST_F(DataDeviceTest, DragEventsExit) { + ui::DropTargetEvent event(data_, gfx::Point(), gfx::Point(), + ui::DragDropTypes::DRAG_MOVE); + ui::Event::DispatcherApi(&event).set_target(surface_->window()); + + std::vector<DragEvent> events; + device_->OnDragEntered(event); + ASSERT_EQ(2u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kOffer, events[0]); + EXPECT_EQ(DragEvent::kEnter, events[1]); + + EXPECT_EQ(ui::DragDropTypes::DRAG_LINK, device_->OnDragUpdated(event)); + ASSERT_EQ(1u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kMotion, events[0]); + + device_->OnDragExited(); + ASSERT_EQ(1u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kLeave, events[0]); +} + +TEST_F(DataDeviceTest, DeleteDataOfferDuringDrag) { + ui::DropTargetEvent event(data_, gfx::Point(), gfx::Point(), + ui::DragDropTypes::DRAG_MOVE); + ui::Event::DispatcherApi(&event).set_target(surface_->window()); + + std::vector<DragEvent> events; + device_->OnDragEntered(event); + ASSERT_EQ(2u, delegate_.PopEvents(&events)); + EXPECT_EQ(DragEvent::kOffer, events[0]); + EXPECT_EQ(DragEvent::kEnter, events[1]); + + delegate_.DeleteDataOffer(); + + EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, device_->OnDragUpdated(event)); + EXPECT_EQ(0u, delegate_.PopEvents(&events)); + + device_->OnPerformDrop(event); + EXPECT_EQ(0u, delegate_.PopEvents(&events)); +} + +TEST_F(DataDeviceTest, NotAcceptDataEventsForSurface) { + ui::DropTargetEvent event(data_, gfx::Point(), gfx::Point(), + ui::DragDropTypes::DRAG_MOVE); + ui::Event::DispatcherApi(&event).set_target(surface_->window()); + + std::vector<DragEvent> events; + delegate_.set_can_accept_data_events_for_surface(false); + + device_->OnDragEntered(event); + EXPECT_EQ(0u, delegate_.PopEvents(&events)); + + EXPECT_EQ(ui::DragDropTypes::DRAG_NONE, device_->OnDragUpdated(event)); + EXPECT_EQ(0u, delegate_.PopEvents(&events)); + + device_->OnPerformDrop(event); + EXPECT_EQ(0u, delegate_.PopEvents(&events)); +} + +} // namespace +} // namespace exo
diff --git a/components/exo/data_offer_unittest.cc b/components/exo/data_offer_unittest.cc index 03e9eae..34c3212 100644 --- a/components/exo/data_offer_unittest.cc +++ b/components/exo/data_offer_unittest.cc
@@ -25,7 +25,7 @@ class TestDataOfferDelegate : public DataOfferDelegate { public: - TestDataOfferDelegate() : dnd_action_(DndAction::kNone) {} + TestDataOfferDelegate() {} // Called at the top of the data device's destructor, to give observers a // chance to remove themselves. @@ -54,7 +54,7 @@ private: std::vector<std::string> mime_types_; base::flat_set<DndAction> source_actions_; - DndAction dnd_action_; + DndAction dnd_action_ = DndAction::kNone; DISALLOW_COPY_AND_ASSIGN(TestDataOfferDelegate); };
diff --git a/components/grpc_support/bidirectional_stream.cc b/components/grpc_support/bidirectional_stream.cc index 79712bf..129b334 100644 --- a/components/grpc_support/bidirectional_stream.cc +++ b/components/grpc_support/bidirectional_stream.cc
@@ -392,9 +392,8 @@ ->BelongsToCurrentThread(); } -void BidirectionalStream::PostToNetworkThread( - const tracked_objects::Location& from_here, - const base::Closure& task) { +void BidirectionalStream::PostToNetworkThread(const base::Location& from_here, + const base::Closure& task) { request_context_getter_->GetNetworkTaskRunner()->PostTask(from_here, task); }
diff --git a/components/history/core/browser/history_service.cc b/components/history/core/browser/history_service.cc index 982a8b1..0fecb21 100644 --- a/components/history/core/browser/history_service.cc +++ b/components/history/core/browser/history_service.cc
@@ -981,7 +981,7 @@ } syncer::SyncError HistoryService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { delete_directive_handler_.ProcessSyncChanges(this, change_list); return syncer::SyncError();
diff --git a/components/history/core/browser/typed_url_data_type_controller.cc b/components/history/core/browser/typed_url_data_type_controller.cc index d27a4f6..2fc2c86 100644 --- a/components/history/core/browser/typed_url_data_type_controller.cc +++ b/components/history/core/browser/typed_url_data_type_controller.cc
@@ -91,7 +91,7 @@ } bool TypedUrlDataTypeController::PostTaskOnModelThread( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { DCHECK(CalledOnValidThread()); history::HistoryService* history = sync_client_->GetHistoryService();
diff --git a/components/history/core/browser/typed_url_data_type_controller.h b/components/history/core/browser/typed_url_data_type_controller.h index 2f5e1d06..1883652 100644 --- a/components/history/core/browser/typed_url_data_type_controller.h +++ b/components/history/core/browser/typed_url_data_type_controller.h
@@ -30,7 +30,7 @@ protected: // AsyncDirectoryTypeController implementation. - bool PostTaskOnModelThread(const tracked_objects::Location& from_here, + bool PostTaskOnModelThread(const base::Location& from_here, const base::Closure& task) override; private:
diff --git a/components/history/core/browser/typed_url_syncable_service.cc b/components/history/core/browser/typed_url_syncable_service.cc index 3f35784..98bf4b9 100644 --- a/components/history/core/browser/typed_url_syncable_service.cc +++ b/components/history/core/browser/typed_url_syncable_service.cc
@@ -233,7 +233,7 @@ } syncer::SyncError TypedUrlSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { DCHECK(sequence_checker_.CalledOnValidSequence());
diff --git a/components/password_manager/core/browser/password_syncable_service.cc b/components/password_manager/core/browser/password_syncable_service.cc index a1c2dd6..8677848 100644 --- a/components/password_manager/core/browser/password_syncable_service.cc +++ b/components/password_manager/core/browser/password_syncable_service.cc
@@ -438,7 +438,7 @@ } syncer::SyncError PasswordSyncableService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); base::AutoReset<bool> processing_changes(&is_processing_sync_changes_, true);
diff --git a/components/password_manager/core/browser/password_syncable_service.h b/components/password_manager/core/browser/password_syncable_service.h index 98b6bcc..e2fd572 100644 --- a/components/password_manager/core/browser/password_syncable_service.h +++ b/components/password_manager/core/browser/password_syncable_service.h
@@ -50,7 +50,7 @@ void StopSyncing(syncer::ModelType type) override; syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; // Notifies the Sync engine of changes to the password database.
diff --git a/components/password_manager/core/browser/password_syncable_service_unittest.cc b/components/password_manager/core/browser/password_syncable_service_unittest.cc index 5c38bc5..06fe71b 100644 --- a/components/password_manager/core/browser/password_syncable_service_unittest.cc +++ b/components/password_manager/core/browser/password_syncable_service_unittest.cc
@@ -167,8 +167,7 @@ MockSyncChangeProcessor() {} MOCK_METHOD2(ProcessSyncChanges, - SyncError(const tracked_objects::Location&, - const SyncChangeList& list)); + SyncError(const base::Location&, const SyncChangeList& list)); SyncDataList GetAllSyncData(syncer::ModelType type) const override { NOTREACHED(); return SyncDataList();
diff --git a/components/password_manager/sync/browser/password_data_type_controller.cc b/components/password_manager/sync/browser/password_data_type_controller.cc index ad1270b..49213ea 100644 --- a/components/password_manager/sync/browser/password_data_type_controller.cc +++ b/components/password_manager/sync/browser/password_data_type_controller.cc
@@ -29,7 +29,7 @@ PasswordDataTypeController::~PasswordDataTypeController() {} bool PasswordDataTypeController::PostTaskOnModelThread( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { DCHECK(CalledOnValidThread()); if (!password_store_.get())
diff --git a/components/password_manager/sync/browser/password_data_type_controller.h b/components/password_manager/sync/browser/password_data_type_controller.h index d6dc1fcb..10f8cef 100644 --- a/components/password_manager/sync/browser/password_data_type_controller.h +++ b/components/password_manager/sync/browser/password_data_type_controller.h
@@ -35,7 +35,7 @@ protected: // AsyncDirectoryTypeController interface. - bool PostTaskOnModelThread(const tracked_objects::Location& from_here, + bool PostTaskOnModelThread(const base::Location& from_here, const base::Closure& task) override; bool StartModels() override; void StopModels() override;
diff --git a/components/search_engines/template_url_service.cc b/components/search_engines/template_url_service.cc index 14f718a..a015529 100644 --- a/components/search_engines/template_url_service.cc +++ b/components/search_engines/template_url_service.cc
@@ -855,7 +855,7 @@ } syncer::SyncError TemplateURLService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) { if (!models_associated_) { syncer::SyncError error(FROM_HERE, @@ -1131,7 +1131,7 @@ } void TemplateURLService::ProcessTemplateURLChange( - const tracked_objects::Location& from_here, + const base::Location& from_here, const TemplateURL* turl, syncer::SyncChange::SyncChangeType type) { DCHECK_NE(type, syncer::SyncChange::ACTION_INVALID);
diff --git a/components/search_engines/template_url_service.h b/components/search_engines/template_url_service.h index 884c582..67ce263 100644 --- a/components/search_engines/template_url_service.h +++ b/components/search_engines/template_url_service.h
@@ -347,7 +347,7 @@ // data. This may send notifications if local search engines are added, // updated or removed. syncer::SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const syncer::SyncChangeList& change_list) override; // Merge initial search engine data from Sync and push any local changes up // to Sync. This may send notifications if local search engines are added, @@ -364,7 +364,7 @@ // This may send a new SyncChange to the cloud. If our model has not yet been // associated with Sync, or if this is triggered by a Sync change, then this // does nothing. - void ProcessTemplateURLChange(const tracked_objects::Location& from_here, + void ProcessTemplateURLChange(const base::Location& from_here, const TemplateURL* turl, syncer::SyncChange::SyncChangeType type);
diff --git a/components/sessions/core/base_session_service.cc b/components/sessions/core/base_session_service.cc index 770c7d9..ba4a368 100644 --- a/components/sessions/core/base_session_service.cc +++ b/components/sessions/core/base_session_service.cc
@@ -171,9 +171,8 @@ return id; } -void BaseSessionService::RunTaskOnBackendThread( - const tracked_objects::Location& from_here, - base::OnceClosure task) { +void BaseSessionService::RunTaskOnBackendThread(const base::Location& from_here, + base::OnceClosure task) { backend_task_runner_->PostNonNestableTask(from_here, std::move(task)); }
diff --git a/components/subresource_filter/content/browser/content_ruleset_service_unittest.cc b/components/subresource_filter/content/browser/content_ruleset_service_unittest.cc index e99b4be..01bd24f 100644 --- a/components/subresource_filter/content/browser/content_ruleset_service_unittest.cc +++ b/components/subresource_filter/content/browser/content_ruleset_service_unittest.cc
@@ -46,7 +46,7 @@ TestContentBrowserClient() {} // ::content::ContentBrowserClient: - void PostAfterStartupTask(const tracked_objects::Location&, + void PostAfterStartupTask(const base::Location&, const scoped_refptr<base::TaskRunner>& task_runner, base::OnceClosure task) override { scoped_refptr<base::TaskRunner> ui_task_runner =
diff --git a/components/sync/base/logging.cc b/components/sync/base/logging.cc index 77b5284..606bce0 100644 --- a/components/sync/base/logging.cc +++ b/components/sync/base/logging.cc
@@ -8,8 +8,7 @@ namespace syncer { -bool VlogIsOnForLocation(const tracked_objects::Location& from_here, - int verbose_level) { +bool VlogIsOnForLocation(const base::Location& from_here, int verbose_level) { return (verbose_level <= logging::GetVlogLevelHelper(from_here.file_name(), ::strlen(from_here.file_name())));
diff --git a/components/sync/base/mock_unrecoverable_error_handler.cc b/components/sync/base/mock_unrecoverable_error_handler.cc index bad84bd..c79092b 100644 --- a/components/sync/base/mock_unrecoverable_error_handler.cc +++ b/components/sync/base/mock_unrecoverable_error_handler.cc
@@ -12,7 +12,7 @@ MockUnrecoverableErrorHandler::~MockUnrecoverableErrorHandler() {} void MockUnrecoverableErrorHandler::OnUnrecoverableError( - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& message) { ++invocation_count_; }
diff --git a/components/sync/base/mock_unrecoverable_error_handler.h b/components/sync/base/mock_unrecoverable_error_handler.h index a982dabc..811f7bb3 100644 --- a/components/sync/base/mock_unrecoverable_error_handler.h +++ b/components/sync/base/mock_unrecoverable_error_handler.h
@@ -19,7 +19,7 @@ public: MockUnrecoverableErrorHandler(); ~MockUnrecoverableErrorHandler() override; - void OnUnrecoverableError(const tracked_objects::Location& from_here, + void OnUnrecoverableError(const base::Location& from_here, const std::string& message) override; // Returns the number of times this handler has been invoked.
diff --git a/components/sync/base/test_unrecoverable_error_handler.cc b/components/sync/base/test_unrecoverable_error_handler.cc index 0160596..453c67b 100644 --- a/components/sync/base/test_unrecoverable_error_handler.cc +++ b/components/sync/base/test_unrecoverable_error_handler.cc
@@ -14,7 +14,7 @@ TestUnrecoverableErrorHandler::~TestUnrecoverableErrorHandler() {} void TestUnrecoverableErrorHandler::OnUnrecoverableError( - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& message) { ADD_FAILURE_AT(from_here.file_name(), from_here.line_number()) << from_here.function_name() << ": " << message;
diff --git a/components/sync/base/test_unrecoverable_error_handler.h b/components/sync/base/test_unrecoverable_error_handler.h index 03ab4d76..c2fd6c2b 100644 --- a/components/sync/base/test_unrecoverable_error_handler.h +++ b/components/sync/base/test_unrecoverable_error_handler.h
@@ -20,7 +20,7 @@ TestUnrecoverableErrorHandler(); ~TestUnrecoverableErrorHandler() override; - void OnUnrecoverableError(const tracked_objects::Location& from_here, + void OnUnrecoverableError(const base::Location& from_here, const std::string& message) override; base::WeakPtr<TestUnrecoverableErrorHandler> GetWeakPtr();
diff --git a/components/sync/base/unrecoverable_error_handler.h b/components/sync/base/unrecoverable_error_handler.h index dda0f69d..fecd893 100644 --- a/components/sync/base/unrecoverable_error_handler.h +++ b/components/sync/base/unrecoverable_error_handler.h
@@ -17,7 +17,7 @@ // syncer model are inconsistent, or similar. The ProfileSyncService will // try to avoid doing any work to avoid crashing or corrupting things // further, and will report an error status if queried. - virtual void OnUnrecoverableError(const tracked_objects::Location& from_here, + virtual void OnUnrecoverableError(const base::Location& from_here, const std::string& message) = 0; virtual ~UnrecoverableErrorHandler() {} };
diff --git a/components/sync/base/unrecoverable_error_info.cc b/components/sync/base/unrecoverable_error_info.cc index aa19dde..67ac4365 100644 --- a/components/sync/base/unrecoverable_error_info.cc +++ b/components/sync/base/unrecoverable_error_info.cc
@@ -8,14 +8,13 @@ UnrecoverableErrorInfo::UnrecoverableErrorInfo() : is_set_(false) {} -UnrecoverableErrorInfo::UnrecoverableErrorInfo( - const tracked_objects::Location& location, - const std::string& message) +UnrecoverableErrorInfo::UnrecoverableErrorInfo(const base::Location& location, + const std::string& message) : location_(location), message_(message), is_set_(true) {} UnrecoverableErrorInfo::~UnrecoverableErrorInfo() {} -void UnrecoverableErrorInfo::Reset(const tracked_objects::Location& location, +void UnrecoverableErrorInfo::Reset(const base::Location& location, const std::string& message) { location_ = location; message_ = message; @@ -26,7 +25,7 @@ return is_set_; } -const tracked_objects::Location& UnrecoverableErrorInfo::location() const { +const base::Location& UnrecoverableErrorInfo::location() const { return location_; }
diff --git a/components/sync/base/unrecoverable_error_info.h b/components/sync/base/unrecoverable_error_info.h index 54ff902f1..90325e8c 100644 --- a/components/sync/base/unrecoverable_error_info.h +++ b/components/sync/base/unrecoverable_error_info.h
@@ -16,20 +16,19 @@ class UnrecoverableErrorInfo { public: UnrecoverableErrorInfo(); - UnrecoverableErrorInfo(const tracked_objects::Location& location, + UnrecoverableErrorInfo(const base::Location& location, const std::string& message); ~UnrecoverableErrorInfo(); - void Reset(const tracked_objects::Location& location, - const std::string& message); + void Reset(const base::Location& location, const std::string& message); bool IsSet() const; - const tracked_objects::Location& location() const; + const base::Location& location() const; const std::string& message() const; private: - tracked_objects::Location location_; + base::Location location_; std::string message_; bool is_set_; };
diff --git a/components/sync/base/weak_handle.cc b/components/sync/base/weak_handle.cc index d210730..4aa3ec6 100644 --- a/components/sync/base/weak_handle.cc +++ b/components/sync/base/weak_handle.cc
@@ -22,9 +22,8 @@ WeakHandleCoreBase::~WeakHandleCoreBase() {} -void WeakHandleCoreBase::PostToOwnerThread( - const tracked_objects::Location& from_here, - const base::Closure& fn) const { +void WeakHandleCoreBase::PostToOwnerThread(const base::Location& from_here, + const base::Closure& fn) const { if (!owner_loop_task_runner_->PostTask(from_here, fn)) { DVLOG(1) << "Could not post task from " << from_here.ToString(); }
diff --git a/components/sync/base/weak_handle_unittest.cc b/components/sync/base/weak_handle_unittest.cc index b128f1a..7b27850 100644 --- a/components/sync/base/weak_handle_unittest.cc +++ b/components/sync/base/weak_handle_unittest.cc
@@ -49,7 +49,7 @@ void PumpLoop() { base::RunLoop().RunUntilIdle(); } - static void CallTestFromOtherThread(tracked_objects::Location from_here, + static void CallTestFromOtherThread(base::Location from_here, const WeakHandle<Base>& h) { base::Thread t("Test thread"); ASSERT_TRUE(t.Start()); @@ -58,8 +58,7 @@ } private: - static void CallTest(tracked_objects::Location from_here, - const WeakHandle<Base>& h) { + static void CallTest(base::Location from_here, const WeakHandle<Base>& h) { h.Call(from_here, &Base::Test); }
diff --git a/components/sync/device_info/device_info_sync_service.cc b/components/sync/device_info/device_info_sync_service.cc index f6f2398..e5527d8 100644 --- a/components/sync/device_info/device_info_sync_service.cc +++ b/components/sync/device_info/device_info_sync_service.cc
@@ -146,7 +146,7 @@ } SyncError DeviceInfoSyncService::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { SyncError error;
diff --git a/components/sync/device_info/device_info_sync_service.h b/components/sync/device_info/device_info_sync_service.h index e6ee3cea..af736b69 100644 --- a/components/sync/device_info/device_info_sync_service.h +++ b/components/sync/device_info/device_info_sync_service.h
@@ -42,7 +42,7 @@ std::unique_ptr<SyncErrorFactory> error_handler) override; void StopSyncing(ModelType type) override; SyncDataList GetAllSyncData(ModelType type) const override; - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override; // DeviceInfoTracker implementation.
diff --git a/components/sync/device_info/device_info_sync_service_unittest.cc b/components/sync/device_info/device_info_sync_service_unittest.cc index 1f1c907c..5c69eda 100644 --- a/components/sync/device_info/device_info_sync_service_unittest.cc +++ b/components/sync/device_info/device_info_sync_service_unittest.cc
@@ -30,7 +30,7 @@ // SyncChangeProcessor implementation. // Store a copy of all the changes passed in so we can examine them later. - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override { change_list_ = change_list; return SyncError();
diff --git a/components/sync/driver/about_sync_util.cc b/components/sync/driver/about_sync_util.cc index 506bef6..76037b9 100644 --- a/components/sync/driver/about_sync_util.cc +++ b/components/sync/driver/about_sync_util.cc
@@ -584,7 +584,7 @@ service->HasUnrecoverableError()); if (service->HasUnrecoverableError()) { - tracked_objects::Location loc(service->unrecoverable_error_location()); + base::Location loc(service->unrecoverable_error_location()); std::string location_str; loc.Write(true, true, &location_str); std::string unrecoverable_error_message =
diff --git a/components/sync/driver/async_directory_type_controller.cc b/components/sync/driver/async_directory_type_controller.cc index d33b620..799d36c 100644 --- a/components/sync/driver/async_directory_type_controller.cc +++ b/components/sync/driver/async_directory_type_controller.cc
@@ -89,7 +89,7 @@ } bool AsyncDirectoryTypeController::PostTaskOnModelThread( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { DCHECK(CalledOnValidThread()); return model_thread_->PostTask(from_here, task);
diff --git a/components/sync/driver/async_directory_type_controller.h b/components/sync/driver/async_directory_type_controller.h index 1ac3f5b..7ed6f36 100644 --- a/components/sync/driver/async_directory_type_controller.h +++ b/components/sync/driver/async_directory_type_controller.h
@@ -68,7 +68,7 @@ // lives on. Return value: True if task posted successfully, false otherwise. // Default implementation posts task to model_thread_. Types that don't use // TaskRunner need to override this method. - virtual bool PostTaskOnModelThread(const tracked_objects::Location& from_here, + virtual bool PostTaskOnModelThread(const base::Location& from_here, const base::Closure& task); // Start up complete, update the state and invoke the callback.
diff --git a/components/sync/driver/async_directory_type_controller_mock.h b/components/sync/driver/async_directory_type_controller_mock.h index d9d1434..ec1443b 100644 --- a/components/sync/driver/async_directory_type_controller_mock.h +++ b/components/sync/driver/async_directory_type_controller_mock.h
@@ -30,7 +30,7 @@ MOCK_METHOD0(StartModels, bool()); MOCK_METHOD0(StopModels, void()); MOCK_METHOD2(PostTaskOnModelThread, - bool(const tracked_objects::Location&, const base::Closure&)); + bool(const base::Location&, const base::Closure&)); MOCK_METHOD3(StartDone, void(DataTypeController::ConfigureResult result, const SyncMergeResult& local_merge_result,
diff --git a/components/sync/driver/async_directory_type_controller_unittest.cc b/components/sync/driver/async_directory_type_controller_unittest.cc index b8268c0..fedc3cc0 100644 --- a/components/sync/driver/async_directory_type_controller_unittest.cc +++ b/components/sync/driver/async_directory_type_controller_unittest.cc
@@ -71,8 +71,7 @@ } MOCK_METHOD0(Disconnect, bool()); MOCK_METHOD2(ProcessSyncChanges, - SyncError(const tracked_objects::Location&, - const SyncChangeList&)); + SyncError(const base::Location&, const SyncChangeList&)); MOCK_CONST_METHOD2(GetAllSyncDataReturnError, SyncError(ModelType, SyncDataList*)); MOCK_METHOD0(GetSyncCount, int()); @@ -88,7 +87,7 @@ protected: virtual ~SharedChangeProcessorMock() { DCHECK(!connect_return_); } MOCK_METHOD2(OnUnrecoverableError, - void(const tracked_objects::Location&, const std::string&)); + void(const base::Location&, const std::string&)); private: base::WeakPtr<SyncableService> connect_return_; @@ -137,7 +136,7 @@ } protected: - bool PostTaskOnModelThread(const tracked_objects::Location& from_here, + bool PostTaskOnModelThread(const base::Location& from_here, const base::Closure& task) override { if (blocked_) { pending_tasks_.push_back(PendingTask(from_here, task)); @@ -157,11 +156,10 @@ private: struct PendingTask { - PendingTask(const tracked_objects::Location& from_here, - const base::Closure& task) + PendingTask(const base::Location& from_here, const base::Closure& task) : from_here(from_here), task(task) {} - tracked_objects::Location from_here; + base::Location from_here; base::Closure task; };
diff --git a/components/sync/driver/fake_generic_change_processor.cc b/components/sync/driver/fake_generic_change_processor.cc index 358b141..eff644e 100644 --- a/components/sync/driver/fake_generic_change_processor.cc +++ b/components/sync/driver/fake_generic_change_processor.cc
@@ -36,7 +36,7 @@ } SyncError FakeGenericChangeProcessor::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { return SyncError(); }
diff --git a/components/sync/driver/fake_generic_change_processor.h b/components/sync/driver/fake_generic_change_processor.h index 395d8db..0633e188 100644 --- a/components/sync/driver/fake_generic_change_processor.h +++ b/components/sync/driver/fake_generic_change_processor.h
@@ -28,7 +28,7 @@ void set_sync_model_has_user_created_nodes_success(bool success); // GenericChangeProcessor implementations. - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override; SyncError GetAllSyncDataReturnError(SyncDataList* data) const override; bool GetDataTypeContext(std::string* context) const override;
diff --git a/components/sync/driver/fake_sync_service.cc b/components/sync/driver/fake_sync_service.cc index a45a510c..ac981895 100644 --- a/components/sync/driver/fake_sync_service.cc +++ b/components/sync/driver/fake_sync_service.cc
@@ -181,9 +181,8 @@ return unrecoverable_error_message_; } -tracked_objects::Location FakeSyncService::unrecoverable_error_location() - const { - return tracked_objects::Location(); +base::Location FakeSyncService::unrecoverable_error_location() const { + return base::Location(); } void FakeSyncService::AddProtocolEventObserver(
diff --git a/components/sync/driver/fake_sync_service.h b/components/sync/driver/fake_sync_service.h index 2113b3a..270f3357 100644 --- a/components/sync/driver/fake_sync_service.h +++ b/components/sync/driver/fake_sync_service.h
@@ -75,7 +75,7 @@ std::unique_ptr<base::Value> GetTypeStatusMap() override; const GURL& sync_service_url() const override; std::string unrecoverable_error_message() const override; - tracked_objects::Location unrecoverable_error_location() const override; + base::Location unrecoverable_error_location() const override; void AddProtocolEventObserver(ProtocolEventObserver* observer) override; void RemoveProtocolEventObserver(ProtocolEventObserver* observer) override; void AddTypeDebugInfoObserver(TypeDebugInfoObserver* observer) override;
diff --git a/components/sync/driver/generic_change_processor.cc b/components/sync/driver/generic_change_processor.cc index 06eb5ae..d94410aa 100644 --- a/components/sync/driver/generic_change_processor.cc +++ b/components/sync/driver/generic_change_processor.cc
@@ -321,7 +321,7 @@ // attempts to merge it with other calls, losing useful information in // breakpad uploads. SyncError LogLookupFailure(BaseNode::InitByLookupResult lookup_result, - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& error_prefix, ModelType type, DataTypeErrorHandler* error_handler) { @@ -421,7 +421,7 @@ } SyncError GenericChangeProcessor::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& list_of_changes) { DCHECK(sequence_checker_.CalledOnValidSequence());
diff --git a/components/sync/driver/generic_change_processor.h b/components/sync/driver/generic_change_processor.h index 1979eef..a4f9601 100644 --- a/components/sync/driver/generic_change_processor.h +++ b/components/sync/driver/generic_change_processor.h
@@ -73,7 +73,7 @@ void CommitChangesFromSyncModel() override; // SyncChangeProcessor implementation. - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override; SyncDataList GetAllSyncData(ModelType type) const override; SyncError UpdateDataTypeContext(
diff --git a/components/sync/driver/model_type_controller.cc b/components/sync/driver/model_type_controller.cc index 16f69c3..c275be5a 100644 --- a/components/sync/driver/model_type_controller.cc +++ b/components/sync/driver/model_type_controller.cc
@@ -263,9 +263,8 @@ return base::Bind(&ReturnCapturedBridge, bridge); } -void ModelTypeController::PostBridgeTask( - const tracked_objects::Location& location, - const BridgeTask& task) { +void ModelTypeController::PostBridgeTask(const base::Location& location, + const BridgeTask& task) { model_thread_->PostTask( location, base::Bind(&RunBridgeTask, GetBridgeProvider(), task)); }
diff --git a/components/sync/driver/model_type_controller.h b/components/sync/driver/model_type_controller.h index 203f3bca..7007f6ad 100644 --- a/components/sync/driver/model_type_controller.h +++ b/components/sync/driver/model_type_controller.h
@@ -72,8 +72,7 @@ // Post the given task that requires the bridge object to run to the model // thread, where the bridge lives. - void PostBridgeTask(const tracked_objects::Location& location, - const BridgeTask& task); + void PostBridgeTask(const base::Location& location, const BridgeTask& task); // The sync client, which provides access to this type's ModelTypeSyncBridge. SyncClient* const sync_client_;
diff --git a/components/sync/driver/shared_change_processor.cc b/components/sync/driver/shared_change_processor.cc index 6daadff..811349d 100644 --- a/components/sync/driver/shared_change_processor.cc +++ b/components/sync/driver/shared_change_processor.cc
@@ -199,7 +199,7 @@ } SyncError SharedChangeProcessor::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& list_of_changes) { DCHECK(backend_task_runner_.get()); DCHECK(backend_task_runner_->RunsTasksInCurrentSequence()); @@ -301,7 +301,7 @@ } SyncError SharedChangeProcessor::CreateAndUploadError( - const tracked_objects::Location& location, + const base::Location& location, const std::string& message) { AutoLock lock(monitor_lock_); if (!disconnected_) {
diff --git a/components/sync/driver/shared_change_processor.h b/components/sync/driver/shared_change_processor.h index 280ad5e..6e92d44e 100644 --- a/components/sync/driver/shared_change_processor.h +++ b/components/sync/driver/shared_change_processor.h
@@ -92,9 +92,8 @@ // GenericChangeProcessor stubs (with disconnect support). // Should only be called on the same sequence the datatype resides. virtual int GetSyncCount(); - virtual SyncError ProcessSyncChanges( - const tracked_objects::Location& from_here, - const SyncChangeList& change_list); + virtual SyncError ProcessSyncChanges(const base::Location& from_here, + const SyncChangeList& change_list); virtual SyncDataList GetAllSyncData(ModelType type) const; virtual SyncError GetAllSyncDataReturnError(ModelType type, SyncDataList* data) const; @@ -112,9 +111,8 @@ // set, returns false. virtual bool GetDataTypeContext(std::string* context) const; - virtual SyncError CreateAndUploadError( - const tracked_objects::Location& location, - const std::string& message); + virtual SyncError CreateAndUploadError(const base::Location& location, + const std::string& message); // Calls local_service_->StopSyncing() and releases our reference to it. void StopLocalService();
diff --git a/components/sync/driver/shared_change_processor_ref.cc b/components/sync/driver/shared_change_processor_ref.cc index 30b14c7..6d527d3 100644 --- a/components/sync/driver/shared_change_processor_ref.cc +++ b/components/sync/driver/shared_change_processor_ref.cc
@@ -15,7 +15,7 @@ SharedChangeProcessorRef::~SharedChangeProcessorRef() {} SyncError SharedChangeProcessorRef::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { return change_processor_->ProcessSyncChanges(from_here, change_list); } @@ -43,7 +43,7 @@ } SyncError SharedChangeProcessorRef::CreateAndUploadError( - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& message) { return change_processor_->CreateAndUploadError(from_here, message); }
diff --git a/components/sync/driver/shared_change_processor_ref.h b/components/sync/driver/shared_change_processor_ref.h index 844139e..f75ec1c 100644 --- a/components/sync/driver/shared_change_processor_ref.h +++ b/components/sync/driver/shared_change_processor_ref.h
@@ -25,7 +25,7 @@ ~SharedChangeProcessorRef() override; // SyncChangeProcessor implementation. - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override; SyncDataList GetAllSyncData(ModelType type) const override; SyncError UpdateDataTypeContext( @@ -36,7 +36,7 @@ void RemoveLocalChangeObserver(LocalChangeObserver* observer) override; // SyncErrorFactory implementation. - SyncError CreateAndUploadError(const tracked_objects::Location& from_here, + SyncError CreateAndUploadError(const base::Location& from_here, const std::string& message) override; // Default copy and assign welcome (and safe due to refcounted-ness).
diff --git a/components/sync/driver/sync_service.h b/components/sync/driver/sync_service.h index dd53cb5..92ffb9f 100644 --- a/components/sync/driver/sync_service.h +++ b/components/sync/driver/sync_service.h
@@ -329,7 +329,7 @@ virtual const GURL& sync_service_url() const = 0; virtual std::string unrecoverable_error_message() const = 0; - virtual tracked_objects::Location unrecoverable_error_location() const = 0; + virtual base::Location unrecoverable_error_location() const = 0; virtual void AddProtocolEventObserver(ProtocolEventObserver* observer) = 0; virtual void RemoveProtocolEventObserver(ProtocolEventObserver* observer) = 0;
diff --git a/components/sync/engine_impl/js_mutation_event_observer.cc b/components/sync/engine_impl/js_mutation_event_observer.cc index 527e51a..5095ee4 100644 --- a/components/sync/engine_impl/js_mutation_event_observer.cc +++ b/components/sync/engine_impl/js_mutation_event_observer.cc
@@ -96,10 +96,9 @@ HandleJsEvent(FROM_HERE, "onTransactionWrite", JsEventDetails(&details)); } -void JsMutationEventObserver::HandleJsEvent( - const tracked_objects::Location& from_here, - const std::string& name, - const JsEventDetails& details) { +void JsMutationEventObserver::HandleJsEvent(const base::Location& from_here, + const std::string& name, + const JsEventDetails& details) { if (!event_handler_.IsInitialized()) { NOTREACHED(); return;
diff --git a/components/sync/engine_impl/js_sync_encryption_handler_observer.cc b/components/sync/engine_impl/js_sync_encryption_handler_observer.cc index 3f430df..1be24de 100644 --- a/components/sync/engine_impl/js_sync_encryption_handler_observer.cc +++ b/components/sync/engine_impl/js_sync_encryption_handler_observer.cc
@@ -108,7 +108,7 @@ const SyncEncryptionHandler::NigoriState& nigori_state) {} void JsSyncEncryptionHandlerObserver::HandleJsEvent( - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& name, const JsEventDetails& details) { if (!event_handler_.IsInitialized()) {
diff --git a/components/sync/engine_impl/js_sync_manager_observer.cc b/components/sync/engine_impl/js_sync_manager_observer.cc index eb3da25..3080461 100644 --- a/components/sync/engine_impl/js_sync_manager_observer.cc +++ b/components/sync/engine_impl/js_sync_manager_observer.cc
@@ -80,10 +80,9 @@ JsEventDetails(&details)); } -void JsSyncManagerObserver::HandleJsEvent( - const tracked_objects::Location& from_here, - const std::string& name, - const JsEventDetails& details) { +void JsSyncManagerObserver::HandleJsEvent(const base::Location& from_here, + const std::string& name, + const JsEventDetails& details) { if (!event_handler_.IsInitialized()) { NOTREACHED(); return;
diff --git a/components/sync/engine_impl/sync_manager_impl.cc b/components/sync/engine_impl/sync_manager_impl.cc index 73daa8b..fa854f1 100644 --- a/components/sync/engine_impl/sync_manager_impl.cc +++ b/components/sync/engine_impl/sync_manager_impl.cc
@@ -784,7 +784,7 @@ } void SyncManagerImpl::RequestNudgeForDataTypes( - const tracked_objects::Location& nudge_location, + const base::Location& nudge_location, ModelTypeSet types) { debug_info_event_listener_.OnNudgeFromDatatype(types.First().Get());
diff --git a/components/sync/engine_impl/sync_manager_impl.h b/components/sync/engine_impl/sync_manager_impl.h index 2d53a445..bb9d2a1 100644 --- a/components/sync/engine_impl/sync_manager_impl.h +++ b/components/sync/engine_impl/sync_manager_impl.h
@@ -220,7 +220,7 @@ // Open the directory named with |username|. bool OpenDirectory(const std::string& username); - void RequestNudgeForDataTypes(const tracked_objects::Location& nudge_location, + void RequestNudgeForDataTypes(const base::Location& nudge_location, ModelTypeSet type); // If this is a deletion for a password, sets the legacy
diff --git a/components/sync/engine_impl/sync_scheduler_impl.cc b/components/sync/engine_impl/sync_scheduler_impl.cc index 64b4d83..c8f1297 100644 --- a/components/sync/engine_impl/sync_scheduler_impl.cc +++ b/components/sync/engine_impl/sync_scheduler_impl.cc
@@ -330,7 +330,7 @@ void SyncSchedulerImpl::ScheduleLocalNudge( ModelTypeSet types, - const tracked_objects::Location& nudge_location) { + const base::Location& nudge_location) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!types.Empty()); @@ -343,7 +343,7 @@ void SyncSchedulerImpl::ScheduleLocalRefreshRequest( ModelTypeSet types, - const tracked_objects::Location& nudge_location) { + const base::Location& nudge_location) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(!types.Empty()); @@ -357,7 +357,7 @@ void SyncSchedulerImpl::ScheduleInvalidationNudge( ModelType model_type, std::unique_ptr<InvalidationInterface> invalidation, - const tracked_objects::Location& nudge_location) { + const base::Location& nudge_location) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); SDVLOG_LOC(nudge_location, 2) @@ -381,7 +381,7 @@ // refresh requests. void SyncSchedulerImpl::ScheduleNudgeImpl( const TimeDelta& delay, - const tracked_objects::Location& nudge_location) { + const base::Location& nudge_location) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); CHECK(!syncer_->IsSyncing());
diff --git a/components/sync/engine_impl/sync_scheduler_impl.h b/components/sync/engine_impl/sync_scheduler_impl.h index 40d018e..58aa3e65 100644 --- a/components/sync/engine_impl/sync_scheduler_impl.h +++ b/components/sync/engine_impl/sync_scheduler_impl.h
@@ -49,16 +49,15 @@ void ScheduleConfiguration(const ConfigurationParams& params) override; void ScheduleClearServerData(const ClearParams& params) override; void Stop() override; - void ScheduleLocalNudge( - ModelTypeSet types, - const tracked_objects::Location& nudge_location) override; + void ScheduleLocalNudge(ModelTypeSet types, + const base::Location& nudge_location) override; void ScheduleLocalRefreshRequest( ModelTypeSet types, - const tracked_objects::Location& nudge_location) override; + const base::Location& nudge_location) override; void ScheduleInvalidationNudge( ModelType type, std::unique_ptr<InvalidationInterface> invalidation, - const tracked_objects::Location& nudge_location) override; + const base::Location& nudge_location) override; void ScheduleInitialSyncNudge(ModelType model_type) override; void SetNotificationsEnabled(bool notifications_enabled) override; @@ -168,7 +167,7 @@ // then post a delayed task to run it. It may also choose to drop the job or // save it for later, depending on the scheduler's current state. void ScheduleNudgeImpl(const base::TimeDelta& delay, - const tracked_objects::Location& nudge_location); + const base::Location& nudge_location); // Helper to signal listeners about changed retry time. void NotifyRetryTime(base::Time retry_time);
diff --git a/components/sync/model/change_processor_mock.h b/components/sync/model/change_processor_mock.h index a10ada3..f1a7dcb 100644 --- a/components/sync/model/change_processor_mock.h +++ b/components/sync/model/change_processor_mock.h
@@ -30,7 +30,7 @@ MOCK_METHOD0(StartImpl, void()); MOCK_CONST_METHOD0(IsRunning, bool()); MOCK_METHOD2(OnUnrecoverableError, - void(const tracked_objects::Location&, const std::string&)); + void(const base::Location&, const std::string&)); }; } // namespace syncer
diff --git a/components/sync/model/data_type_error_handler.h b/components/sync/model/data_type_error_handler.h index 954bdfc..874d017 100644 --- a/components/sync/model/data_type_error_handler.h +++ b/components/sync/model/data_type_error_handler.h
@@ -28,10 +28,9 @@ // This will create a SyncError object. This will also upload a breakpad call // stack to crash server. A sync error usually means that sync has to be // disabled either for that type or completely. - virtual SyncError CreateAndUploadError( - const tracked_objects::Location& location, - const std::string& message, - ModelType type) = 0; + virtual SyncError CreateAndUploadError(const base::Location& location, + const std::string& message, + ModelType type) = 0; // Create a copy of this error handler. virtual std::unique_ptr<DataTypeErrorHandler> Copy() const = 0;
diff --git a/components/sync/model/data_type_error_handler_impl.cc b/components/sync/model/data_type_error_handler_impl.cc index 540f17c..287dee5 100644 --- a/components/sync/model/data_type_error_handler_impl.cc +++ b/components/sync/model/data_type_error_handler_impl.cc
@@ -30,7 +30,7 @@ } SyncError DataTypeErrorHandlerImpl::CreateAndUploadError( - const tracked_objects::Location& location, + const base::Location& location, const std::string& message, ModelType type) { if (!dump_stack_.is_null())
diff --git a/components/sync/model/data_type_error_handler_impl.h b/components/sync/model/data_type_error_handler_impl.h index 5a97658..ac93c12 100644 --- a/components/sync/model/data_type_error_handler_impl.h +++ b/components/sync/model/data_type_error_handler_impl.h
@@ -27,7 +27,7 @@ ~DataTypeErrorHandlerImpl() override; void OnUnrecoverableError(const SyncError& error) override; - SyncError CreateAndUploadError(const tracked_objects::Location& location, + SyncError CreateAndUploadError(const base::Location& location, const std::string& message, ModelType type) override; std::unique_ptr<DataTypeErrorHandler> Copy() const override;
diff --git a/components/sync/model/data_type_error_handler_mock.cc b/components/sync/model/data_type_error_handler_mock.cc index c3e61c1..cd555fae 100644 --- a/components/sync/model/data_type_error_handler_mock.cc +++ b/components/sync/model/data_type_error_handler_mock.cc
@@ -20,7 +20,7 @@ } SyncError DataTypeErrorHandlerMock::CreateAndUploadError( - const tracked_objects::Location& location, + const base::Location& location, const std::string& message, ModelType type) { return SyncError(location, SyncError::DATATYPE_ERROR, message, type);
diff --git a/components/sync/model/data_type_error_handler_mock.h b/components/sync/model/data_type_error_handler_mock.h index 7488809c..6dfc834 100644 --- a/components/sync/model/data_type_error_handler_mock.h +++ b/components/sync/model/data_type_error_handler_mock.h
@@ -22,7 +22,7 @@ ~DataTypeErrorHandlerMock() override; void OnUnrecoverableError(const SyncError& error) override; - SyncError CreateAndUploadError(const tracked_objects::Location& location, + SyncError CreateAndUploadError(const base::Location& location, const std::string& message, ModelType type) override; std::unique_ptr<DataTypeErrorHandler> Copy() const override;
diff --git a/components/sync/model/fake_model_type_change_processor.cc b/components/sync/model/fake_model_type_change_processor.cc index 371cfeb..f47d0fd 100644 --- a/components/sync/model/fake_model_type_change_processor.cc +++ b/components/sync/model/fake_model_type_change_processor.cc
@@ -65,9 +65,8 @@ expect_error_ = false; } -void FakeModelTypeChangeProcessor::ReportError( - const tracked_objects::Location& location, - const std::string& message) { +void FakeModelTypeChangeProcessor::ReportError(const base::Location& location, + const std::string& message) { ReportError(ModelError(location, message)); }
diff --git a/components/sync/model/fake_model_type_change_processor.h b/components/sync/model/fake_model_type_change_processor.h index 84f78464..9e5aac7 100644 --- a/components/sync/model/fake_model_type_change_processor.h +++ b/components/sync/model/fake_model_type_change_processor.h
@@ -43,7 +43,7 @@ void DisableSync() override; bool IsTrackingMetadata() override; void ReportError(const ModelError& error) override; - void ReportError(const tracked_objects::Location& location, + void ReportError(const base::Location& location, const std::string& message) override; // Indicates that ReportError should be called in the future.
diff --git a/components/sync/model/fake_sync_change_processor.cc b/components/sync/model/fake_sync_change_processor.cc index a625606..83d510a7 100644 --- a/components/sync/model/fake_sync_change_processor.cc +++ b/components/sync/model/fake_sync_change_processor.cc
@@ -14,7 +14,7 @@ FakeSyncChangeProcessor::~FakeSyncChangeProcessor() {} SyncError FakeSyncChangeProcessor::ProcessSyncChanges( - const tracked_objects::Location& from_here, + const base::Location& from_here, const SyncChangeList& change_list) { changes_.insert(changes_.end(), change_list.begin(), change_list.end()); return SyncError();
diff --git a/components/sync/model/fake_sync_change_processor.h b/components/sync/model/fake_sync_change_processor.h index c533a5f..7672c4a 100644 --- a/components/sync/model/fake_sync_change_processor.h +++ b/components/sync/model/fake_sync_change_processor.h
@@ -21,7 +21,7 @@ // // ProcessSyncChanges will accumulate changes in changes() until they are // cleared. - SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, + SyncError ProcessSyncChanges(const base::Location& from_here, const SyncChangeList& change_list) override; // SyncChangeProcessor implementation.
diff --git a/content/browser/android/content_view_core.cc b/content/browser/android/content_view_core.cc index 8cc17ae..1a27ea57 100644 --- a/content/browser/android/content_view_core.cc +++ b/content/browser/android/content_view_core.cc
@@ -817,21 +817,6 @@ SendGestureEvent(event); } -void ContentViewCore::ResolveTapDisambiguation(JNIEnv* env, - const JavaParamRef<jobject>& obj, - jlong time_ms, - jfloat x, - jfloat y, - jboolean is_long_press) { - RenderWidgetHostViewAndroid* rwhv = GetRenderWidgetHostViewAndroid(); - if (!rwhv) - return; - - rwhv->ResolveTapDisambiguation(time_ms / 1000.0, - gfx::Point(x / dpi_scale_, y / dpi_scale_), - is_long_press); -} - void ContentViewCore::PinchBegin(JNIEnv* env, const JavaParamRef<jobject>& obj, jlong time_ms,
diff --git a/content/browser/android/content_view_core.h b/content/browser/android/content_view_core.h index 57fe21fe..28a28b7 100644 --- a/content/browser/android/content_view_core.h +++ b/content/browser/android/content_view_core.h
@@ -132,13 +132,6 @@ jfloat x, jfloat y); - void ResolveTapDisambiguation(JNIEnv* env, - const base::android::JavaParamRef<jobject>& obj, - jlong time_ms, - jfloat x, - jfloat y, - jboolean is_long_press); - void PinchBegin(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj, jlong time_ms,
diff --git a/content/browser/devtools/devtools_url_interceptor_request_job.cc b/content/browser/devtools/devtools_url_interceptor_request_job.cc index 85801e66..aa182110 100644 --- a/content/browser/devtools/devtools_url_interceptor_request_job.cc +++ b/content/browser/devtools/devtools_url_interceptor_request_job.cc
@@ -790,6 +790,7 @@ resource_request_info->is_load_timing_enabled(), resource_request_info->is_upload_progress_enabled(), resource_request_info->do_not_prompt_for_login(), + resource_request_info->keepalive(), resource_request_info->GetReferrerPolicy(), resource_request_info->GetVisibilityState(), resource_request_info->GetContext(),
diff --git a/content/browser/loader/async_resource_handler_unittest.cc b/content/browser/loader/async_resource_handler_unittest.cc index 53184f2..ad6ed23 100644 --- a/content/browser/loader/async_resource_handler_unittest.cc +++ b/content/browser/loader/async_resource_handler_unittest.cc
@@ -186,6 +186,7 @@ false, // enable load timing false, // enable upload progress false, // do_not_prompt_for_login + false, // keep_alive blink::kWebReferrerPolicyDefault, // referrer_policy blink::kWebPageVisibilityStateVisible, // visibility_state resource_context_.get(), // context
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc index df2bd686..646b0a57 100644 --- a/content/browser/loader/resource_dispatcher_host_impl.cc +++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -197,17 +197,6 @@ // same resource (see bugs 46104 and 31014). const int kDefaultDetachableCancelDelayMs = 30000; -bool IsDetachableResourceType(ResourceType type) { - switch (type) { - case RESOURCE_TYPE_PREFETCH: - case RESOURCE_TYPE_PING: - case RESOURCE_TYPE_CSP_REPORT: - return true; - default: - return false; - } -} - // Aborts a request before an URLRequest has actually been created. void AbortRequestBeforeItStarts( IPC::Sender* sender, @@ -1364,10 +1353,10 @@ false, // is stream allow_download, request_data.has_user_gesture, request_data.enable_load_timing, request_data.enable_upload_progress, - do_not_prompt_for_login, request_data.referrer_policy, - request_data.visibility_state, resource_context, report_raw_headers, - !is_sync_load, previews_state, request_data.request_body, - request_data.initiated_in_secure_context); + do_not_prompt_for_login, request_data.keepalive, + request_data.referrer_policy, request_data.visibility_state, + resource_context, report_raw_headers, !is_sync_load, previews_state, + request_data.request_body, request_data.initiated_in_secure_context); extra_info->SetBlobHandles(std::move(blob_handles)); // Request takes ownership. @@ -1470,8 +1459,8 @@ // Prefetches and <a ping> requests outlive their child process. if (!sync_result_handler && - (start_detached || - IsDetachableResourceType(request_data.resource_type))) { + (start_detached || request_data.resource_type == RESOURCE_TYPE_PREFETCH || + request_data.keepalive)) { auto timeout = base::TimeDelta::FromMilliseconds(kDefaultDetachableCancelDelayMs); int timeout_set_by_finch_in_sec = base::GetFieldTrialParamByFeatureAsInt( @@ -1713,6 +1702,7 @@ false, // enable_load_timing false, // enable_upload_progress false, // do_not_prompt_for_login + false, // keepalive blink::kWebReferrerPolicyDefault, blink::kWebPageVisibilityStateVisible, context, false, // report_raw_headers @@ -1793,7 +1783,8 @@ if (cancel_all_routes || route_id == info->GetRenderFrameID()) { if (info->detachable_handler()) { if (base::FeatureList::IsEnabled( - features::kKeepAliveRendererForKeepaliveRequests)) { + features::kKeepAliveRendererForKeepaliveRequests) && + info->keepalive()) { // If the feature is enabled, the renderer process's lifetime is // prolonged so there's no need to detach. if (cancel_all_routes) { @@ -2132,6 +2123,7 @@ true, // enable_load_timing false, // enable_upload_progress false, // do_not_prompt_for_login + false, // keepalive info.common_params.referrer.policy, info.page_visibility_state, resource_context, info.report_raw_headers, true, // is_async
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index 1f952a5f..223bc06 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -177,6 +177,7 @@ request.parent_is_main_frame = false; request.transition_type = ui::PAGE_TRANSITION_LINK; request.allow_download = true; + request.keepalive = (type == RESOURCE_TYPE_PING); return request; }
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc index 2de58a1..0780f18 100644 --- a/content/browser/loader/resource_request_info_impl.cc +++ b/content/browser/loader/resource_request_info_impl.cc
@@ -81,6 +81,7 @@ false, // enable load timing request->has_upload(), // enable upload progress false, // do_not_prompt_for_login + false, // keep_alive blink::kWebReferrerPolicyDefault, // referrer_policy blink::kWebPageVisibilityStateVisible, // visibility_state context, // context @@ -148,6 +149,7 @@ bool enable_load_timing, bool enable_upload_progress, bool do_not_prompt_for_login, + bool keepalive, blink::WebReferrerPolicy referrer_policy, blink::WebPageVisibilityState visibility_state, ResourceContext* context, @@ -173,6 +175,7 @@ enable_load_timing_(enable_load_timing), enable_upload_progress_(enable_upload_progress), do_not_prompt_for_login_(do_not_prompt_for_login), + keepalive_(keepalive), counted_as_in_flight_request_(false), resource_type_(resource_type), transition_type_(transition_type),
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h index 56d24b39..36819cb 100644 --- a/content/browser/loader/resource_request_info_impl.h +++ b/content/browser/loader/resource_request_info_impl.h
@@ -66,6 +66,7 @@ bool enable_load_timing, bool enable_upload_progress, bool do_not_prompt_for_login, + bool keepalive, blink::WebReferrerPolicy referrer_policy, blink::WebPageVisibilityState visibility_state, ResourceContext* context, @@ -143,6 +144,7 @@ void set_detachable_handler(DetachableResourceHandler* h) { detachable_handler_ = h; } + bool keepalive() const { return keepalive_; } // Downloads are allowed only as a top level request. bool allow_download() const { return allow_download_; } @@ -223,6 +225,7 @@ bool enable_load_timing_; bool enable_upload_progress_; bool do_not_prompt_for_login_; + bool keepalive_; bool counted_as_in_flight_request_; ResourceType resource_type_; ui::PageTransition transition_type_;
diff --git a/content/browser/service_worker/service_worker_url_loader_job.cc b/content/browser/service_worker/service_worker_url_loader_job.cc index f2e21dba..aed1f58 100644 --- a/content/browser/service_worker/service_worker_url_loader_job.cc +++ b/content/browser/service_worker/service_worker_url_loader_job.cc
@@ -18,6 +18,45 @@ namespace content { +// This class waits for completion of a stream response from the service worker. +// It calls ServiceWorkerURLLoader::CommitComplete() upon completion of the +// response. +class ServiceWorkerURLLoaderJob::StreamWaiter + : public blink::mojom::ServiceWorkerStreamCallback { + public: + StreamWaiter( + ServiceWorkerURLLoaderJob* owner, + scoped_refptr<ServiceWorkerVersion> streaming_version, + blink::mojom::ServiceWorkerStreamCallbackRequest callback_request) + : owner_(owner), + streaming_version_(streaming_version), + binding_(this, std::move(callback_request)) { + streaming_version_->AddStreamingURLLoaderJob(owner_); + binding_.set_connection_error_handler( + base::BindOnce(&StreamWaiter::OnAborted, base::Unretained(this))); + } + ~StreamWaiter() override { + streaming_version_->RemoveStreamingURLLoaderJob(owner_); + } + + // Implements mojom::ServiceWorkerStreamCallback. + void OnCompleted() override { + // Destroys |this|. + owner_->CommitCompleted(net::OK); + } + void OnAborted() override { + // Destroys |this|. + owner_->CommitCompleted(net::ERR_ABORTED); + } + + private: + ServiceWorkerURLLoaderJob* owner_; + scoped_refptr<ServiceWorkerVersion> streaming_version_; + mojo::Binding<blink::mojom::ServiceWorkerStreamCallback> binding_; + + DISALLOW_COPY_AND_ASSIGN(StreamWaiter); +}; + ServiceWorkerURLLoaderJob::ServiceWorkerURLLoaderJob( LoaderCallback callback, Delegate* delegate, @@ -74,11 +113,15 @@ } void ServiceWorkerURLLoaderJob::Cancel() { - url_loader_client_.reset(); status_ = Status::kCancelled; weak_factory_.InvalidateWeakPtrs(); blob_storage_context_.reset(); fetch_dispatcher_.reset(); + stream_waiter_.reset(); + + url_loader_client_->OnComplete( + ResourceRequestCompletionStatus(net::ERR_ABORTED)); + url_loader_client_.reset(); } bool ServiceWorkerURLLoaderJob::WasCanceled() const { @@ -125,10 +168,11 @@ void ServiceWorkerURLLoaderJob::CommitCompleted(int error_code) { DCHECK_LT(status_, Status::kCompleted); status_ = Status::kCompleted; - ResourceRequestCompletionStatus completion_status; - completion_status.error_code = error_code; - completion_status.completion_time = base::TimeTicks::Now(); - url_loader_client_->OnComplete(completion_status); + + // |stream_waiter_| calls this when done. + stream_waiter_.reset(); + + url_loader_client_->OnComplete(ResourceRequestCompletionStatus(error_code)); } void ServiceWorkerURLLoaderJob::DeliverErrorResponse() { @@ -196,12 +240,13 @@ std::move(loader_callback_) .Run(base::BindOnce(&ServiceWorkerURLLoaderJob::StartResponse, - weak_factory_.GetWeakPtr(), response, + weak_factory_.GetWeakPtr(), response, version, std::move(body_as_stream), std::move(body_as_blob))); } void ServiceWorkerURLLoaderJob::StartResponse( const ServiceWorkerResponse& response, + scoped_refptr<ServiceWorkerVersion> version, blink::mojom::ServiceWorkerStreamHandlePtr body_as_stream, storage::mojom::BlobPtr body_as_blob, mojom::URLLoaderRequest request, @@ -222,12 +267,12 @@ // Handle a stream response body. if (!body_as_stream.is_null() && body_as_stream->stream.is_valid()) { + stream_waiter_ = std::make_unique<StreamWaiter>( + this, std::move(version), std::move(body_as_stream->callback_request)); CommitResponseHeaders(); url_loader_client_->OnStartLoadingResponseBody( std::move(body_as_stream->stream)); - // TODO(falken): Call CommitCompleted() when stream finished. - // See https://crbug.com/758455 - CommitCompleted(net::OK); + // StreamWaiter will call CommitCompleted() when done. return; }
diff --git a/content/browser/service_worker/service_worker_url_loader_job.h b/content/browser/service_worker/service_worker_url_loader_job.h index 1aa34897..50c2efa 100644 --- a/content/browser/service_worker/service_worker_url_loader_job.h +++ b/content/browser/service_worker/service_worker_url_loader_job.h
@@ -91,6 +91,8 @@ bool WasCanceled() const; private: + class StreamWaiter; + // For FORWARD_TO_SERVICE_WORKER case. void StartRequest(); void DidPrepareFetchEvent(scoped_refptr<ServiceWorkerVersion> version); @@ -105,6 +107,7 @@ // |body_as_blob| is kept around until BlobDataHandle is created from // blob_uuid just to make sure the blob is kept alive. void StartResponse(const ServiceWorkerResponse& response, + scoped_refptr<ServiceWorkerVersion> version, blink::mojom::ServiceWorkerStreamHandlePtr body_as_stream, storage::mojom::BlobPtr body_as_blob, mojom::URLLoaderRequest request, @@ -150,6 +153,7 @@ scoped_refptr<URLLoaderFactoryGetter> url_loader_factory_getter_; base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; std::unique_ptr<ServiceWorkerFetchDispatcher> fetch_dispatcher_; + std::unique_ptr<StreamWaiter> stream_waiter_; bool did_navigation_preload_ = false; ResourceResponseHead response_head_;
diff --git a/content/browser/service_worker/service_worker_url_loader_job_unittest.cc b/content/browser/service_worker/service_worker_url_loader_job_unittest.cc index 8c4ba55..5a2f093 100644 --- a/content/browser/service_worker/service_worker_url_loader_job_unittest.cc +++ b/content/browser/service_worker/service_worker_url_loader_job_unittest.cc
@@ -445,9 +445,10 @@ kDidNotHandleRequest, }; - // Performs a request. When this returns, |client_| will have information - // about the response. - JobResult TestRequest() { + // Returns whether ServiceWorkerURLLoaderJob handled the request. If + // kHandledRequest was returned, the request is ongoing and the caller can use + // functions like client_.RunUntilComplete() to wait for completion. + JobResult StartRequest() { ResourceRequest request; request.url = GURL("https://www.example.com/"); request.method = "GET"; @@ -466,10 +467,8 @@ return JobResult::kDidNotHandleRequest; // Start the loader. It will load |request.url|. - mojom::URLLoaderPtr loader; - std::move(callback).Run(mojo::MakeRequest(&loader), + std::move(callback).Run(mojo::MakeRequest(&loader_), client_.CreateInterfacePtr()); - client_.RunUntilComplete(); return JobResult::kHandledRequest; } @@ -521,11 +520,15 @@ TestURLLoaderClient client_; bool was_main_resource_load_failed_called_ = false; std::unique_ptr<ServiceWorkerURLLoaderJob> job_; + mojom::URLLoaderPtr loader_; }; TEST_F(ServiceWorkerURLLoaderJobTest, Basic) { - JobResult result = TestRequest(); + // Perform the request + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilComplete(); + EXPECT_EQ(net::OK, client_.completion_status().error_code); const ResourceResponseHead& info = client_.response_head(); EXPECT_EQ(200, info.headers->response_code()); @@ -542,8 +545,10 @@ helper_->RespondWithBlob(blob_handle->uuid(), blob_handle->size()); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilComplete(); + const ResourceResponseHead& info = client_.response_head(); EXPECT_EQ(200, info.headers->response_code()); ExpectResponseInfo(info, *CreateResponseInfoFromServiceWorker()); @@ -561,8 +566,10 @@ helper_->RespondWithBlob("blob-id:nothing-is-here", 0); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilComplete(); + const ResourceResponseHead& info = client_.response_head(); // TODO(falken): Currently our code returns 404 not found (with net::OK), but // the spec seems to say this should act as if a network error has occurred. @@ -580,15 +587,15 @@ std::move(data_pipe.consumer_handle)); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilResponseReceived(); + const ResourceResponseHead& info = client_.response_head(); EXPECT_EQ(200, info.headers->response_code()); ExpectResponseInfo(info, *CreateResponseInfoFromServiceWorker()); - // TODO(falken): This should be true since the worker is still streaming the - // response body. See https://crbug.com/758455 - EXPECT_FALSE(version_->HasWork()); + EXPECT_TRUE(version_->HasWork()); // Write the body stream. uint32_t written_bytes = sizeof(kResponseBody) - 1; @@ -598,6 +605,8 @@ EXPECT_EQ(sizeof(kResponseBody) - 1, written_bytes); stream_callback->OnCompleted(); data_pipe.producer_handle.reset(); + + client_.RunUntilComplete(); EXPECT_EQ(net::OK, client_.completion_status().error_code); // Test the body. @@ -618,8 +627,10 @@ std::move(data_pipe.consumer_handle)); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilResponseReceived(); + const ResourceResponseHead& info = client_.response_head(); EXPECT_EQ(200, info.headers->response_code()); ExpectResponseInfo(info, *CreateResponseInfoFromServiceWorker()); @@ -632,8 +643,9 @@ EXPECT_EQ(sizeof(kResponseBody) - 1, written_bytes); stream_callback->OnAborted(); data_pipe.producer_handle.reset(); - // TODO(falken): This should be an error, see https://crbug.com/758455 - EXPECT_EQ(net::OK, client_.completion_status().error_code); + + client_.RunUntilComplete(); + EXPECT_EQ(net::ERR_ABORTED, client_.completion_status().error_code); // Test the body. std::string response; @@ -653,8 +665,10 @@ std::move(data_pipe.consumer_handle)); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilResponseReceived(); + const ResourceResponseHead& info = client_.response_head(); EXPECT_EQ(200, info.headers->response_code()); ExpectResponseInfo(info, *CreateResponseInfoFromServiceWorker()); @@ -667,9 +681,7 @@ EXPECT_EQ(sizeof(kResponseBody) - 1, written_bytes); EXPECT_TRUE(data_pipe.producer_handle.is_valid()); EXPECT_FALSE(job_->WasCanceled()); - // TODO(falken): This should be true since the worker is still streaming the - // response body. See https://crbug.com/758455 - EXPECT_FALSE(version_->HasWork()); + EXPECT_TRUE(version_->HasWork()); job_->Cancel(); EXPECT_TRUE(job_->WasCanceled()); EXPECT_FALSE(version_->HasWork()); @@ -682,12 +694,9 @@ // TODO(falken): This should probably be an error. EXPECT_EQ(MOJO_RESULT_OK, mojo_result); - stream_callback->OnAborted(); - - base::RunLoop().RunUntilIdle(); + client_.RunUntilComplete(); EXPECT_FALSE(data_pipe.consumer_handle.is_valid()); - // TODO(falken): This should be an error, see https://crbug.com/758455 - EXPECT_EQ(net::OK, client_.completion_status().error_code); + EXPECT_EQ(net::ERR_ABORTED, client_.completion_status().error_code); } // Test when the service worker responds with network fallback. @@ -696,7 +705,7 @@ helper_->RespondWithFallback(); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kDidNotHandleRequest, result); // The request should not be handled by the job, but it shouldn't be a @@ -709,7 +718,7 @@ helper_->FailToDispatchFetchEvent(); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kDidNotHandleRequest, result); EXPECT_TRUE(was_main_resource_load_failed_called_); } @@ -720,8 +729,10 @@ helper_->RespondEarly(); // Perform the request. - JobResult result = TestRequest(); + JobResult result = StartRequest(); EXPECT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilComplete(); + const ResourceResponseHead& info = client_.response_head(); EXPECT_EQ(200, info.headers->response_code()); ExpectResponseInfo(info, *CreateResponseInfoFromServiceWorker()); @@ -758,8 +769,12 @@ TEST_F(ServiceWorkerURLLoaderJobTest, NavigationPreload) { registration_->EnableNavigationPreload(true); helper_->RespondWithNavigationPreloadResponse(); - JobResult result = TestRequest(); + + // Perform the request + JobResult result = StartRequest(); ASSERT_EQ(JobResult::kHandledRequest, result); + client_.RunUntilComplete(); + EXPECT_EQ(net::OK, client_.completion_status().error_code); const ResourceResponseHead& info = client_.response_head(); EXPECT_EQ(200, info.headers->response_code());
diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc index e7d81f8..5c7a74d4 100644 --- a/content/browser/service_worker/service_worker_version.cc +++ b/content/browser/service_worker/service_worker_version.cc
@@ -708,6 +708,13 @@ streaming_url_request_jobs_.insert(request_job); } +void ServiceWorkerVersion::AddStreamingURLLoaderJob( + const ServiceWorkerURLLoaderJob* loader_job) { + DCHECK(streaming_url_loader_jobs_.find(loader_job) == + streaming_url_loader_jobs_.end()); + streaming_url_loader_jobs_.insert(loader_job); +} + void ServiceWorkerVersion::RemoveStreamingURLRequestJob( const ServiceWorkerURLRequestJob* request_job) { streaming_url_request_jobs_.erase(request_job); @@ -717,6 +724,15 @@ } } +void ServiceWorkerVersion::RemoveStreamingURLLoaderJob( + const ServiceWorkerURLLoaderJob* loader_job) { + streaming_url_loader_jobs_.erase(loader_job); + if (!HasWork()) { + for (auto& observer : listeners_) + observer.OnNoWork(this); + } +} + void ServiceWorkerVersion::AddListener(Listener* listener) { listeners_.AddObserver(listener); } @@ -1719,8 +1735,8 @@ } bool ServiceWorkerVersion::HasWork() const { - return !pending_requests_.IsEmpty() || !streaming_url_request_jobs_.empty() || - !start_callbacks_.empty(); + return !pending_requests_.IsEmpty() || !streaming_url_loader_jobs_.empty() || + !streaming_url_request_jobs_.empty() || !start_callbacks_.empty(); } void ServiceWorkerVersion::RecordStartWorkerResult( @@ -1920,6 +1936,7 @@ // TODO(falken): Call SWURLRequestJob::ClearStream here? streaming_url_request_jobs_.clear(); + streaming_url_loader_jobs_.clear(); for (auto& observer : listeners_) observer.OnRunningStateChanged(this);
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h index b037d6f..3e1f09f 100644 --- a/content/browser/service_worker/service_worker_version.h +++ b/content/browser/service_worker/service_worker_version.h
@@ -58,6 +58,7 @@ class ServiceWorkerProviderHost; class ServiceWorkerRegistration; class ServiceWorkerURLRequestJob; +class ServiceWorkerURLLoaderJob; struct ServiceWorkerClientInfo; struct ServiceWorkerVersionInfo; @@ -309,12 +310,14 @@ base::WeakPtr<ServiceWorkerContextCore> context() const { return context_; } - // Adds and removes |request_job| as a dependent job not to stop the - // ServiceWorker while |request_job| is reading the stream of the fetch event - // response from the ServiceWorker. + // Adds and removes |request_job| or |loader_job| as a dependent job not to + // stop the ServiceWorker while |request_job| or |loader_job| is reading the + // stream of the fetch event response from the ServiceWorker. void AddStreamingURLRequestJob(const ServiceWorkerURLRequestJob* request_job); void RemoveStreamingURLRequestJob( const ServiceWorkerURLRequestJob* request_job); + void AddStreamingURLLoaderJob(const ServiceWorkerURLLoaderJob* loader_job); + void RemoveStreamingURLLoaderJob(const ServiceWorkerURLLoaderJob* loader_job); // Adds and removes Listeners. void AddListener(Listener* listener); @@ -718,6 +721,7 @@ installed_scripts_sender_; std::set<const ServiceWorkerURLRequestJob*> streaming_url_request_jobs_; + std::set<const ServiceWorkerURLLoaderJob*> streaming_url_loader_jobs_; // Keeps track of the provider hosting this running service worker for this // version. |provider_host_| is always valid as long as this version is
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc index 49e792b..b973b04 100644 --- a/content/child/web_url_loader_impl.cc +++ b/content/child/web_url_loader_impl.cc
@@ -640,6 +640,7 @@ resource_request->request_body = GetRequestBodyForWebURLRequest(request).get(); resource_request->download_to_file = request.DownloadToFile(); + resource_request->keepalive = request.GetKeepalive(); resource_request->has_user_gesture = request.HasUserGesture(); resource_request->enable_load_timing = true; resource_request->enable_upload_progress = request.ReportUploadProgress();
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h index 5c282d62..48f90d9 100644 --- a/content/common/resource_messages.h +++ b/content/common/resource_messages.h
@@ -268,6 +268,7 @@ IPC_STRUCT_TRAITS_MEMBER(fetch_frame_type) IPC_STRUCT_TRAITS_MEMBER(request_body) IPC_STRUCT_TRAITS_MEMBER(download_to_file) + IPC_STRUCT_TRAITS_MEMBER(keepalive) IPC_STRUCT_TRAITS_MEMBER(has_user_gesture) IPC_STRUCT_TRAITS_MEMBER(enable_load_timing) IPC_STRUCT_TRAITS_MEMBER(enable_upload_progress)
diff --git a/content/public/common/resource_request.h b/content/public/common/resource_request.h index f5fb4e3..1627c70 100644 --- a/content/public/common/resource_request.h +++ b/content/public/common/resource_request.h
@@ -131,6 +131,10 @@ // to that file will be provided in ResponseInfo::download_file_path. bool download_to_file = false; + // True if the request can work after the fetch group is terminated. + // https://fetch.spec.whatwg.org/#request-keepalive-flag + bool keepalive = false; + // True if the request was user initiated. bool has_user_gesture = false;
diff --git a/dbus/message.cc b/dbus/message.cc index b33345e..9505dbb4 100644 --- a/dbus/message.cc +++ b/dbus/message.cc
@@ -47,9 +47,7 @@ return major >= 1 && minor >= 4; } -Message::Message() - : raw_message_(NULL) { -} +Message::Message() : raw_message_(nullptr) {} Message::~Message() { if (raw_message_) @@ -344,21 +342,20 @@ // MethodCall::MethodCall(const std::string& interface_name, - const std::string& method_name) - : Message() { + const std::string& method_name) { Init(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_CALL)); CHECK(SetInterface(interface_name)); CHECK(SetMember(method_name)); } -MethodCall::MethodCall() : Message() { -} +MethodCall::MethodCall() = default; -MethodCall* MethodCall::FromRawMessage(DBusMessage* raw_message) { +std::unique_ptr<MethodCall> MethodCall::FromRawMessage( + DBusMessage* raw_message) { DCHECK_EQ(DBUS_MESSAGE_TYPE_METHOD_CALL, dbus_message_get_type(raw_message)); - MethodCall* method_call = new MethodCall; + std::unique_ptr<MethodCall> method_call(new MethodCall()); method_call->Init(raw_message); return method_call; } @@ -367,21 +364,19 @@ // Signal implementation. // Signal::Signal(const std::string& interface_name, - const std::string& method_name) - : Message() { + const std::string& method_name) { Init(dbus_message_new(DBUS_MESSAGE_TYPE_SIGNAL)); CHECK(SetInterface(interface_name)); CHECK(SetMember(method_name)); } -Signal::Signal() : Message() { -} +Signal::Signal() = default; -Signal* Signal::FromRawMessage(DBusMessage* raw_message) { +std::unique_ptr<Signal> Signal::FromRawMessage(DBusMessage* raw_message) { DCHECK_EQ(DBUS_MESSAGE_TYPE_SIGNAL, dbus_message_get_type(raw_message)); - Signal* signal = new Signal; + std::unique_ptr<Signal> signal(new Signal()); signal->Init(raw_message); return signal; } @@ -390,26 +385,25 @@ // Response implementation. // -Response::Response() : Message() { -} +Response::Response() = default; std::unique_ptr<Response> Response::FromRawMessage(DBusMessage* raw_message) { DCHECK_EQ(DBUS_MESSAGE_TYPE_METHOD_RETURN, dbus_message_get_type(raw_message)); - std::unique_ptr<Response> response(new Response); + std::unique_ptr<Response> response(new Response()); response->Init(raw_message); return response; } std::unique_ptr<Response> Response::FromMethodCall(MethodCall* method_call) { - std::unique_ptr<Response> response(new Response); + std::unique_ptr<Response> response(new Response()); response->Init(dbus_message_new_method_return(method_call->raw_message())); return response; } std::unique_ptr<Response> Response::CreateEmpty() { - std::unique_ptr<Response> response(new Response); + std::unique_ptr<Response> response(new Response()); response->Init(dbus_message_new(DBUS_MESSAGE_TYPE_METHOD_RETURN)); return response; } @@ -418,14 +412,13 @@ // ErrorResponse implementation. // -ErrorResponse::ErrorResponse() : Response() { -} +ErrorResponse::ErrorResponse() = default; std::unique_ptr<ErrorResponse> ErrorResponse::FromRawMessage( DBusMessage* raw_message) { DCHECK_EQ(DBUS_MESSAGE_TYPE_ERROR, dbus_message_get_type(raw_message)); - std::unique_ptr<ErrorResponse> response(new ErrorResponse); + std::unique_ptr<ErrorResponse> response(new ErrorResponse()); response->Init(raw_message); return response; } @@ -434,7 +427,7 @@ MethodCall* method_call, const std::string& error_name, const std::string& error_message) { - std::unique_ptr<ErrorResponse> response(new ErrorResponse); + std::unique_ptr<ErrorResponse> response(new ErrorResponse()); response->Init(dbus_message_new_error(method_call->raw_message(), error_name.c_str(), error_message.c_str())); @@ -551,11 +544,10 @@ void MessageWriter::OpenStruct(MessageWriter* writer) { DCHECK(!container_is_open_); - const bool success = dbus_message_iter_open_container( - &raw_message_iter_, - DBUS_TYPE_STRUCT, - NULL, // Signature should be NULL. - &writer->raw_message_iter_); + const bool success = + dbus_message_iter_open_container(&raw_message_iter_, DBUS_TYPE_STRUCT, + nullptr, // Signature should be nullptr. + &writer->raw_message_iter_); CHECK(success) << "Unable to allocate memory"; container_is_open_ = true; } @@ -563,11 +555,10 @@ void MessageWriter::OpenDictEntry(MessageWriter* writer) { DCHECK(!container_is_open_); - const bool success = dbus_message_iter_open_container( - &raw_message_iter_, - DBUS_TYPE_DICT_ENTRY, - NULL, // Signature should be NULL. - &writer->raw_message_iter_); + const bool success = + dbus_message_iter_open_container(&raw_message_iter_, DBUS_TYPE_DICT_ENTRY, + nullptr, // Signature should be nullptr. + &writer->raw_message_iter_); CHECK(success) << "Unable to allocate memory"; container_is_open_ = true; } @@ -777,7 +768,7 @@ } bool MessageReader::PopString(std::string* value) { - char* tmp_value = NULL; + char* tmp_value = nullptr; const bool success = PopBasic(DBUS_TYPE_STRING, &tmp_value); if (success) value->assign(tmp_value); @@ -785,7 +776,7 @@ } bool MessageReader::PopObjectPath(ObjectPath* value) { - char* tmp_value = NULL; + char* tmp_value = nullptr; const bool success = PopBasic(DBUS_TYPE_OBJECT_PATH, &tmp_value); if (success) *value = ObjectPath(tmp_value); @@ -815,7 +806,7 @@ // An empty array is allowed. if (!array_reader.HasMoreData()) { *length = 0; - *bytes = NULL; + *bytes = nullptr; return true; } if (!array_reader.CheckDataType(DBUS_TYPE_BYTE)) @@ -879,8 +870,8 @@ bool MessageReader::PopArrayOfBytesAsProto( google::protobuf::MessageLite* protobuf) { - DCHECK(protobuf != NULL); - const char* serialized_buf = NULL; + DCHECK(protobuf); + const char* serialized_buf = nullptr; size_t buf_size = 0; if (!PopArrayOfBytes(reinterpret_cast<const uint8_t**>(&serialized_buf), &buf_size)) { @@ -935,7 +926,7 @@ } bool MessageReader::PopVariantOfString(std::string* value) { - char* tmp_value = NULL; + char* tmp_value = nullptr; const bool success = PopVariantOfBasic(DBUS_TYPE_STRING, &tmp_value); if (success) value->assign(tmp_value); @@ -943,7 +934,7 @@ } bool MessageReader::PopVariantOfObjectPath(ObjectPath* value) { - char* tmp_value = NULL; + char* tmp_value = nullptr; const bool success = PopVariantOfBasic(DBUS_TYPE_OBJECT_PATH, &tmp_value); if (success) *value = ObjectPath(tmp_value);
diff --git a/dbus/message.h b/dbus/message.h index f54cb7a..c9eca43 100644 --- a/dbus/message.h +++ b/dbus/message.h
@@ -158,9 +158,8 @@ const std::string& method_name); // Returns a newly created MethodCall from the given raw message of the - // type DBUS_MESSAGE_TYPE_METHOD_CALL. The caller must delete the - // returned object. Takes the ownership of |raw_message|. - static MethodCall* FromRawMessage(DBusMessage* raw_message); + // type DBUS_MESSAGE_TYPE_METHOD_CALL. Takes the ownership of |raw_message|. + static std::unique_ptr<MethodCall> FromRawMessage(DBusMessage* raw_message); private: // Creates a method call message. The internal raw message is NULL. @@ -187,9 +186,8 @@ const std::string& method_name); // Returns a newly created SIGNAL from the given raw message of the type - // DBUS_MESSAGE_TYPE_SIGNAL. The caller must delete the returned - // object. Takes the ownership of |raw_message|. - static Signal* FromRawMessage(DBusMessage* raw_message); + // DBUS_MESSAGE_TYPE_SIGNAL. Takes the ownership of |raw_message|. + static std::unique_ptr<Signal> FromRawMessage(DBusMessage* raw_message); private: // Creates a signal message. The internal raw message is NULL.
diff --git a/dbus/mock_object_proxy.cc b/dbus/mock_object_proxy.cc index 616fb02..1ba754fe 100644 --- a/dbus/mock_object_proxy.cc +++ b/dbus/mock_object_proxy.cc
@@ -30,4 +30,13 @@ &error_callback); } +void MockObjectProxy::ConnectToSignal( + const std::string& interface_name, + const std::string& signal_name, + SignalCallback signal_callback, + OnConnectedCallback on_connected_callback) { + DoConnectToSignal(interface_name, signal_name, signal_callback, + &on_connected_callback); +} + } // namespace dbus
diff --git a/dbus/mock_object_proxy.h b/dbus/mock_object_proxy.h index dabb330..c430fac 100644 --- a/dbus/mock_object_proxy.h +++ b/dbus/mock_object_proxy.h
@@ -53,15 +53,21 @@ int timeout_ms, ResponseCallback* callback, ErrorCallback* error_callback)); - MOCK_METHOD4(ConnectToSignal, + + // This method is not mockable because it takes a move-only argument. To work + // around this, ConnectToSignal() implementation here calls + // DoConnectToSignal() which is mockable. + void ConnectToSignal(const std::string& interface_name, + const std::string& signal_name, + SignalCallback signal_callback, + OnConnectedCallback on_connected_callback) override; + MOCK_METHOD4(DoConnectToSignal, void(const std::string& interface_name, const std::string& signal_name, SignalCallback signal_callback, - OnConnectedCallback on_connected_callback)); + OnConnectedCallback* on_connected_callback)); MOCK_METHOD1(SetNameOwnerChangedCallback, void(NameOwnerChangedCallback callback)); - MOCK_METHOD1(WaitForServiceToBeAvailable, - void(WaitForServiceToBeAvailableCallback callback)); MOCK_METHOD0(Detach, void()); protected:
diff --git a/dbus/object_proxy.cc b/dbus/object_proxy.cc index cb41cc9..f54d3a4 100644 --- a/dbus/object_proxy.cc +++ b/dbus/object_proxy.cc
@@ -27,23 +27,25 @@ namespace { -const char kErrorServiceUnknown[] = "org.freedesktop.DBus.Error.ServiceUnknown"; -const char kErrorObjectUnknown[] = "org.freedesktop.DBus.Error.UnknownObject"; +constexpr char kErrorServiceUnknown[] = + "org.freedesktop.DBus.Error.ServiceUnknown"; +constexpr char kErrorObjectUnknown[] = + "org.freedesktop.DBus.Error.UnknownObject"; // Used for success ratio histograms. 1 for success, 0 for failure. -const int kSuccessRatioHistogramMaxValue = 2; +constexpr int kSuccessRatioHistogramMaxValue = 2; // The path of D-Bus Object sending NameOwnerChanged signal. -const char kDBusSystemObjectPath[] = "/org/freedesktop/DBus"; +constexpr char kDBusSystemObjectPath[] = "/org/freedesktop/DBus"; // The D-Bus Object interface. -const char kDBusSystemObjectInterface[] = "org.freedesktop.DBus"; +constexpr char kDBusSystemObjectInterface[] = "org.freedesktop.DBus"; // The D-Bus Object address. -const char kDBusSystemObjectAddress[] = "org.freedesktop.DBus"; +constexpr char kDBusSystemObjectAddress[] = "org.freedesktop.DBus"; // The NameOwnerChanged member in |kDBusSystemObjectInterface|. -const char kNameOwnerChangedMember[] = "NameOwnerChanged"; +constexpr char kNameOwnerChangedMember[] = "NameOwnerChanged"; // An empty function used for ObjectProxy::EmptyResponseCallback(). void EmptyResponseCallbackBody(Response* /*response*/) { @@ -186,16 +188,17 @@ if (bus_->HasDBusThread()) { base::PostTaskAndReplyWithResult( bus_->GetDBusTaskRunner(), FROM_HERE, - base::Bind(&ObjectProxy::ConnectToSignalInternal, this, interface_name, - signal_name, signal_callback), - base::Bind(on_connected_callback, interface_name, signal_name)); + base::BindOnce(&ObjectProxy::ConnectToSignalInternal, this, + interface_name, signal_name, signal_callback), + base::BindOnce(std::move(on_connected_callback), interface_name, + signal_name)); } else { // If the bus doesn't have a dedicated dbus thread we need to call // ConnectToSignalInternal directly otherwise we might miss a signal // that is currently queued if we do a PostTask. const bool success = ConnectToSignalInternal(interface_name, signal_name, signal_callback); - on_connected_callback.Run(interface_name, signal_name, success); + std::move(on_connected_callback).Run(interface_name, signal_name, success); } } @@ -210,10 +213,10 @@ WaitForServiceToBeAvailableCallback callback) { bus_->AssertOnOriginThread(); - wait_for_service_to_be_available_callbacks_.push_back(callback); + wait_for_service_to_be_available_callbacks_.push_back(std::move(callback)); bus_->GetDBusTaskRunner()->PostTask( FROM_HERE, - base::Bind(&ObjectProxy::WaitForServiceToBeAvailableInternal, this)); + base::BindOnce(&ObjectProxy::WaitForServiceToBeAvailableInternal, this)); } void ObjectProxy::Detach() { @@ -436,8 +439,8 @@ const bool service_is_ready = false; bus_->GetOriginTaskRunner()->PostTask( FROM_HERE, - base::Bind(&ObjectProxy::RunWaitForServiceToBeAvailableCallbacks, - this, service_is_ready)); + base::BindOnce(&ObjectProxy::RunWaitForServiceToBeAvailableCallbacks, + this, service_is_ready)); return; } @@ -445,8 +448,8 @@ if (service_is_available) { // Service is already available. bus_->GetOriginTaskRunner()->PostTask( FROM_HERE, - base::Bind(&ObjectProxy::RunWaitForServiceToBeAvailableCallbacks, - this, service_is_available)); + base::BindOnce(&ObjectProxy::RunWaitForServiceToBeAvailableCallbacks, + this, service_is_available)); return; } } @@ -711,7 +714,7 @@ std::vector<WaitForServiceToBeAvailableCallback> callbacks; callbacks.swap(wait_for_service_to_be_available_callbacks_); for (size_t i = 0; i < callbacks.size(); ++i) - callbacks[i].Run(service_is_available); + std::move(callbacks[i]).Run(service_is_available); } } // namespace dbus
diff --git a/dbus/object_proxy.h b/dbus/object_proxy.h index 48d8468..1573f992 100644 --- a/dbus/object_proxy.h +++ b/dbus/object_proxy.h
@@ -83,7 +83,7 @@ // Called when the service becomes available. using WaitForServiceToBeAvailableCallback = - base::Callback<void(bool service_is_available)>; + base::OnceCallback<void(bool service_is_available)>; // Called when the object proxy is connected to the signal. // Parameters: @@ -91,7 +91,7 @@ // - the signal name. // - whether it was successful or not. using OnConnectedCallback = - base::Callback<void(const std::string&, const std::string&, bool)>; + base::OnceCallback<void(const std::string&, const std::string&, bool)>; // Calls the method of the remote object and blocks until the response // is returned. Returns NULL on error with the error details specified
diff --git a/ipc/ipc_message_start.h b/ipc/ipc_message_start.h index 6359b3f..a57e618 100644 --- a/ipc/ipc_message_start.h +++ b/ipc/ipc_message_start.h
@@ -74,7 +74,6 @@ ChromeUtilityPrintingMsgStart, AecDumpMsgStart, OzoneGpuMsgStart, - ChromeUtilityExtensionsMsgStart, PlatformNotificationMsgStart, LayoutTestMsgStart, NetworkHintsMsgStart,
diff --git a/media/base/fake_single_thread_task_runner.h b/media/base/fake_single_thread_task_runner.h index b5ad0ed1..a56ac6f 100644 --- a/media/base/fake_single_thread_task_runner.h +++ b/media/base/fake_single_thread_task_runner.h
@@ -24,14 +24,14 @@ void Sleep(base::TimeDelta t); // base::SingleThreadTaskRunner implementation. - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) final; bool RunsTasksInCurrentSequence() const final; // This function is currently not used, and will return false. - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) final;
diff --git a/media/capture/content/capture_resolution_chooser_unittest.cc b/media/capture/content/capture_resolution_chooser_unittest.cc index 587a91fc..988756b 100644 --- a/media/capture/content/capture_resolution_chooser_unittest.cc +++ b/media/capture/content/capture_resolution_chooser_unittest.cc
@@ -11,7 +11,7 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/gfx/geometry/size.h" -using tracked_objects::Location; +using base::Location; namespace media {
diff --git a/media/capture/content/screen_capture_device_core.cc b/media/capture/content/screen_capture_device_core.cc index 4ebcdf1..8fa0601 100644 --- a/media/capture/content/screen_capture_device_core.cc +++ b/media/capture/content/screen_capture_device_core.cc
@@ -173,7 +173,7 @@ state_ = next_state; } -void ScreenCaptureDeviceCore::Error(const tracked_objects::Location& from_here, +void ScreenCaptureDeviceCore::Error(const base::Location& from_here, const std::string& reason) { DCHECK(thread_checker_.CalledOnValidThread());
diff --git a/media/capture/content/thread_safe_capture_oracle.cc b/media/capture/content/thread_safe_capture_oracle.cc index 72905a2..386186ae 100644 --- a/media/capture/content/thread_safe_capture_oracle.cc +++ b/media/capture/content/thread_safe_capture_oracle.cc
@@ -219,9 +219,8 @@ client_.reset(); } -void ThreadSafeCaptureOracle::ReportError( - const tracked_objects::Location& from_here, - const std::string& reason) { +void ThreadSafeCaptureOracle::ReportError(const base::Location& from_here, + const std::string& reason) { base::AutoLock guard(lock_); if (client_) client_->OnError(from_here, reason);
diff --git a/media/capture/video/android/video_capture_device_android.cc b/media/capture/video/android/video_capture_device_android.cc index a9dcfb8..b98c0bb 100644 --- a/media/capture/video/android/video_capture_device_android.cc +++ b/media/capture/video/android/video_capture_device_android.cc
@@ -440,9 +440,8 @@ } } -void VideoCaptureDeviceAndroid::SetErrorState( - const tracked_objects::Location& from_here, - const std::string& reason) { +void VideoCaptureDeviceAndroid::SetErrorState(const base::Location& from_here, + const std::string& reason) { { base::AutoLock lock(lock_); state_ = kError;
diff --git a/media/capture/video/chromeos/camera_device_context.cc b/media/capture/video/chromeos/camera_device_context.cc index bf7b580..36a9bd1 100644 --- a/media/capture/video/chromeos/camera_device_context.cc +++ b/media/capture/video/chromeos/camera_device_context.cc
@@ -26,9 +26,8 @@ return state_; } -void CameraDeviceContext::SetErrorState( - const tracked_objects::Location& from_here, - const std::string& reason) { +void CameraDeviceContext::SetErrorState(const base::Location& from_here, + const std::string& reason) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); state_ = State::kError; LOG(ERROR) << reason;
diff --git a/media/capture/video/chromeos/camera_device_context.h b/media/capture/video/chromeos/camera_device_context.h index bb11a46..33f950d 100644 --- a/media/capture/video/chromeos/camera_device_context.h +++ b/media/capture/video/chromeos/camera_device_context.h
@@ -99,7 +99,7 @@ // Sets state to kError and call |client_->OnError| to tear down the // VideoCaptureDevice. - void SetErrorState(const tracked_objects::Location& from_here, + void SetErrorState(const base::Location& from_here, const std::string& reason); // Logs |message| to |client_|.
diff --git a/media/capture/video/chromeos/mock_video_capture_client.cc b/media/capture/video/chromeos/mock_video_capture_client.cc index dcda5aa..b9be6f7 100644 --- a/media/capture/video/chromeos/mock_video_capture_client.cc +++ b/media/capture/video/chromeos/mock_video_capture_client.cc
@@ -32,9 +32,8 @@ quit_cb_ = std::move(quit_cb); } -void MockVideoCaptureClient::DumpError( - const tracked_objects::Location& location, - const std::string& message) { +void MockVideoCaptureClient::DumpError(const base::Location& location, + const std::string& message) { DPLOG(ERROR) << location.ToString() << " " << message; }
diff --git a/media/capture/video/chromeos/mock_video_capture_client.h b/media/capture/video/chromeos/mock_video_capture_client.h index 4423b28..e9be4a7 100644 --- a/media/capture/video/chromeos/mock_video_capture_client.h +++ b/media/capture/video/chromeos/mock_video_capture_client.h
@@ -18,7 +18,7 @@ MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); MOCK_METHOD0(DoResurrectLastOutputBuffer, void(void)); MOCK_METHOD2(OnError, - void(const tracked_objects::Location& from_here, + void(const base::Location& from_here, const std::string& reason)); MOCK_CONST_METHOD0(GetBufferPoolUtilization, double(void)); MOCK_METHOD0(OnStarted, void(void)); @@ -31,8 +31,7 @@ void SetQuitCb(base::OnceClosure quit_cb); - void DumpError(const tracked_objects::Location& location, - const std::string& message); + void DumpError(const base::Location& location, const std::string& message); void OnIncomingCapturedData(const uint8_t* data, int length,
diff --git a/media/capture/video/fake_video_capture_device_unittest.cc b/media/capture/video/fake_video_capture_device_unittest.cc index 0339d906..dee4cab8 100644 --- a/media/capture/video/fake_video_capture_device_unittest.cc +++ b/media/capture/video/fake_video_capture_device_unittest.cc
@@ -102,7 +102,7 @@ class MockClient : public VideoCaptureDevice::Client { public: MOCK_METHOD2(OnError, - void(const tracked_objects::Location& from_here, + void(const base::Location& from_here, const std::string& reason)); MOCK_METHOD0(OnStarted, void(void));
diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/media/capture/video/linux/v4l2_capture_delegate.cc index f776dfb..4455fdb 100644 --- a/media/capture/video/linux/v4l2_capture_delegate.cc +++ b/media/capture/video/linux/v4l2_capture_delegate.cc
@@ -862,9 +862,8 @@ FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, GetWeakPtr())); } -void V4L2CaptureDelegate::SetErrorState( - const tracked_objects::Location& from_here, - const std::string& reason) { +void V4L2CaptureDelegate::SetErrorState(const base::Location& from_here, + const std::string& reason) { DCHECK(v4l2_task_runner_->BelongsToCurrentThread()); is_capturing_ = false; client_->OnError(from_here, reason);
diff --git a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc index b4b4b139..04f7b9f 100644 --- a/media/capture/video/linux/v4l2_capture_delegate_unittest.cc +++ b/media/capture/video/linux/v4l2_capture_delegate_unittest.cc
@@ -208,7 +208,7 @@ ResurrectLastOutputBuffer, Buffer(const gfx::Size&, VideoPixelFormat, VideoPixelStorage, int)); MOCK_METHOD2(OnError, - void(const tracked_objects::Location& from_here, + void(const base::Location& from_here, const std::string& reason)); MOCK_CONST_METHOD0(GetBufferPoolUtilization, double(void)); MOCK_METHOD0(OnStarted, void(void));
diff --git a/media/capture/video/mac/video_capture_device_decklink_mac.mm b/media/capture/video/mac/video_capture_device_decklink_mac.mm index 6948165f..1fa0be20 100644 --- a/media/capture/video/mac/video_capture_device_decklink_mac.mm +++ b/media/capture/video/mac/video_capture_device_decklink_mac.mm
@@ -73,7 +73,7 @@ ULONG Release() override; // Forwarder to VideoCaptureDeviceDeckLinkMac::SendErrorString(). - void SendErrorString(const tracked_objects::Location& from_here, + void SendErrorString(const base::Location& from_here, const std::string& reason); // Forwarder to VideoCaptureDeviceDeckLinkMac::SendLogString(). @@ -311,9 +311,8 @@ return ret_value; } -void DeckLinkCaptureDelegate::SendErrorString( - const tracked_objects::Location& from_here, - const std::string& reason) { +void DeckLinkCaptureDelegate::SendErrorString(const base::Location& from_here, + const std::string& reason) { base::AutoLock lock(lock_); if (frame_receiver_) frame_receiver_->SendErrorString(from_here, reason); @@ -482,7 +481,7 @@ } void VideoCaptureDeviceDeckLinkMac::SendErrorString( - const tracked_objects::Location& from_here, + const base::Location& from_here, const std::string& reason) { DCHECK(thread_checker_.CalledOnValidThread()); base::AutoLock lock(lock_);
diff --git a/media/capture/video/mac/video_capture_device_mac.mm b/media/capture/video/mac/video_capture_device_mac.mm index 5589405..bbba181 100644 --- a/media/capture/video/mac/video_capture_device_mac.mm +++ b/media/capture/video/mac/video_capture_device_mac.mm
@@ -486,9 +486,8 @@ photo_callback_.Reset(); } -void VideoCaptureDeviceMac::ReceiveError( - const tracked_objects::Location& from_here, - const std::string& reason) { +void VideoCaptureDeviceMac::ReceiveError(const base::Location& from_here, + const std::string& reason) { task_runner_->PostTask( FROM_HERE, base::Bind(&VideoCaptureDeviceMac::SetErrorState, weak_factory_.GetWeakPtr(), from_here, reason)); @@ -524,9 +523,8 @@ return id_vendor + ":" + id_product; } -void VideoCaptureDeviceMac::SetErrorState( - const tracked_objects::Location& from_here, - const std::string& reason) { +void VideoCaptureDeviceMac::SetErrorState(const base::Location& from_here, + const std::string& reason) { DCHECK(task_runner_->BelongsToCurrentThread()); state_ = kError; client_->OnError(from_here, reason);
diff --git a/media/capture/video/video_capture_device_client.cc b/media/capture/video/video_capture_device_client.cc index a8eaee5..212dc56 100644 --- a/media/capture/video/video_capture_device_client.cc +++ b/media/capture/video/video_capture_device_client.cc
@@ -417,9 +417,8 @@ return MakeBufferStruct(buffer_pool_, buffer_id, new_frame_feedback_id); } -void VideoCaptureDeviceClient::OnError( - const tracked_objects::Location& from_here, - const std::string& reason) { +void VideoCaptureDeviceClient::OnError(const base::Location& from_here, + const std::string& reason) { const std::string log_message = base::StringPrintf( "error@ %s, %s, OS message: %s", from_here.ToString().c_str(), reason.c_str(),
diff --git a/media/capture/video/video_capture_device_client.h b/media/capture/video/video_capture_device_client.h index 85c80c48..c863a6ee 100644 --- a/media/capture/video/video_capture_device_client.h +++ b/media/capture/video/video_capture_device_client.h
@@ -76,7 +76,7 @@ media::VideoPixelFormat format, media::VideoPixelStorage storage, int new_frame_feedback_id) override; - void OnError(const tracked_objects::Location& from_here, + void OnError(const base::Location& from_here, const std::string& reason) override; void OnLog(const std::string& message) override; void OnStarted() override;
diff --git a/media/capture/video/video_capture_device_unittest.cc b/media/capture/video/video_capture_device_unittest.cc index a4b313f..0c52e83 100644 --- a/media/capture/video/video_capture_device_unittest.cc +++ b/media/capture/video/video_capture_device_unittest.cc
@@ -97,8 +97,7 @@ closure.Run(); } -void DumpError(const tracked_objects::Location& location, - const std::string& message) { +void DumpError(const base::Location& location, const std::string& message) { DPLOG(ERROR) << location.ToString() << " " << message; } @@ -122,7 +121,7 @@ MOCK_METHOD0(DoOnIncomingCapturedVideoFrame, void(void)); MOCK_METHOD0(DoResurrectLastOutputBuffer, void(void)); MOCK_METHOD2(OnError, - void(const tracked_objects::Location& from_here, + void(const base::Location& from_here, const std::string& reason)); MOCK_CONST_METHOD0(GetBufferPoolUtilization, double(void)); MOCK_METHOD0(OnStarted, void(void));
diff --git a/media/capture/video/win/video_capture_device_mf_win.cc b/media/capture/video/win/video_capture_device_mf_win.cc index 44907fd..b4a4719 100644 --- a/media/capture/video/win/video_capture_device_mf_win.cc +++ b/media/capture/video/win/video_capture_device_mf_win.cc
@@ -307,9 +307,8 @@ } } -void VideoCaptureDeviceMFWin::OnError( - const tracked_objects::Location& from_here, - HRESULT hr) { +void VideoCaptureDeviceMFWin::OnError(const base::Location& from_here, + HRESULT hr) { if (client_.get()) { client_->OnError( from_here,
diff --git a/media/capture/video/win/video_capture_device_win.cc b/media/capture/video/win/video_capture_device_win.cc index 06ee3ba..f0c76738 100644 --- a/media/capture/video/win/video_capture_device_win.cc +++ b/media/capture/video/win/video_capture_device_win.cc
@@ -900,10 +900,9 @@ } } -void VideoCaptureDeviceWin::SetErrorState( - const tracked_objects::Location& from_here, - const std::string& reason, - HRESULT hr) { +void VideoCaptureDeviceWin::SetErrorState(const base::Location& from_here, + const std::string& reason, + HRESULT hr) { DCHECK(thread_checker_.CalledOnValidThread()); DLOG_IF_FAILED_WITH_HRESULT(reason, hr); state_ = kError;
diff --git a/media/cast/cast_environment.cc b/media/cast/cast_environment.cc index 2026b2e..6f697f13 100644 --- a/media/cast/cast_environment.cc +++ b/media/cast/cast_environment.cc
@@ -29,16 +29,15 @@ CastEnvironment::~CastEnvironment() {} bool CastEnvironment::PostTask(ThreadId identifier, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { return GetTaskRunner(identifier)->PostTask(from_here, task); } -bool CastEnvironment::PostDelayedTask( - ThreadId identifier, - const tracked_objects::Location& from_here, - const base::Closure& task, - base::TimeDelta delay) { +bool CastEnvironment::PostDelayedTask(ThreadId identifier, + const base::Location& from_here, + const base::Closure& task, + base::TimeDelta delay) { return GetTaskRunner(identifier)->PostDelayedTask(from_here, task, delay); }
diff --git a/media/cast/cast_environment.h b/media/cast/cast_environment.h index 11d00a7..604d1fd 100644 --- a/media/cast/cast_environment.h +++ b/media/cast/cast_environment.h
@@ -43,11 +43,11 @@ // even if the task is posted, there's no guarantee that it will run, since // the target thread may already have a Quit message in its queue. bool PostTask(ThreadId identifier, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task); bool PostDelayedTask(ThreadId identifier, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task, base::TimeDelta delay);
diff --git a/media/cast/test/skewed_single_thread_task_runner.cc b/media/cast/test/skewed_single_thread_task_runner.cc index 20b830a..b7b6db7 100644 --- a/media/cast/test/skewed_single_thread_task_runner.cc +++ b/media/cast/test/skewed_single_thread_task_runner.cc
@@ -27,7 +27,7 @@ } bool SkewedSingleThreadTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return task_runner_->PostDelayedTask( @@ -40,7 +40,7 @@ } bool SkewedSingleThreadTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return task_runner_->PostNonNestableDelayedTask(
diff --git a/media/cast/test/skewed_single_thread_task_runner.h b/media/cast/test/skewed_single_thread_task_runner.h index ce009ff..84eb96a 100644 --- a/media/cast/test/skewed_single_thread_task_runner.h +++ b/media/cast/test/skewed_single_thread_task_runner.h
@@ -30,14 +30,14 @@ void SetSkew(double skew); // base::SingleThreadTaskRunner implementation. - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) final; bool RunsTasksInCurrentSequence() const final; // This function is currently not used, and will return false. - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) final;
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc index b97a0d59..03e7c05 100644 --- a/media/filters/ffmpeg_demuxer_unittest.cc +++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -227,7 +227,7 @@ // Verifies that |buffer| has a specific |size| and |timestamp|. // |location| simply indicates where the call to this function was made. // This makes it easier to track down where test failures occur. - void OnReadDone(const tracked_objects::Location& location, + void OnReadDone(const base::Location& location, const ReadExpectation& read_expectation, DemuxerStream::Status status, const scoped_refptr<DecoderBuffer>& buffer) { @@ -251,7 +251,7 @@ } DemuxerStream::ReadCB NewReadCB( - const tracked_objects::Location& location, + const base::Location& location, int size, int64_t timestamp_us, bool is_key_frame, @@ -261,7 +261,7 @@ } DemuxerStream::ReadCB NewReadCBWithCheckedDiscard( - const tracked_objects::Location& location, + const base::Location& location, int size, int64_t timestamp_us, base::TimeDelta discard_front_padding,
diff --git a/media/gpu/avda_codec_allocator_unittest.cc b/media/gpu/avda_codec_allocator_unittest.cc index 682ba0f..237af58 100644 --- a/media/gpu/avda_codec_allocator_unittest.cc +++ b/media/gpu/avda_codec_allocator_unittest.cc
@@ -152,7 +152,7 @@ // don't have a specialization for void, and void won't work as written. So, // be sure to return something. template <typename ReturnType> - ReturnType PostAndWait(const tracked_objects::Location& from_here, + ReturnType PostAndWait(const base::Location& from_here, const base::Callback<ReturnType(void)>& cb) { base::WaitableEvent event(base::WaitableEvent::ResetPolicy::MANUAL, base::WaitableEvent::InitialState::NOT_SIGNALED);
diff --git a/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc b/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc index 9e4fe86..350a16f 100644 --- a/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc +++ b/media/gpu/ipc/client/gpu_video_encode_accelerator_host.cc
@@ -219,7 +219,7 @@ } void GpuVideoEncodeAcceleratorHost::PostNotifyError( - const tracked_objects::Location& location, + const base::Location& location, Error error, const std::string& message) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git a/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc b/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc index 3d4f67cd..da4728b5 100644 --- a/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc +++ b/mojo/public/cpp/bindings/tests/bind_task_runner_unittest.cc
@@ -31,14 +31,14 @@ task_ready_(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent::InitialState::NOT_SIGNALED) {} - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { NOTREACHED(); return false; } - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { {
diff --git a/mojo/public/cpp/system/simple_watcher.cc b/mojo/public/cpp/system/simple_watcher.cc index 3654a0e5..307e288 100644 --- a/mojo/public/cpp/system/simple_watcher.cc +++ b/mojo/public/cpp/system/simple_watcher.cc
@@ -122,7 +122,7 @@ DISALLOW_COPY_AND_ASSIGN(Context); }; -SimpleWatcher::SimpleWatcher(const tracked_objects::Location& from_here, +SimpleWatcher::SimpleWatcher(const base::Location& from_here, ArmingPolicy arming_policy, scoped_refptr<base::SequencedTaskRunner> runner) : arming_policy_(arming_policy),
diff --git a/mojo/public/cpp/system/simple_watcher.h b/mojo/public/cpp/system/simple_watcher.h index d5caf92..d9f7251 100644 --- a/mojo/public/cpp/system/simple_watcher.h +++ b/mojo/public/cpp/system/simple_watcher.h
@@ -85,7 +85,7 @@ MANUAL, }; - SimpleWatcher(const tracked_objects::Location& from_here, + SimpleWatcher(const base::Location& from_here, ArmingPolicy arming_policy, scoped_refptr<base::SequencedTaskRunner> runner = base::SequencedTaskRunnerHandle::Get());
diff --git a/net/cert_net/nss_ocsp.cc b/net/cert_net/nss_ocsp.cc index 7e7239d..da05dea26 100644 --- a/net/cert_net/nss_ocsp.cc +++ b/net/cert_net/nss_ocsp.cc
@@ -83,7 +83,7 @@ } // Called from worker thread. - void PostTaskToIOLoop(const tracked_objects::Location& from_here, + void PostTaskToIOLoop(const base::Location& from_here, const base::Closure& task); void AddRequest(OCSPRequestSession* request); @@ -540,8 +540,8 @@ pthread_mutex_unlock(&g_request_context_lock); } -void OCSPIOLoop::PostTaskToIOLoop( - const tracked_objects::Location& from_here, const base::Closure& task) { +void OCSPIOLoop::PostTaskToIOLoop(const base::Location& from_here, + const base::Closure& task) { base::AutoLock autolock(lock_); if (io_loop_) io_loop_->task_runner()->PostTask(from_here, task);
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.cc b/net/disk_cache/blockfile/in_flight_backend_io.cc index 55afc74..2e7f7c6 100644 --- a/net/disk_cache/blockfile/in_flight_backend_io.cc +++ b/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -550,9 +550,8 @@ op->callback().Run(op->result()); } -void InFlightBackendIO::PostOperation( - const tracked_objects::Location& from_here, - BackendIO* operation) { +void InFlightBackendIO::PostOperation(const base::Location& from_here, + BackendIO* operation) { background_thread_->PostTask( from_here, base::Bind(&BackendIO::ExecuteOperation, operation)); OnOperationPosted(operation);
diff --git a/net/dns/mdns_client_unittest.cc b/net/dns/mdns_client_unittest.cc index 1ac3dca9..15e85a00 100644 --- a/net/dns/mdns_client_unittest.cc +++ b/net/dns/mdns_client_unittest.cc
@@ -377,7 +377,7 @@ MockTimer() : base::MockTimer(false, false) {} ~MockTimer() {} - void Start(const tracked_objects::Location& posted_from, + void Start(const base::Location& posted_from, base::TimeDelta delay, const base::Closure& user_task) { StartObserver(posted_from, delay, user_task); @@ -387,7 +387,7 @@ // StartObserver is invoked when MockTimer::Start() is called. // Does not replace the behavior of MockTimer::Start(). MOCK_METHOD3(StartObserver, - void(const tracked_objects::Location& posted_from, + void(const base::Location& posted_from, base::TimeDelta delay, const base::Closure& user_task));
diff --git a/net/extras/sqlite/sqlite_persistent_cookie_store.cc b/net/extras/sqlite/sqlite_persistent_cookie_store.cc index be7cf07..637a8cee 100644 --- a/net/extras/sqlite/sqlite_persistent_cookie_store.cc +++ b/net/extras/sqlite/sqlite_persistent_cookie_store.cc
@@ -232,10 +232,8 @@ void DatabaseErrorCallback(int error, sql::Statement* stmt); void KillDatabase(); - void PostBackgroundTask(const tracked_objects::Location& origin, - base::OnceClosure task); - void PostClientTask(const tracked_objects::Location& origin, - base::OnceClosure task); + void PostBackgroundTask(const base::Location& origin, base::OnceClosure task); + void PostClientTask(const base::Location& origin, base::OnceClosure task); // Shared code between the different load strategies to be used after all // cookies have been loaded. @@ -1359,7 +1357,7 @@ } void SQLitePersistentCookieStore::Backend::PostBackgroundTask( - const tracked_objects::Location& origin, + const base::Location& origin, base::OnceClosure task) { if (!background_task_runner_->PostTask(origin, std::move(task))) { LOG(WARNING) << "Failed to post task from " << origin.ToString() @@ -1368,7 +1366,7 @@ } void SQLitePersistentCookieStore::Backend::PostClientTask( - const tracked_objects::Location& origin, + const base::Location& origin, base::OnceClosure task) { if (!client_task_runner_->PostTask(origin, std::move(task))) { LOG(WARNING) << "Failed to post task from " << origin.ToString()
diff --git a/net/http/bidirectional_stream_unittest.cc b/net/http/bidirectional_stream_unittest.cc index b6dd52c..cbb28ae 100644 --- a/net/http/bidirectional_stream_unittest.cc +++ b/net/http/bidirectional_stream_unittest.cc
@@ -372,7 +372,7 @@ MockTimer() : base::MockTimer(false, false) {} ~MockTimer() override {} - void Start(const tracked_objects::Location& posted_from, + void Start(const base::Location& posted_from, base::TimeDelta delay, const base::Closure& user_task) override { // Sets a maximum delay, so the timer does not fire unless it is told to.
diff --git a/net/quic/chromium/test_task_runner.cc b/net/quic/chromium/test_task_runner.cc index a9f9b2e98..e4bf48f 100644 --- a/net/quic/chromium/test_task_runner.cc +++ b/net/quic/chromium/test_task_runner.cc
@@ -17,7 +17,7 @@ TestTaskRunner::~TestTaskRunner() {} -bool TestTaskRunner::PostDelayedTask(const tracked_objects::Location& from_here, +bool TestTaskRunner::PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { EXPECT_GE(delay, base::TimeDelta());
diff --git a/net/quic/chromium/test_task_runner.h b/net/quic/chromium/test_task_runner.h index 6744ca8..c0c9bce 100644 --- a/net/quic/chromium/test_task_runner.h +++ b/net/quic/chromium/test_task_runner.h
@@ -27,7 +27,7 @@ explicit TestTaskRunner(MockClock* clock); // base::TaskRunner implementation. - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override;
diff --git a/net/ssl/openssl_ssl_util.cc b/net/ssl/openssl_ssl_util.cc index 6f84a06b..0209955 100644 --- a/net/ssl/openssl_ssl_util.cc +++ b/net/ssl/openssl_ssl_util.cc
@@ -152,7 +152,7 @@ } // namespace -void OpenSSLPutNetError(const tracked_objects::Location& location, int err) { +void OpenSSLPutNetError(const base::Location& location, int err) { // Net error codes are negative. Encode them as positive numbers. err = -err; if (err < 0 || err > 0xfff) {
diff --git a/ppapi/proxy/ppb_message_loop_proxy.cc b/ppapi/proxy/ppb_message_loop_proxy.cc index ac78eb9..71bcfa0 100644 --- a/ppapi/proxy/ppb_message_loop_proxy.cc +++ b/ppapi/proxy/ppb_message_loop_proxy.cc
@@ -187,10 +187,9 @@ static_cast<const void*>(this); } -void MessageLoopResource::PostClosure( - const tracked_objects::Location& from_here, - const base::Closure& closure, - int64_t delay_ms) { +void MessageLoopResource::PostClosure(const base::Location& from_here, + const base::Closure& closure, + int64_t delay_ms) { if (task_runner_.get()) { task_runner_->PostDelayedTask(from_here, closure, base::TimeDelta::FromMilliseconds(delay_ms));
diff --git a/ppapi/proxy/ppb_message_loop_proxy.h b/ppapi/proxy/ppb_message_loop_proxy.h index 9c15539..c6df84c 100644 --- a/ppapi/proxy/ppb_message_loop_proxy.h +++ b/ppapi/proxy/ppb_message_loop_proxy.h
@@ -58,7 +58,7 @@ private: struct TaskInfo { - tracked_objects::Location from_here; + base::Location from_here; base::Closure closure; int64_t delay_ms; }; @@ -73,7 +73,7 @@ // NOTE: The given closure will be run *WITHOUT* acquiring the Proxy lock. // This only makes sense for user code and completely thread-safe // proxy operations (e.g., MessageLoop::QuitClosure). - void PostClosure(const tracked_objects::Location& from_here, + void PostClosure(const base::Location& from_here, const base::Closure& closure, int64_t delay_ms) override; base::SingleThreadTaskRunner* GetTaskRunner() override;
diff --git a/remoting/base/auto_thread_task_runner.cc b/remoting/base/auto_thread_task_runner.cc index 59e549d..5345f2c 100644 --- a/remoting/base/auto_thread_task_runner.cc +++ b/remoting/base/auto_thread_task_runner.cc
@@ -17,16 +17,15 @@ DCHECK(!stop_task_.is_null()); } -bool AutoThreadTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay) { +bool AutoThreadTaskRunner::PostDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) { CHECK(task_runner_->PostDelayedTask(from_here, std::move(task), delay)); return true; } bool AutoThreadTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { CHECK(task_runner_->PostNonNestableDelayedTask(from_here, std::move(task),
diff --git a/remoting/base/auto_thread_task_runner.h b/remoting/base/auto_thread_task_runner.h index 4908607..c4f1398 100644 --- a/remoting/base/auto_thread_task_runner.h +++ b/remoting/base/auto_thread_task_runner.h
@@ -26,10 +26,10 @@ base::OnceClosure stop_task); // SingleThreadTaskRunner implementation - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override;
diff --git a/remoting/client/plugin/pepper_main_thread_task_runner.cc b/remoting/client/plugin/pepper_main_thread_task_runner.cc index d6b51efc..634dfab9 100644 --- a/remoting/client/plugin/pepper_main_thread_task_runner.cc +++ b/remoting/client/plugin/pepper_main_thread_task_runner.cc
@@ -31,7 +31,7 @@ } bool PepperMainThreadTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { auto task_ptr = base::MakeUnique<base::OnceClosure>(base::Bind( @@ -43,7 +43,7 @@ } bool PepperMainThreadTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return PostDelayedTask(from_here, std::move(task), delay);
diff --git a/remoting/client/plugin/pepper_main_thread_task_runner.h b/remoting/client/plugin/pepper_main_thread_task_runner.h index 83e02fe..fd79ee1 100644 --- a/remoting/client/plugin/pepper_main_thread_task_runner.h +++ b/remoting/client/plugin/pepper_main_thread_task_runner.h
@@ -26,10 +26,10 @@ PepperMainThreadTaskRunner(); // base::SingleThreadTaskRunner interface. - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override;
diff --git a/remoting/client/ui/desktop_viewport_unittest.cc b/remoting/client/ui/desktop_viewport_unittest.cc index bb4e7623..3694e58 100644 --- a/remoting/client/ui/desktop_viewport_unittest.cc +++ b/remoting/client/ui/desktop_viewport_unittest.cc
@@ -23,7 +23,7 @@ void TearDown() override; protected: - void AssertTransformationReceived(const tracked_objects::Location& from_here, + void AssertTransformationReceived(const base::Location& from_here, float scale, float offset_x, float offset_y); @@ -50,7 +50,7 @@ } void DesktopViewportTest::AssertTransformationReceived( - const tracked_objects::Location& from_here, + const base::Location& from_here, float scale, float offset_x, float offset_y) {
diff --git a/remoting/host/backoff_timer.cc b/remoting/host/backoff_timer.cc index 1df5559..f73cfa1a 100644 --- a/remoting/host/backoff_timer.cc +++ b/remoting/host/backoff_timer.cc
@@ -12,7 +12,7 @@ BackoffTimer::~BackoffTimer() {} -void BackoffTimer::Start(const tracked_objects::Location& posted_from, +void BackoffTimer::Start(const base::Location& posted_from, base::TimeDelta delay, base::TimeDelta max_delay, const base::Closure& user_task) {
diff --git a/remoting/host/backoff_timer.h b/remoting/host/backoff_timer.h index 5f4ab36e..73b74e9 100644 --- a/remoting/host/backoff_timer.h +++ b/remoting/host/backoff_timer.h
@@ -23,7 +23,7 @@ // Invokes |user_task| at intervals specified by |delay|, and // increasing up to |max_delay|. Always invokes |user_task| before // the first scheduled delay. - void Start(const tracked_objects::Location& posted_from, + void Start(const base::Location& posted_from, base::TimeDelta delay, base::TimeDelta max_delay, const base::Closure& user_task); @@ -42,7 +42,7 @@ std::unique_ptr<base::Timer> timer_; base::Closure user_task_; - tracked_objects::Location posted_from_; + base::Location posted_from_; net::BackoffEntry::Policy backoff_policy_ = {}; std::unique_ptr<net::BackoffEntry> backoff_entry_;
diff --git a/remoting/host/daemon_process.cc b/remoting/host/daemon_process.cc index 40b5c72..9013a18 100644 --- a/remoting/host/daemon_process.cc +++ b/remoting/host/daemon_process.cc
@@ -252,8 +252,7 @@ (*i)->SetScreenResolution(resolution); } -void DaemonProcess::CrashNetworkProcess( - const tracked_objects::Location& location) { +void DaemonProcess::CrashNetworkProcess(const base::Location& location) { DCHECK(caller_task_runner()->BelongsToCurrentThread()); DoCrashNetworkProcess(location);
diff --git a/remoting/host/daemon_process_unittest.cc b/remoting/host/daemon_process_unittest.cc index afa18c8..b8aa0c9 100644 --- a/remoting/host/daemon_process_unittest.cc +++ b/remoting/host/daemon_process_unittest.cc
@@ -80,7 +80,7 @@ bool(int, int, const IPC::ChannelHandle&)); MOCK_METHOD1(DoCreateDesktopSessionPtr, DesktopSession*(int)); - MOCK_METHOD1(DoCrashNetworkProcess, void(const tracked_objects::Location&)); + MOCK_METHOD1(DoCrashNetworkProcess, void(const base::Location&)); MOCK_METHOD0(LaunchNetworkProcess, void()); private: @@ -137,7 +137,7 @@ // DaemonProcess mocks DesktopSession* DoCreateDesktopSession(int terminal_id); - void DoCrashNetworkProcess(const tracked_objects::Location& location); + void DoCrashNetworkProcess(const base::Location& location); void LaunchNetworkProcess(); // Deletes |daemon_process_|. @@ -196,8 +196,7 @@ return new FakeDesktopSession(daemon_process_.get(), terminal_id); } -void DaemonProcessTest::DoCrashNetworkProcess( - const tracked_objects::Location& location) { +void DaemonProcessTest::DoCrashNetworkProcess(const base::Location& location) { daemon_process_->SendToNetwork( new ChromotingDaemonMsg_Crash(location.function_name(), location.file_name(),
diff --git a/remoting/host/daemon_process_win.cc b/remoting/host/daemon_process_win.cc index 173f364a..7c6ac10 100644 --- a/remoting/host/daemon_process_win.cc +++ b/remoting/host/daemon_process_win.cc
@@ -95,8 +95,7 @@ int terminal_id, const ScreenResolution& resolution, bool virtual_terminal) override; - void DoCrashNetworkProcess( - const tracked_objects::Location& location) override; + void DoCrashNetworkProcess(const base::Location& location) override; void LaunchNetworkProcess() override; // Changes the service start type to 'manual'. @@ -201,8 +200,7 @@ } } -void DaemonProcessWin::DoCrashNetworkProcess( - const tracked_objects::Location& location) { +void DaemonProcessWin::DoCrashNetworkProcess(const base::Location& location) { DCHECK(caller_task_runner()->BelongsToCurrentThread()); network_launcher_->Crash(location);
diff --git a/remoting/host/desktop_process_unittest.cc b/remoting/host/desktop_process_unittest.cc index 1d7a167..13c560b 100644 --- a/remoting/host/desktop_process_unittest.cc +++ b/remoting/host/desktop_process_unittest.cc
@@ -279,7 +279,7 @@ } void DesktopProcessTest::SendCrashRequest() { - tracked_objects::Location location = FROM_HERE; + base::Location location = FROM_HERE; daemon_channel_->Send(new ChromotingDaemonMsg_Crash( location.function_name(), location.file_name(), location.line_number())); }
diff --git a/remoting/host/desktop_session_win.cc b/remoting/host/desktop_session_win.cc index 321f69b..e18d074 100644 --- a/remoting/host/desktop_session_win.cc +++ b/remoting/host/desktop_session_win.cc
@@ -679,8 +679,7 @@ } } -void DesktopSessionWin::CrashDesktopProcess( - const tracked_objects::Location& location) { +void DesktopSessionWin::CrashDesktopProcess(const base::Location& location) { DCHECK(caller_task_runner_->BelongsToCurrentThread()); launcher_->Crash(location);
diff --git a/remoting/host/win/worker_process_launcher.cc b/remoting/host/win/worker_process_launcher.cc index 99af9a4..39f68a3 100644 --- a/remoting/host/win/worker_process_launcher.cc +++ b/remoting/host/win/worker_process_launcher.cc
@@ -73,8 +73,7 @@ StopWorker(); } -void WorkerProcessLauncher::Crash( - const tracked_objects::Location& location) { +void WorkerProcessLauncher::Crash(const base::Location& location) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); // Ask the worker process to crash voluntarily if it is still connected.
diff --git a/remoting/protocol/pairing_registry.cc b/remoting/protocol/pairing_registry.cc index 1e763a4..8193745c 100644 --- a/remoting/protocol/pairing_registry.cc +++ b/remoting/protocol/pairing_registry.cc
@@ -177,7 +177,7 @@ void PairingRegistry::PostTask( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { task_runner->PostTask(from_here, task); }
diff --git a/remoting/protocol/protocol_mock_objects.cc b/remoting/protocol/protocol_mock_objects.cc index 10ffb35..ddd273e 100644 --- a/remoting/protocol/protocol_mock_objects.cc +++ b/remoting/protocol/protocol_mock_objects.cc
@@ -92,7 +92,7 @@ void SynchronousPairingRegistry::PostTask( const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) { DCHECK(task_runner->BelongsToCurrentThread()); task.Run();
diff --git a/remoting/protocol/protocol_mock_objects.h b/remoting/protocol/protocol_mock_objects.h index 936d94f..ffea02d 100644 --- a/remoting/protocol/protocol_mock_objects.h +++ b/remoting/protocol/protocol_mock_objects.h
@@ -261,7 +261,7 @@ // Runs tasks synchronously instead of posting them to |task_runner|. void PostTask(const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::Closure& task) override; };
diff --git a/services/device/battery/battery_status_manager_linux_unittest.cc b/services/device/battery/battery_status_manager_linux_unittest.cc index b5d792e6..4cd5153 100644 --- a/services/device/battery/battery_status_manager_linux_unittest.cc +++ b/services/device/battery/battery_status_manager_linux_unittest.cc
@@ -45,7 +45,7 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback on_connected_callback); + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback); std::unique_ptr<dbus::Response> CreateCallMethodResponse( dbus::MethodCall* method_call, Unused); @@ -68,7 +68,7 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { bool on_connected_success = true; if (interface_name == kUPowerInterfaceName) { if (signal_name == kUPowerSignalDeviceAdded) @@ -86,7 +86,8 @@ << " Unexpected interface=" << interface_name << ", signal=" << signal_name; } - on_connected_callback.Run(interface_name, signal_name, on_connected_success); + std::move(*on_connected_callback) + .Run(interface_name, signal_name, on_connected_success); } std::unique_ptr<dbus::Response> MockUPowerObject::CreateCallMethodResponse( @@ -175,7 +176,7 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback on_connected_callback); + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback); std::unique_ptr<dbus::Response> CreateCallMethodResponse( dbus::MethodCall* method_call, Unused); @@ -209,7 +210,7 @@ const std::string& interface_name, const std::string& signal_name, dbus::ObjectProxy::SignalCallback signal_callback, - dbus::ObjectProxy::OnConnectedCallback on_connected_callback) { + dbus::ObjectProxy::OnConnectedCallback* on_connected_callback) { bool on_connected_success = true; if (interface_name == kUPowerDeviceInterfaceName && signal_name == kUPowerDeviceSignalChanged) @@ -225,7 +226,8 @@ << " Unexpected interface=" << interface_name << ", signal=" << signal_name; } - on_connected_callback.Run(interface_name, signal_name, on_connected_success); + std::move(*on_connected_callback) + .Run(interface_name, signal_name, on_connected_success); } std::unique_ptr<dbus::Response> MockBatteryObject::CreateCallMethodResponse( @@ -262,15 +264,15 @@ } MockBatteryObject& MockBatteryObject::ExpectConnectToSignalChanged() { - EXPECT_CALL(*proxy.get(), ConnectToSignal(kUPowerDeviceInterfaceName, - kUPowerDeviceSignalChanged, _, _)) + EXPECT_CALL(*proxy.get(), DoConnectToSignal(kUPowerDeviceInterfaceName, + kUPowerDeviceSignalChanged, _, _)) .WillOnce(Invoke(this, &MockBatteryObject::ConnectToSignal)); return *this; } MockBatteryObject& MockBatteryObject::ExpectConnectToSignalPropertyChanged() { - EXPECT_CALL(*proxy.get(), ConnectToSignal(dbus::kPropertiesInterface, - dbus::kPropertiesChanged, _, _)) + EXPECT_CALL(*proxy.get(), DoConnectToSignal(dbus::kPropertiesInterface, + dbus::kPropertiesChanged, _, _)) .WillOnce(Invoke(this, &MockBatteryObject::ConnectToSignal)); return *this; } @@ -407,11 +409,11 @@ Invoke(&mock_upower_, &MockUPowerObject::CreateCallMethodResponse)); EXPECT_CALL( *mock_upower_.proxy.get(), - ConnectToSignal(kUPowerInterfaceName, kUPowerSignalDeviceAdded, _, _)) + DoConnectToSignal(kUPowerInterfaceName, kUPowerSignalDeviceAdded, _, _)) .WillOnce(Invoke(&mock_upower_, &MockUPowerObject::ConnectToSignal)); EXPECT_CALL( *mock_upower_.proxy.get(), - ConnectToSignal(kUPowerInterfaceName, kUPowerSignalDeviceRemoved, _, _)) + DoConnectToSignal(kUPowerInterfaceName, kUPowerSignalDeviceRemoved, _, _)) .WillOnce(Invoke(&mock_upower_, &MockUPowerObject::ConnectToSignal)); }
diff --git a/storage/browser/fileapi/sandbox_directory_database.cc b/storage/browser/fileapi/sandbox_directory_database.cc index 4afe5e2..7b73e14 100644 --- a/storage/browser/fileapi/sandbox_directory_database.cc +++ b/storage/browser/fileapi/sandbox_directory_database.cc
@@ -948,9 +948,8 @@ return true; } -void SandboxDirectoryDatabase::HandleError( - const tracked_objects::Location& from_here, - const leveldb::Status& status) { +void SandboxDirectoryDatabase::HandleError(const base::Location& from_here, + const leveldb::Status& status) { LOG(ERROR) << "SandboxDirectoryDatabase failed at: " << from_here.ToString() << " with error: " << status.ToString(); db_.reset();
diff --git a/storage/browser/fileapi/sandbox_origin_database.cc b/storage/browser/fileapi/sandbox_origin_database.cc index 5735eda..07a8b43 100644 --- a/storage/browser/fileapi/sandbox_origin_database.cc +++ b/storage/browser/fileapi/sandbox_origin_database.cc
@@ -189,9 +189,8 @@ return true; } -void SandboxOriginDatabase::HandleError( - const tracked_objects::Location& from_here, - const leveldb::Status& status) { +void SandboxOriginDatabase::HandleError(const base::Location& from_here, + const leveldb::Status& status) { db_.reset(); LOG(ERROR) << "SandboxOriginDatabase failed at: " << from_here.ToString() << " with error: " << status.ToString();
diff --git a/storage/browser/fileapi/timed_task_helper.cc b/storage/browser/fileapi/timed_task_helper.cc index 0ea3f09..eb3d1b12 100644 --- a/storage/browser/fileapi/timed_task_helper.cc +++ b/storage/browser/fileapi/timed_task_helper.cc
@@ -40,10 +40,9 @@ return tracker_ != NULL; } -void TimedTaskHelper::Start( - const tracked_objects::Location& posted_from, - base::TimeDelta delay, - const base::Closure& user_task) { +void TimedTaskHelper::Start(const base::Location& posted_from, + base::TimeDelta delay, + const base::Closure& user_task) { posted_from_ = posted_from; delay_ = delay; user_task_ = user_task;
diff --git a/storage/browser/fileapi/timed_task_helper.h b/storage/browser/fileapi/timed_task_helper.h index 09a6137f..d098609 100644 --- a/storage/browser/fileapi/timed_task_helper.h +++ b/storage/browser/fileapi/timed_task_helper.h
@@ -30,7 +30,7 @@ ~TimedTaskHelper(); bool IsRunning() const; - void Start(const tracked_objects::Location& posted_from, + void Start(const base::Location& posted_from, base::TimeDelta delay, const base::Closure& user_task); void Reset(); @@ -43,7 +43,7 @@ void PostDelayedTask(std::unique_ptr<Tracker> tracker, base::TimeDelta delay); scoped_refptr<base::SequencedTaskRunner> task_runner_; - tracked_objects::Location posted_from_; + base::Location posted_from_; base::TimeDelta delay_; base::Closure user_task_;
diff --git a/storage/browser/quota/quota_manager.cc b/storage/browser/quota/quota_manager.cc index 64f0150..8e57fc5 100644 --- a/storage/browser/quota/quota_manager.cc +++ b/storage/browser/quota/quota_manager.cc
@@ -1676,7 +1676,7 @@ } void QuotaManager::PostTaskAndReplyWithResultForDBThread( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::Callback<bool(QuotaDatabase*)> task, base::Callback<void(bool)> reply) { // Deleting manager will post another task to DB sequence to delete
diff --git a/storage/browser/quota/quota_manager.h b/storage/browser/quota/quota_manager.h index 5973b5b..48edac76 100644 --- a/storage/browser/quota/quota_manager.h +++ b/storage/browser/quota/quota_manager.h
@@ -415,7 +415,7 @@ void DeleteOnCorrectThread() const; void PostTaskAndReplyWithResultForDBThread( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::Callback<bool(QuotaDatabase*)> task, base::Callback<void(bool)> reply);
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG index c40d7fa..31409186 100644 --- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG +++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -13288,9 +13288,7 @@ crbug.com/591099 http/tests/xmlhttprequest/XMLHttpRequestException.html [ Failure Pass ] crbug.com/591099 http/tests/xmlhttprequest/abort-should-destroy-responseText.html [ Failure Pass ] crbug.com/591099 http/tests/xmlhttprequest/access-control-response-with-body-sync.html [ Failure Pass ] -crbug.com/591099 http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html [ Failure Pass ] crbug.com/591099 http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-without-wildcard.html [ Failure Pass Timeout ] -crbug.com/591099 http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied.html [ Failure Pass ] crbug.com/591099 http/tests/xmlhttprequest/async-xhr-revalidate-after-sync-xhr.html [ Failure Pass ] crbug.com/591099 http/tests/xmlhttprequest/authorization-header.html [ Failure Pass ] crbug.com/591099 http/tests/xmlhttprequest/binary-x-user-defined.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations index 0c82b100..fd0eaa08 100644 --- a/third_party/WebKit/LayoutTests/TestExpectations +++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -3667,3 +3667,7 @@ crbug.com/763809 [ Win7 Debug ] fast/multicol/nested-very-tall-inside-short-crash.html [ Pass Failure Timeout ] crbug.com/763810 [ Win7 Debug ] virtual/threaded/transitions/transition-end-event-nested.html [ Pass Failure ] crbug.com/763975 [ Linux Debug ] webaudio/internals/cycle-connection-gc.html [ Pass Failure ] + +# Sheriff failures 2017-09-12 +crbug.com/764179 [ Mac10.11 ] virtual/gpu-rasterization/images/color-profile-background-image-space.html [ Pass Failure ] +crbug.com/764180 [ Android ] virtual/display_list_2d_canvas/fast/canvas/script-inside-canvas-fallback.html [ Pass Crash ]
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json index 133e38c5..4e746059 100644 --- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json +++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -71564,11 +71564,6 @@ {} ] ], - "compat/historical-expected.txt": [ - [ - {} - ] - ], "compat/webkit-text-fill-color-property-001-ref.html": [ [ {} @@ -190495,7 +190490,7 @@ "support" ], "2dcontext/OWNERS": [ - "2df4accfcd4bf31567eaf545e056469356f2529e", + "88028065ecd152d7a46a9afcf3c4748f36797f1e", "support" ], "2dcontext/best-practices/.gitkeep": [ @@ -199255,7 +199250,7 @@ "testharness" ], "clear-site-data/OWNERS": [ - "0d487ee1871fdb1f34a0e38eafb43f46ae598485", + "8c90c19ce29952d868460d36f7b20120b155992c", "support" ], "clear-site-data/navigation-insecure.html": [ @@ -199506,10 +199501,6 @@ "4b23ea52d785a6dd19785bd4278bf700eb5547f8", "support" ], - "compat/historical-expected.txt": [ - "b7835af0dca3ccb149cd16099d6d84bc3badda0f", - "support" - ], "compat/historical.html": [ "2d71e7532fc32af61d2410927b6405a9e79279a4", "testharness" @@ -199619,7 +199610,7 @@ "testharness" ], "content-security-policy/OWNERS": [ - "94afa6a10c171843007f8e7fd96246af9060f79d", + "4f28e8a4ccf35c68803b321499f3c743825c1e74", "support" ], "content-security-policy/README.css": [ @@ -202231,7 +202222,7 @@ "testharness" ], "cookies/OWNERS": [ - "94afa6a10c171843007f8e7fd96246af9060f79d", + "994f3e91756d021ddc53736923353d290df1ecb6", "support" ], "cookies/path/echo-cookie.html": [ @@ -202487,7 +202478,7 @@ "support" ], "css-font-loading/OWNERS": [ - "1c7da9a2111a5ae29e856a7e3cf39d09b787bc8c", + "5046d8b1e4fbcb3579ba632d66e81b1cd82384e8", "support" ], "css-font-loading/fontfacesetloadevent-constructor.html": [ @@ -216787,7 +216778,7 @@ "support" ], "css/css-align-3/OWNERS": [ - "9ec022feaa47a8e37265963e8fb34b8564bacec3", + "484c3544ed355f7236875107bbc7d3be3d78a1a4", "support" ], "css/css-align-3/content-distribution/place-content-shorthand-001.html": [ @@ -217107,7 +217098,7 @@ "testharness" ], "css/css-display-3/OWNERS": [ - "658cab9df5724a6d32606a4ac9d5f8827b7f965c", + "26cb5921a61ea01fff54a7e4b35e7929aa5a6cab", "support" ], "css/css-display-3/display-contents-alignment-001-ref.html": [ @@ -217379,7 +217370,7 @@ "reftest" ], "css/css-flexbox-1/OWNERS": [ - "fa800d6b6f797c89129985648dd37073b74f67b1", + "2c986309a6f6f20205e10d7f6f4d6ce95ba580ee", "support" ], "css/css-flexbox-1/align-content-001.htm": [ @@ -220387,7 +220378,7 @@ "reftest" ], "css/css-fonts-3/OWNERS": [ - "282541453b538288e5dfb298f6416f216de8c3f9", + "18aa6fb5e88093cc3ddbe9b22d2b008a3c3a6477", "support" ], "css/css-fonts-3/README": [ @@ -227275,7 +227266,7 @@ "testharness" ], "css/css-grid-1/OWNERS": [ - "6c9e0dd80aabd34d387ee9dd789b9e497bde238e", + "fc9e9f918f431173db81840e4ef61800f1813de3", "support" ], "css/css-grid-1/README.md": [ @@ -228899,7 +228890,7 @@ "visual" ], "css/css-position-3/OWNERS": [ - "d85753a1147da692a42742503b5a87f41c257809", + "8829f3333a5c8aeb31f0a7f4b1378926fc8b4083", "support" ], "css/css-position-3/position-sticky-bottom-ref.html": [ @@ -229151,7 +229142,7 @@ "reftest" ], "css/css-rhythm-1/OWNERS": [ - "5498c55b57270bb257281f8f2076a29a8af28fc4", + "994580f1689c31bd7009470d8c78814509a9e24d", "support" ], "css/css-rhythm-1/line-height-step-basic-001.html": [ @@ -229231,7 +229222,7 @@ "support" ], "css/css-scoping-1/OWNERS": [ - "5498c55b57270bb257281f8f2076a29a8af28fc4", + "c1d28ad0cf09578aaa2ec17b6d33d741b181f982", "support" ], "css/css-scoping-1/css-scoping-shadow-assigned-node-with-before-after.html": [ @@ -229311,7 +229302,7 @@ "testharness" ], "css/css-shapes-1/OWNERS": [ - "2816b29c4a0b7ffbe5f85ee1a6b37b90d85e850f", + "356a6d8ed81bd9bfcb8a55f8e6b349d6f1631d29", "support" ], "css/css-shapes-1/shape-outside-invalid-001.html": [ @@ -230451,7 +230442,7 @@ "support" ], "css/css-tables-3/OWNERS": [ - "d33a4338262c5fec8f3739eb743ff5945743c635", + "2b1ea903cb673cb3de2a105e04b25f49b14edb4a", "support" ], "css/css-tables-3/fixed-layout-calc-width-001.html": [ @@ -234827,7 +234818,7 @@ "reftest" ], "css/css-text-decor-3/OWNERS": [ - "9950f8c6004c6cf725d9fd0cf97581fdf3e3f79f", + "b28556fe458fac65f6a168b98e78597688f32a6e", "support" ], "css/css-text-decor-3/reference/text-decoration-line-010-ref.xht": [ @@ -238379,7 +238370,7 @@ "testharness" ], "css/css-writing-modes-3/OWNERS": [ - "5498c55b57270bb257281f8f2076a29a8af28fc4", + "73bd9fcf99edecee437d90873f66e2698c20778a", "support" ], "css/css-writing-modes-3/abs-pos-non-replaced-icb-vlr-003.xht": [ @@ -244763,7 +244754,7 @@ "support" ], "css/motion-1/OWNERS": [ - "0e64fd27bc1ba213549d690a4a502451fd7dbcb6", + "31ef5b7c36b050e1ce72d5690159a1a62b4ca4c7", "support" ], "css/motion-1/animation/offset-anchor-interpolation.html": [ @@ -244947,7 +244938,7 @@ "support" ], "css/selectors4/OWNERS": [ - "6c9e0dd80aabd34d387ee9dd789b9e497bde238e", + "16d0e08fa9c3f7407757a3efefbd498b609943dd", "support" ], "css/selectors4/focus-display-none-001.html": [ @@ -247463,7 +247454,7 @@ "testharness" ], "cssom-view/OWNERS": [ - "f001bd3dd2a6dac4621ce2625945a700a0de05fb", + "495f99b874611fd8f82f2e33bc4b7d930cc60fde", "support" ], "cssom-view/Screen-pixelDepth-Screen-colorDepth001.html": [ @@ -247919,7 +247910,7 @@ "testharness" ], "cssom/OWNERS": [ - "f001bd3dd2a6dac4621ce2625945a700a0de05fb", + "495f99b874611fd8f82f2e33bc4b7d930cc60fde", "support" ], "cssom/StyleSheetList.html": [ @@ -248347,7 +248338,7 @@ "testharness" ], "custom-elements/OWNERS": [ - "ec531b802267d143e906b5839babe398104fd507", + "50afc6ea94c38b8a8954223c54866ca9ee19d127", "support" ], "custom-elements/adopted-callback.html": [ @@ -248559,7 +248550,7 @@ "testharness" ], "dom/OWNERS": [ - "f65959b214bfcfa26a30375855c215bd07b03be6", + "507f3da20e8424e7979e9fe53acc9c611fb87048", "support" ], "dom/abort/event.any-expected.txt": [ @@ -250243,7 +250234,7 @@ "testharness" ], "domparsing/OWNERS": [ - "ec531b802267d143e906b5839babe398104fd507", + "257bd1df096a742b65ba1fd7ebb28c6d0e856182", "support" ], "domparsing/XMLSerializer-serializeToString.html": [ @@ -250339,7 +250330,7 @@ "testharness" ], "domxpath/OWNERS": [ - "ec531b802267d143e906b5839babe398104fd507", + "257bd1df096a742b65ba1fd7ebb28c6d0e856182", "support" ], "domxpath/evaluator-constructor.html": [ @@ -250359,7 +250350,7 @@ "support" ], "editing/OWNERS": [ - "85142cf2aa281150780822bc8ccde5622e9f0669", + "70bdfcdadc33b9a0b6484003f8bb7bfa551da854", "support" ], "editing/README": [ @@ -253899,7 +253890,7 @@ "support" ], "fullscreen/OWNERS": [ - "80579a1e88af8e60c7446f34446b90bd3e9cf8c7", + "e44bfebe003740cd4a9fa5aabdae87eafe1a8449", "support" ], "fullscreen/api/document-exit-fullscreen-active-document-expected.txt": [ @@ -254299,7 +254290,7 @@ "testharness" ], "html-imports/OWNERS": [ - "ec531b802267d143e906b5839babe398104fd507", + "e789c2e446f210127f9aefeab4f92286c1c43f1d", "support" ], "html-imports/document/OWNERS": [ @@ -254447,7 +254438,7 @@ "support" ], "html/OWNERS": [ - "ec531b802267d143e906b5839babe398104fd507", + "03490d8952b9e28752778cf98c4be3e7724a8b32", "support" ], "html/README.md": [ @@ -271167,7 +271158,7 @@ "support" ], "imagebitmap-renderingcontext/OWNERS": [ - "2df4accfcd4bf31567eaf545e056469356f2529e", + "88028065ecd152d7a46a9afcf3c4748f36797f1e", "support" ], "imagebitmap-renderingcontext/bitmaprenderer-as-imagesource.html": [ @@ -271383,7 +271374,7 @@ "reftest" ], "innerText/OWNERS": [ - "ec531b802267d143e906b5839babe398104fd507", + "03490d8952b9e28752778cf98c4be3e7724a8b32", "support" ], "innerText/getter-expected.txt": [ @@ -271487,7 +271478,7 @@ "support" ], "intersection-observer/OWNERS": [ - "07cfdac77da6238b2aa55e268a1964a4bc789b67", + "dc52b7ff711a8b5c1237d9af34d21e0e2bc6e548", "support" ], "intersection-observer/bounding-box.html": [ @@ -272575,7 +272566,7 @@ "testharness" ], "mixed-content/OWNERS": [ - "94afa6a10c171843007f8e7fd96246af9060f79d", + "92c98aab901060d502f9b9bf70114a31bdab3511", "support" ], "mixed-content/allowed/http-csp/same-host-https/audio-tag/top-level/keep-scheme-redirect/allowed.https-expected.txt": [ @@ -274571,7 +274562,7 @@ "manual" ], "offscreen-canvas/OWNERS": [ - "2df4accfcd4bf31567eaf545e056469356f2529e", + "88028065ecd152d7a46a9afcf3c4748f36797f1e", "support" ], "offscreen-canvas/compositing/2d.composite.canvas.copy.html": [ @@ -282079,7 +282070,7 @@ "testharness" ], "referrer-policy/OWNERS": [ - "c1d672027b8c6585b87318f93454201bbcd23389", + "63b3e43c43b6b4265493ad7fad88c4af6ad3d4b6", "support" ], "referrer-policy/README.md": [ @@ -289879,7 +289870,7 @@ "testharness" ], "secure-contexts/OWNERS": [ - "94afa6a10c171843007f8e7fd96246af9060f79d", + "8192f07581fe6d258c8b404d2a436e00b50fb459", "support" ], "secure-contexts/basic-dedicated-worker.html": [ @@ -289963,7 +289954,7 @@ "testharness" ], "selection/OWNERS": [ - "85142cf2aa281150780822bc8ccde5622e9f0669", + "d7659fcef140be6c17542282cd274b808c1efc2b", "support" ], "selection/addRange-00.html": [ @@ -290131,7 +290122,7 @@ "testharness" ], "selectors/OWNERS": [ - "f001bd3dd2a6dac4621ce2625945a700a0de05fb", + "495f99b874611fd8f82f2e33bc4b7d930cc60fde", "support" ], "selectors/attribute-selectors/attribute-case/cssom.html": [ @@ -292479,7 +292470,7 @@ "testharness" ], "shadow-dom/OWNERS": [ - "f65959b214bfcfa26a30375855c215bd07b03be6", + "06f179392138b01e05e006d44496e5cfdc9626a8", "support" ], "shadow-dom/Range-prototype-insertNode.html": [ @@ -293875,7 +293866,7 @@ "testharness" ], "subresource-integrity/OWNERS": [ - "d4e1d12d4448a88b60d4799c52c27e09ee497678", + "6744fc5aaf9c3238370daa2c2d68c97cd9cfaf8e", "support" ], "subresource-integrity/alternate.css": [ @@ -295063,7 +295054,7 @@ "testharness" ], "web-animations/OWNERS": [ - "62fad523f42425a21ec99779976417195a611e6a", + "4725570730034e4d9b66695acfcfa7b246c79311", "support" ], "web-animations/README.md": [ @@ -295871,7 +295862,7 @@ "testharness" ], "webauthn/OWNERS": [ - "6097207a883322b95dae0cf2010baf9dde83c4cd", + "832fb99e215923e9d102f48f2a0cd06ea11ff86b", "support" ], "webauthn/helpers.js": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm b/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm new file mode 100644 index 0000000..5c647df --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-allow-origin-null.htm
@@ -0,0 +1,32 @@ +<!DOCTYPE html> +<html> + <head> + <title>Tests that sandboxed iframe has CORS XHR access to a server that accepts null domain</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + </head> + <body> + <script type="text/javascript"> +async_test((test) => { + window.addEventListener("message", test.step_func((evt) => { + if (evt.data === "ready") { + document.getElementById("frame").contentWindow.postMessage( + get_host_info().HTTP_ORIGIN + + "/XMLHttpRequest/resources/pass.txt?pipe=" + + "header(Cache-Control,no-store)|" + + "header(Content-Type,text/plain)|" + + "header(Access-Control-Allow-Credentials,true)|" + + "header(Access-Control-Allow-External,true)|" + + "header(Access-Control-Allow-Origin,null)", "*"); + } else { + assert_equals(evt.data.trim(), "PASS"); + test.done(); + } + }), false); +}); + </script> + <iframe id="frame" sandbox="allow-scripts" src="/XMLHttpRequest/resources/access-control-sandboxed-iframe.html"> + </iframe> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied.htm b/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied.htm new file mode 100644 index 0000000..a87dd7d1 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/XMLHttpRequest/access-control-sandboxed-iframe-denied.htm
@@ -0,0 +1,41 @@ +<!DOCTYPE html> +<html> + <head> + <title>Tests that sandboxed iframe does not have CORS XHR access to its server</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <script src="/common/get-host-info.sub.js"></script> + </head> + <body> + <script type="text/javascript"> +const path = "/XMLHttpRequest/resources/pass.txt?pipe=" + + "header(Cache-Control,no-store)|" + + "header(Content-Type,text/plain)"; + +async_test((test) => { + const xhr = new XMLHttpRequest; + xhr.open("GET", get_host_info().HTTP_ORIGIN + path); + xhr.send(); + xhr.onerror = test.unreached_func("Unexpected error"); + xhr.onload = test.step_func_done(() => { + assert_equals(xhr.status, 200); + assert_equals(xhr.responseText.trim(), "PASS"); + }); +}, "Check that path exists and is accessible via local XHR request"); + +async_test((test) => { + window.addEventListener("message", test.step_func((evt) => { + if (evt.data === "ready") { + document.getElementById("frame").contentWindow.postMessage( + get_host_info().HTTP_ORIGIN + path, "*"); + } else { + assert_equals(evt.data, "Exception thrown. Sandboxed iframe XHR access was denied in 'send'."); + test.done(); + } + }), false); +}, "Sandboxed iframe is denied access to path"); + </script> + <iframe id="frame" sandbox="allow-scripts" src="/XMLHttpRequest/resources/access-control-sandboxed-iframe.html"> + </iframe> + </body> +</html>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-backgrounds/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css-backgrounds/OWNERS new file mode 100644 index 0000000..7c1ec12 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-backgrounds/OWNERS
@@ -0,0 +1,2 @@ +# TEAM: layout-dev@chromium.org +# COMPONENT: Blink>Layout
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-cascade/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css-cascade/OWNERS new file mode 100644 index 0000000..ada3963 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-cascade/OWNERS
@@ -0,0 +1,2 @@ +# TEAM: style-dev@chromium.org +# COMPONENT: Blink>CSS
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-fonts/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/OWNERS new file mode 100644 index 0000000..051418f --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-fonts/OWNERS
@@ -0,0 +1,3 @@ +# TEAM: layout-dev@chromium.org +# COMPONENT: Blink>Fonts +drott@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/OWNERS new file mode 100644 index 0000000..44ba718 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-paint-api/OWNERS
@@ -0,0 +1 @@ +file://third_party/WebKit/Source/modules/csspaint/OWNERS
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-scoping/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css-scoping/OWNERS new file mode 100644 index 0000000..ada3963 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-scoping/OWNERS
@@ -0,0 +1,2 @@ +# TEAM: style-dev@chromium.org +# COMPONENT: Blink>CSS
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-timing/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css-timing/OWNERS new file mode 100644 index 0000000..ada3963 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-timing/OWNERS
@@ -0,0 +1,2 @@ +# TEAM: style-dev@chromium.org +# COMPONENT: Blink>CSS
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css-typed-om/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css-typed-om/OWNERS new file mode 100644 index 0000000..ada3963 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css-typed-om/OWNERS
@@ -0,0 +1,2 @@ +# TEAM: style-dev@chromium.org +# COMPONENT: Blink>CSS
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-text-3/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css/css-text-3/OWNERS new file mode 100644 index 0000000..7c1ec12 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-text-3/OWNERS
@@ -0,0 +1,2 @@ +# TEAM: layout-dev@chromium.org +# COMPONENT: Blink>Layout
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui-3/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui-3/OWNERS index 5e03d9bc..2564ee5b 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui-3/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui-3/OWNERS
@@ -1 +1,3 @@ +# TEAM: layout-dev@chromium.org +# COMPONENT: Blink>Layout rego@igalia.com
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-ui-4/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui-4/OWNERS new file mode 100644 index 0000000..2564ee5b --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-ui-4/OWNERS
@@ -0,0 +1,3 @@ +# TEAM: layout-dev@chromium.org +# COMPONENT: Blink>Layout +rego@igalia.com
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-handler/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/payment-handler/OWNERS new file mode 100644 index 0000000..f9ef135 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-handler/OWNERS
@@ -0,0 +1,4 @@ +# TEAM: paymentrequest@google.com +# COMPONENT: Blink>Payments +jinho.bang@samsung.com +rouslan@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-method-id/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/payment-method-id/OWNERS new file mode 100644 index 0000000..c697d47 --- /dev/null +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-method-id/OWNERS
@@ -0,0 +1,3 @@ +# TEAM: paymentrequest@google.com +# COMPONENT: Blink>Payments +rouslan@chromium.org
diff --git a/third_party/WebKit/LayoutTests/external/wpt/payment-request/OWNERS b/third_party/WebKit/LayoutTests/external/wpt/payment-request/OWNERS index 5725770..28809db 100644 --- a/third_party/WebKit/LayoutTests/external/wpt/payment-request/OWNERS +++ b/third_party/WebKit/LayoutTests/external/wpt/payment-request/OWNERS
@@ -1,2 +1,4 @@ +# TEAM: paymentrequest@google.com +# COMPONENT: Blink>Payments rouslan@chromium.org mathp@chromium.org
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null-expected.txt deleted file mode 100644 index 5b96c8d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 10: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. -This test verifies that sandboxed iframe has XmlHttpRequest access to the server that accepts all domains. It will print "PASS" on success. - - - --------- -Frame: '<!--framePath //<!--frame0-->-->' --------- -PASS: Sandboxed iframe XHR access allowed. -
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html deleted file mode 100644 index 7636cce..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-allow-origin-null.html +++ /dev/null
@@ -1,18 +0,0 @@ -<html> -<script> - -if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.dumpChildFramesAsText(); -} - -</script> -<body> - <p>This test verifies that sandboxed iframe has XmlHttpRequest access - to the server that accepts all domains. It will print "PASS" on success.</p> - - <iframe sandbox="allow-scripts" src="http://127.0.0.1:8000/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null-iframe.html" style="width: 500px;"> - </iframe> - -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-expected.txt b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-expected.txt deleted file mode 100644 index fef2dc4..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 11: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/. -CONSOLE ERROR: line 17: Failed to load http://127.0.0.1:8000/xmlhttprequest/resources/access-control-sandboxed-iframe-denied.cgi: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. -This test verifies that sandboxed iframe does not have XmlHttpRequest access to its server. It will print "PASS" on success. - - - --------- -Frame: '<!--framePath //<!--frame0-->-->' --------- -PASS: Exception thrown. Sandboxed iframe XHR access was denied in 'send'. [Failed to execute 'send' on 'XMLHttpRequest': Failed to load 'http://127.0.0.1:8000/xmlhttprequest/resources/access-control-sandboxed-iframe-denied.cgi'.].
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied.html deleted file mode 100644 index d267efb3d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied.html +++ /dev/null
@@ -1,19 +0,0 @@ -<html> -<script> - -if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.dumpChildFramesAsText(); -} - -</script> - -<body> - <p>This test verifies that sandboxed iframe does not have XmlHttpRequest access - to its server. It will print "PASS" on success.</p> - - <iframe sandbox="allow-scripts" - src="http://127.0.0.1:8000/xmlhttprequest/resources/access-control-sandboxed-iframe-denied-iframe.html" style="width: 500px;"> - </iframe> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null-iframe.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null-iframe.html deleted file mode 100644 index faff98ba..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null-iframe.html +++ /dev/null
@@ -1,25 +0,0 @@ -<html> -<body> -<pre id='console'></pre> -<script type="text/javascript"> - -document.getElementById('console').innerHTML = (function() { - var xhr = new XMLHttpRequest; - - try { - xhr.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null.cgi", false); - } catch(e) { - return "FAIL: Exception thrown. Sandboxed iframe XHR access is not allowed in 'open'. [" + e.message + "]."; - } - - try { - xhr.send(); - } catch(e) { - return "FAIL: Exception thrown. Sandboxed iframe XHR access is not allowed in 'send'. [" + e.message + "]."; - } - - return xhr.responseText; -})(); -</script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null.cgi b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null.cgi deleted file mode 100755 index 4c91562..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-allow-origin-null.cgi +++ /dev/null
@@ -1,9 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/plain\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: null\n"; -print "Access-Control-Allow-External: true\n\n"; - -print "PASS: Sandboxed iframe XHR access allowed.\n";
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-denied-iframe.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-denied-iframe.html deleted file mode 100644 index 1e91e0d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-denied-iframe.html +++ /dev/null
@@ -1,27 +0,0 @@ -<html> -<body> -<pre id='console'></pre> -<script type="text/javascript"> - -document.getElementById('console').innerHTML = (function() { - var xhr = new XMLHttpRequest; - - - try { - xhr.open("GET", "http://127.0.0.1:8000/xmlhttprequest/resources/access-control-sandboxed-iframe-denied.cgi", false); - } catch(e) { - return "FAIL: Exception thrown. Sandboxed iframe XHR access is not allowed in 'open'. [" + e.message + "]."; - } - - try { - xhr.send(); - } catch(e) { - return "PASS: Exception thrown. Sandboxed iframe XHR access was denied in 'send'. [" + e.message + "]."; - } - - return xhr.responseText; -})(); - -</script> -</body> -</html>
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-denied.cgi b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-denied.cgi deleted file mode 100755 index c59c413d..0000000 --- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/access-control-sandboxed-iframe-denied.cgi +++ /dev/null
@@ -1,6 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/plain\n\n"; - -print "FAIL: Sandboxed iframe XHR access allowed.\n";
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt index 7fae45be..fdb1fe3 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/file/file-input-direction-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 800x600 scrollWidth 971 +layer at (0,0) size 800x600 scrollWidth 970 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt index 04a7c46..3cba908 100644 --- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/file/file-input-direction-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 800x600 scrollWidth 1071 +layer at (0,0) size 800x600 scrollWidth 1070 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt index d4e58e5..5f8b2b6f 100644 --- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt +++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/file/file-input-direction-expected.txt
@@ -1,4 +1,4 @@ -layer at (0,0) size 800x600 scrollWidth 1067 +layer at (0,0) size 800x600 scrollWidth 1066 LayoutView at (0,0) size 800x600 layer at (0,0) size 800x600 LayoutBlockFlow {HTML} at (0,0) size 800x600
diff --git a/third_party/WebKit/Source/bindings/core/v8/BUILD.gn b/third_party/WebKit/Source/bindings/core/v8/BUILD.gn index e2a7500..4957786 100644 --- a/third_party/WebKit/Source/bindings/core/v8/BUILD.gn +++ b/third_party/WebKit/Source/bindings/core/v8/BUILD.gn
@@ -135,7 +135,7 @@ bindings_core_generated_interface_files = [ "$bindings_core_v8_output_dir/V8GeneratedCoreBindings.cpp" ] } else { - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { bindings_core_generated_interface_files = process_file_template( core_definition_idl_files, @@ -199,7 +199,7 @@ # |core_dictionary_idl_files| and |core_testing_dictionary_idl_files|, we need # to do some manual processing because the generated files are used in # different targets. -if (bindings_generate_snake_case_files) { +if (snake_case_source_files) { generated_core_testing_dictionary_files = process_file_template( core_testing_dictionary_idl_files,
diff --git a/third_party/WebKit/Source/bindings/modules/v8/BUILD.gn b/third_party/WebKit/Source/bindings/modules/v8/BUILD.gn index 7637023..44276f8b0 100644 --- a/third_party/WebKit/Source/bindings/modules/v8/BUILD.gn +++ b/third_party/WebKit/Source/bindings/modules/v8/BUILD.gn
@@ -39,7 +39,7 @@ sources = core_idl_with_modules_dependency_files output_dir = bindings_modules_v8_output_dir output_name_suffix = "Partial" - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { output_name_suffix = "_partial" } target_component = "modules" @@ -49,7 +49,7 @@ sources = webcore_testing_idl_with_modules_dependency_files output_dir = bindings_modules_v8_output_dir output_name_suffix = "Partial" - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { output_name_suffix = "_partial" } target_component = "modules"
diff --git a/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py b/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py index 12db7fc..5619f48e 100755 --- a/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py +++ b/third_party/WebKit/Source/bindings/scripts/aggregate_generated_bindings.py
@@ -91,7 +91,7 @@ parser.add_option('--component') # TODO(tkent): Remove the option after the great mv. crbug.com/760462 parser.add_option('--snake-case-generated-files', - action="store_true", default=False) + action='store_true', default=False) options, args = parser.parse_args() if len(args) < 2:
diff --git a/third_party/WebKit/Source/bindings/scripts/code_generator.py b/third_party/WebKit/Source/bindings/scripts/code_generator.py index c9d7946..c57ac4a 100644 --- a/third_party/WebKit/Source/bindings/scripts/code_generator.py +++ b/third_party/WebKit/Source/bindings/scripts/code_generator.py
@@ -108,8 +108,8 @@ def render_template(template, context): filename = str(template.filename) - filename = filename[filename.rfind("third_party"):] - context["jinja_template_filename"] = filename + filename = filename[filename.rfind('third_party'):] + context['jinja_template_filename'] = filename return template.render(context)
diff --git a/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py b/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py index 5fa475d8..e0977ce 100755 --- a/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py +++ b/third_party/WebKit/Source/bindings/scripts/generate_conditional_features.py
@@ -38,12 +38,12 @@ be installed on those interfaces. """ return [ - {"condition": 'OriginTrials::%sEnabled' % uncapitalize(feature_name), - "name": feature_name, - "install_method": "install%s" % feature_name, - "interface_is_global": interface_info.is_global, - "v8_class": interface_info.v8_class, - "v8_class_or_partial": interface_info.v8_class_or_partial} + {'condition': 'OriginTrials::%sEnabled' % uncapitalize(feature_name), + 'name': feature_name, + 'install_method': 'install%s' % feature_name, + 'interface_is_global': interface_info.is_global, + 'v8_class': interface_info.v8_class, + 'v8_class_or_partial': interface_info.v8_class_or_partial} for feature_name in feature_names for interface_info in interfaces] @@ -149,34 +149,34 @@ # Add includes needed for cpp code and normalize. includes.update([ - "core/context_features/ContextFeatureSettings.h", - "core/dom/ExecutionContext.h", - "core/frame/Frame.h", - "core/origin_trials/OriginTrials.h", - "platform/bindings/ConditionalFeatures.h", - "platform/bindings/ScriptState.h", + 'core/context_features/ContextFeatureSettings.h', + 'core/dom/ExecutionContext.h', + 'core/frame/Frame.h', + 'core/origin_trials/OriginTrials.h', + 'platform/bindings/ConditionalFeatures.h', + 'platform/bindings/ScriptState.h', # TODO(iclelland): Remove the need to explicitly include this; it is # here because the ContextFeatureSettings code needs it. - "bindings/core/v8/V8Window.h", + 'bindings/core/v8/V8Window.h', ]) context['includes'] = normalize_and_sort_includes(includes) # For each interface, collect a list of bindings installation functions to # call, organized by conditional feature. context['installers_by_interface'] = [ - {"name": interface_info.name, - "is_global": interface_info.is_global, - "v8_class": interface_info.v8_class, - "installers": get_install_functions([interface_info], feature_names)} + {'name': interface_info.name, + 'is_global': interface_info.is_global, + 'v8_class': interface_info.v8_class, + 'installers': get_install_functions([interface_info], feature_names)} for interface_info, feature_names in features_for_type.items()] context['installers_by_interface'].sort(key=lambda x: x['name']) # For each conditional feature, collect a list of bindings installation # functions to call, organized by interface. context['installers_by_feature'] = [ - {"name": feature_name, - "name_constant": "OriginTrials::k%sTrialName" % feature_name, - "installers": get_install_functions(interfaces, [feature_name])} + {'name': feature_name, + 'name_constant': 'OriginTrials::k%sTrialName' % feature_name, + 'installers': get_install_functions(interfaces, [feature_name])} for feature_name, interfaces in types_for_feature.items()] context['installers_by_feature'].sort(key=lambda x: x['name']) @@ -217,16 +217,16 @@ # Generate and write out the header file header_text = render_template(jinja_env.get_template( - "ConditionalFeaturesFor%s.h.tmpl" % options.target_component.title()), template_context) + 'ConditionalFeaturesFor%s.h.tmpl' % options.target_component.title()), template_context) header_path = posixpath.join(options.output_directory, - "ConditionalFeaturesFor%s.h" % options.target_component.title()) + 'ConditionalFeaturesFor%s.h' % options.target_component.title()) write_file(header_text, header_path) # Generate and write out the implementation file cpp_text = render_template(jinja_env.get_template( - "ConditionalFeaturesFor%s.cpp.tmpl" % options.target_component.title()), template_context) + 'ConditionalFeaturesFor%s.cpp.tmpl' % options.target_component.title()), template_context) cpp_path = posixpath.join(options.output_directory, - "ConditionalFeaturesFor%s.cpp" % options.target_component.title()) + 'ConditionalFeaturesFor%s.cpp' % options.target_component.title()) write_file(cpp_text, cpp_path)
diff --git a/third_party/WebKit/Source/bindings/scripts/generate_event_interfaces.py b/third_party/WebKit/Source/bindings/scripts/generate_event_interfaces.py index 116c0a4..5cc29ae6 100755 --- a/third_party/WebKit/Source/bindings/scripts/generate_event_interfaces.py +++ b/third_party/WebKit/Source/bindings/scripts/generate_event_interfaces.py
@@ -45,7 +45,9 @@ import posixpath import sys -from utilities import get_file_contents, read_file_to_list, write_file, get_interface_extended_attributes_from_idl +from utilities import (get_file_contents, get_first_interface_name_from_idl, + read_file_to_list, write_file, + get_interface_extended_attributes_from_idl) EXPORTED_EXTENDED_ATTRIBUTES = ( 'ImplementedAs', @@ -73,17 +75,19 @@ def write_event_interfaces_file(event_idl_files, destination_filename, suffix): def interface_line(full_path): - relative_path_local, _ = os.path.splitext(os.path.relpath(full_path, source_dir)) - relative_path_posix = relative_path_local.replace(os.sep, posixpath.sep) + relative_dir_local = os.path.dirname(os.path.relpath(full_path, source_dir)) + relative_dir_posix = relative_dir_local.replace(os.sep, posixpath.sep) idl_file_contents = get_file_contents(full_path) + interface_name = get_first_interface_name_from_idl(idl_file_contents) extended_attributes = get_interface_extended_attributes_from_idl(idl_file_contents) extended_attributes_list = [ (name, extended_attributes[name]) for name in EXPORTED_EXTENDED_ATTRIBUTES if name in extended_attributes] - return (relative_path_posix, extended_attributes_list) + return (posixpath.join(relative_dir_posix, interface_name), + extended_attributes_list) lines = [ '{',
diff --git a/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py b/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py index 906de72..0544d47e 100755 --- a/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py +++ b/third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py
@@ -40,8 +40,11 @@ def parse_options(): usage = 'Usage: %prog [options]' parser = OptionParser(usage=usage) - parser.add_option('--idl-files-list', help="a text file containing the IDL file paths, so the command line doesn't exceed OS length limits.") - parser.add_option('--gyp-format-list', default=False, action='store_true', help="if specified, idl-files-list is newline separated. When unspecified, it's formatted as a Posix command line.") + parser.add_option('--idl-files-list', + help='a text file containing the IDL file paths, so the command line doesn\'t exceed OS length limits.') + parser.add_option('--gyp-format-list', default=False, action='store_true', + help='if specified, idl-files-list is newline separated. ' + + 'When unspecified, it\'s formatted as a Posix command line.') parser.add_option('--output') options, args = parser.parse_args()
diff --git a/third_party/WebKit/Source/bindings/scripts/generate_v8_context_snapshot_external_references.py b/third_party/WebKit/Source/bindings/scripts/generate_v8_context_snapshot_external_references.py index 16f6cad..3c13bacf 100644 --- a/third_party/WebKit/Source/bindings/scripts/generate_v8_context_snapshot_external_references.py +++ b/third_party/WebKit/Source/bindings/scripts/generate_v8_context_snapshot_external_references.py
@@ -55,7 +55,7 @@ help='cache directory') parser.add_argument('--target-component', type=str, required=True, help='target component') - parser.add_argument('--snake-case-generated-files', action="store_true", + parser.add_argument('--snake-case-generated-files', action='store_true', default=False) return parser.parse_known_args()
diff --git a/third_party/WebKit/Source/bindings/scripts/idl_compiler.py b/third_party/WebKit/Source/bindings/scripts/idl_compiler.py index 7cf0863..accd4570 100755 --- a/third_party/WebKit/Source/bindings/scripts/idl_compiler.py +++ b/third_party/WebKit/Source/bindings/scripts/idl_compiler.py
@@ -52,10 +52,10 @@ parser.add_option('--cache-directory', help='cache directory, defaults to output directory') parser.add_option('--generate-impl', - action="store_true", default=False) + action='store_true', default=False) # TODO(tkent): Remove the option after the great mv. crbug.com/760462 parser.add_option('--snake-case-generated-files', - action="store_true", default=False) + action='store_true', default=False) parser.add_option('--read-idl-list-from-file', action='store_true', default=False) parser.add_option('--output-directory')
diff --git a/third_party/WebKit/Source/bindings/scripts/scripts.gni b/third_party/WebKit/Source/bindings/scripts/scripts.gni index 9cb8fa0..bf0d799 100644 --- a/third_party/WebKit/Source/bindings/scripts/scripts.gni +++ b/third_party/WebKit/Source/bindings/scripts/scripts.gni
@@ -5,9 +5,6 @@ import("//third_party/WebKit/Source/core/core_idl_files.gni") import("//third_party/WebKit/Source/modules/modules_idl_files.gni") -# TODO(tkent): Remove this flag after the great mv. crbug.com/760462 -bindings_generate_snake_case_files = false - bindings_scripts_dir = get_path_info(".", "abspath") bindings_scripts_output_dir = "$root_gen_dir/blink/bindings/scripts" @@ -92,7 +89,7 @@ "--component-info-file", rebase_path(invoker.component_info_file, root_build_dir), ] - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { args += [ "--snake-case-generated-files" ] } @@ -204,7 +201,7 @@ outputs = [] foreach(_source, sources) { _name_part = get_path_info(_source, "name") - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { outputs += [ "$output_dir/v8_${_name_part}${output_name_suffix}.cc", "$output_dir/v8_${_name_part}${output_name_suffix}.h", @@ -233,7 +230,7 @@ "--read-idl-list-from-file", rebase_path(idl_files_list, root_build_dir), ] - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { args += [ "--snake-case-generated-files" ] } } @@ -244,7 +241,7 @@ public_deps = _public_deps sources = invoker.sources - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { outputs = [ "$output_dir/v8_{{source_name_part}}${output_name_suffix}.cc", "$output_dir/v8_{{source_name_part}}${output_name_suffix}.h", @@ -267,7 +264,7 @@ invoker.target_component, "{{source}}", ] - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { args += [ "--snake-case-generated-files" ] } } @@ -331,7 +328,7 @@ "--generate-impl", rebase_path(idl_files_list, root_build_dir), ] - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { args += [ "--snake-case-generated-files" ] } @@ -366,7 +363,7 @@ invoker.component, "{{response_file_name}}", ] - if (bindings_generate_snake_case_files) { + if (snake_case_source_files) { args += [ "--snake-case-generated-files" ] } args += rebase_path(outputs, root_build_dir)
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_types.py b/third_party/WebKit/Source/bindings/scripts/v8_types.py index a944265..adb463a 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_types.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_types.py
@@ -243,7 +243,7 @@ if idl_type.is_nullable: return idl_type.inner_type.name return idl_type.name - idl_type_name = "Or".join(member_cpp_name(member) + idl_type_name = 'Or'.join(member_cpp_name(member) for member in idl_type.member_types) return 'const %s&' % idl_type_name if used_as_rvalue_type else idl_type_name if idl_type.is_callback_function: @@ -608,11 +608,11 @@ if 'FlexibleArrayBufferView' in extended_attributes: if base_idl_type not in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES: - raise ValueError("Unrecognized base type for extended attribute 'FlexibleArrayBufferView': %s" % (idl_type.base_type)) + raise ValueError('Unrecognized base type for extended attribute "FlexibleArrayBufferView": %s' % (idl_type.base_type)) base_idl_type = 'FlexibleArrayBufferView' if 'AllowShared' in extended_attributes and not idl_type.is_array_buffer_view_or_typed_array: - raise ValueError("Unrecognized base type for extended attribute 'AllowShared': %s" % (idl_type.base_type)) + raise ValueError('Unrecognized base type for extended attribute "AllowShared": %s' % (idl_type.base_type)) if idl_type.is_integer_type: configuration = 'kNormalConversion' @@ -696,7 +696,7 @@ if 'FlexibleArrayBufferView' in extended_attributes: if idl_type.base_type not in ARRAY_BUFFER_VIEW_AND_TYPED_ARRAY_TYPES: - raise ValueError("Unrecognized base type for extended attribute 'FlexibleArrayBufferView': %s" % (idl_type.base_type)) + raise ValueError('Unrecognized base type for extended attribute "FlexibleArrayBufferView": %s' % (idl_type.base_type)) set_expression = cpp_value elif idl_type.is_string_type or idl_type.v8_conversion_needs_exception_state: # Types for which conversion can fail and that need error handling.
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py index 39e91533..4245918 100644 --- a/third_party/WebKit/Source/bindings/scripts/v8_utilities.py +++ b/third_party/WebKit/Source/bindings/scripts/v8_utilities.py
@@ -336,7 +336,7 @@ """Returns C++ code that checks whether an interface/method/attribute/etc. is exposed to the current context.""" if 'SecureContext' in member.extended_attributes or 'SecureContext' in interface.extended_attributes: - return "executionContext->IsSecureContext()" + return 'executionContext->IsSecureContext()' return None
diff --git a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl index 837b6a5..faa1286 100644 --- a/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl +++ b/third_party/WebKit/Source/bindings/templates/attributes.cpp.tmpl
@@ -377,9 +377,7 @@ if (!result) return; {% else %}{# attribute.is_put_forwards #} - {% if attribute.is_custom_element_callbacks or - (attribute.is_reflect and not (attribute.idl_type == 'DOMString' and is_node)) %} - // Skip on compact node DOMString getters. + {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; {% endif %} @@ -497,10 +495,6 @@ CEReactionsScope ceReactionsScope; {% endif %} - {% if attribute.is_custom_element_callbacks or attribute.is_reflect %} - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - {% endif %} - {% if attribute.has_custom_setter %} {{v8_class}}::{{attribute.name}}AttributeSetterCustom(v8Value, info); {% elif attribute.has_cross_origin_setter %}
diff --git a/third_party/WebKit/Source/bindings/tests/idls/core/TestIntegerIndexed.idl b/third_party/WebKit/Source/bindings/tests/idls/core/TestIntegerIndexed.idl index ddc9d20..606bf126 100644 --- a/third_party/WebKit/Source/bindings/tests/idls/core/TestIntegerIndexed.idl +++ b/third_party/WebKit/Source/bindings/tests/idls/core/TestIntegerIndexed.idl
@@ -12,5 +12,7 @@ [Custom] setter Node (DOMString name, Node value); [Custom] deleter boolean (DOMString name); + iterable <[Clamp] long, DOMString>; + void voidMethodDocument(Document document); };
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp index e73a24d7..9fc1cce 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8SVGTestInterface.cpp
@@ -85,7 +85,6 @@ SVGTestInterface* impl = V8SVGTestInterface::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -109,8 +108,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - SVGTestInterfaceV8Internal::typeAttributeSetter(v8Value, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp index f7457e63..cd499440 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.cpp
@@ -14,11 +14,14 @@ #include "bindings/core/v8/ExceptionState.h" #include "bindings/core/v8/IDLTypes.h" #include "bindings/core/v8/NativeValueTraitsImpl.h" +#include "bindings/core/v8/ScriptValue.h" #include "bindings/core/v8/V8DOMConfiguration.h" #include "bindings/core/v8/V8Document.h" +#include "bindings/core/v8/V8Iterator.h" #include "bindings/core/v8/V8Node.h" #include "core/dom/ExecutionContext.h" #include "platform/bindings/RuntimeCallStats.h" +#include "platform/bindings/ScriptState.h" #include "platform/bindings/V8ObjectConstructor.h" #include "platform/wtf/GetPtr.h" #include "platform/wtf/RefPtr.h" @@ -114,6 +117,63 @@ impl->voidMethodDocument(document); } +static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestIntegerIndexed", "keys"); + + TestIntegerIndexed* impl = V8TestIntegerIndexed::ToImpl(info.Holder()); + + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); + + Iterator* result = impl->keysForBinding(scriptState, exceptionState); + if (exceptionState.HadException()) { + return; + } + V8SetReturnValue(info, result); +} + +static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestIntegerIndexed", "values"); + + TestIntegerIndexed* impl = V8TestIntegerIndexed::ToImpl(info.Holder()); + + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); + + Iterator* result = impl->valuesForBinding(scriptState, exceptionState); + if (exceptionState.HadException()) { + return; + } + V8SetReturnValue(info, result); +} + +static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "TestIntegerIndexed", "forEach"); + + TestIntegerIndexed* impl = V8TestIntegerIndexed::ToImpl(info.Holder()); + + ScriptState* scriptState = ScriptState::ForRelevantRealm(info); + + if (UNLIKELY(info.Length() < 1)) { + exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments(1, info.Length())); + return; + } + + ScriptValue callback; + ScriptValue thisArg; + if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable())) { + exceptionState.ThrowTypeError("The callback provided as parameter 1 is not a function."); + + return; + } + callback = ScriptValue(ScriptState::Current(info.GetIsolate()), info[0]); + + thisArg = ScriptValue(ScriptState::Current(info.GetIsolate()), info[1]); + + impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()), callback, thisArg, exceptionState); + if (exceptionState.HadException()) { + return; + } +} + static void indexedPropertyDescriptor(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) { // https://heycam.github.io/webidl/#LegacyPlatformObjectGetOwnProperty // Steps 1.1 to 1.2.4 are covered here: we rely on indexedPropertyGetter() to @@ -159,6 +219,24 @@ TestIntegerIndexedV8Internal::voidMethodDocumentMethod(info); } +void V8TestIntegerIndexed::keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_keys"); + + TestIntegerIndexedV8Internal::keysMethod(info); +} + +void V8TestIntegerIndexed::valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_values"); + + TestIntegerIndexedV8Internal::valuesMethod(info); +} + +void V8TestIntegerIndexed::forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { + RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_forEach"); + + TestIntegerIndexedV8Internal::forEachMethod(info); +} + void V8TestIntegerIndexed::namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) { RUNTIME_CALL_TIMER_SCOPE_DISABLED_BY_DEFAULT(info.GetIsolate(), "Blink_TestIntegerIndexed_NamedPropertyGetter"); @@ -247,6 +325,9 @@ static const V8DOMConfiguration::MethodConfiguration V8TestIntegerIndexedMethods[] = { {"voidMethodDocument", V8TestIntegerIndexed::voidMethodDocumentMethodCallback, 1, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, + {"keys", V8TestIntegerIndexed::keysMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, + {"values", V8TestIntegerIndexed::valuesMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, + {"forEach", V8TestIntegerIndexed::forEachMethodCallback, 1, v8::None, V8DOMConfiguration::kOnPrototype, V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOMConfiguration::kAllWorlds}, }; static void installV8TestIntegerIndexedTemplate( @@ -288,6 +369,12 @@ // Array iterator (@@iterator) prototypeTemplate->SetIntrinsicDataProperty(v8::Symbol::GetIterator(isolate), v8::kArrayProto_values, v8::DontEnum); + // For value iterators, the properties below must originally be set to the corresponding ones in %ArrayPrototype%. + // See https://heycam.github.io/webidl/#es-iterators. + prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "entries"), v8::kArrayProto_entries); + prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "forEach"), v8::kArrayProto_forEach); + prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "keys"), v8::kArrayProto_keys); + prototypeTemplate->SetIntrinsicDataProperty(V8AtomicString(isolate, "values"), v8::kArrayProto_values); // Custom signature
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h index c95c9d6..a690ef35 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestIntegerIndexed.h
@@ -58,6 +58,9 @@ CORE_EXPORT static void lengthAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void voidMethodDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); + CORE_EXPORT static void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); + CORE_EXPORT static void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); + CORE_EXPORT static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&); CORE_EXPORT static void namedPropertyGetterCallback(v8::Local<v8::Name>, const v8::PropertyCallbackInfo<v8::Value>&); CORE_EXPORT static void namedPropertySetterCallback(v8::Local<v8::Name>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp index 74f4526..eacaf5b 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestInterfaceNode.cpp
@@ -186,6 +186,8 @@ TestInterfaceNode* impl = V8TestInterfaceNode::ToImpl(holder); + V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; + // Prepare the value to be set. V8StringResource<> cppValue = v8Value; if (!cppValue.Prepare()) @@ -211,6 +213,8 @@ TestInterfaceNode* impl = V8TestInterfaceNode::ToImpl(holder); + V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; + // Prepare the value to be set. V8StringResource<> cppValue = v8Value; if (!cppValue.Prepare()) @@ -356,8 +360,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestInterfaceNodeV8Internal::reflectStringAttributeAttributeSetter(v8Value, info); } @@ -372,8 +374,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestInterfaceNodeV8Internal::reflectUrlStringAttributeAttributeSetter(v8Value, info); }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp index ce6fd65..fe2397cc 100644 --- a/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp +++ b/third_party/WebKit/Source/bindings/tests/results/core/V8TestObject.cpp
@@ -3121,7 +3121,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "reflectTestInterfaceAttribute"); @@ -3155,7 +3154,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "reflectReflectedNameAttributeTestAttribute"); @@ -3189,7 +3187,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "reflectBooleanAttribute"); @@ -3219,7 +3216,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "reflectLongAttribute"); @@ -3249,7 +3245,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "reflectUnsignedShortAttribute"); @@ -3279,7 +3274,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; ExceptionState exceptionState(isolate, ExceptionState::kSetterContext, "TestObject", "reflectUnsignedLongAttribute"); @@ -3309,7 +3303,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3337,7 +3330,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3365,7 +3357,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3393,7 +3384,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3421,7 +3411,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3449,7 +3438,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3487,7 +3475,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3529,7 +3516,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3569,7 +3555,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3609,7 +3594,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -3651,7 +3635,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -4016,7 +3999,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -4044,7 +4026,6 @@ TestObject* impl = V8TestObject::ToImpl(holder); - // Skip on compact node DOMString getters. V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; // Prepare the value to be set. @@ -10990,8 +10971,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectTestInterfaceAttributeAttributeSetter(v8Value, info); } @@ -11006,8 +10985,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectReflectedNameAttributeTestAttributeAttributeSetter(v8Value, info); } @@ -11022,8 +10999,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectBooleanAttributeAttributeSetter(v8Value, info); } @@ -11038,8 +11013,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectLongAttributeAttributeSetter(v8Value, info); } @@ -11054,8 +11027,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectUnsignedShortAttributeAttributeSetter(v8Value, info); } @@ -11070,8 +11041,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectUnsignedLongAttributeAttributeSetter(v8Value, info); } @@ -11086,8 +11055,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::idAttributeSetter(v8Value, info); } @@ -11102,8 +11069,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::nameAttributeSetter(v8Value, info); } @@ -11118,8 +11083,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::classAttributeSetter(v8Value, info); } @@ -11134,8 +11097,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectedIdAttributeSetter(v8Value, info); } @@ -11150,8 +11111,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectedNameAttributeSetter(v8Value, info); } @@ -11166,8 +11125,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::reflectedClassAttributeSetter(v8Value, info); } @@ -11182,8 +11139,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::limitedToOnlyOneAttributeAttributeSetter(v8Value, info); } @@ -11198,8 +11153,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::limitedToOnlyAttributeAttributeSetter(v8Value, info); } @@ -11214,8 +11167,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::limitedToOnlyOtherAttributeAttributeSetter(v8Value, info); } @@ -11230,8 +11181,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::limitedWithMissingDefaultAttributeAttributeSetter(v8Value, info); } @@ -11246,8 +11195,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::limitedWithInvalidMissingDefaultAttributeAttributeSetter(v8Value, info); } @@ -11434,8 +11381,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::urlStringAttributeAttributeSetter(v8Value, info); } @@ -11450,8 +11395,6 @@ v8::Local<v8::Value> v8Value = info[0]; - V0CustomElementProcessingStack::CallbackDeliveryScope deliveryScope; - TestObjectV8Internal::urlStringAttributeAttributeSetter(v8Value, info); }
diff --git a/third_party/WebKit/Source/build/scripts/make_media_feature_names.py b/third_party/WebKit/Source/build/scripts/core/css/make_media_feature_names.py similarity index 87% rename from third_party/WebKit/Source/build/scripts/make_media_feature_names.py rename to third_party/WebKit/Source/build/scripts/core/css/make_media_feature_names.py index 7800546..273aaba 100755 --- a/third_party/WebKit/Source/build/scripts/make_media_feature_names.py +++ b/third_party/WebKit/Source/build/scripts/core/css/make_media_feature_names.py
@@ -4,7 +4,10 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import os import sys +sys.path.append(os.path.join(os.path.dirname(__file__), '../..')) + import json5_generator import make_names import media_feature_symbol
diff --git a/third_party/WebKit/Source/build/scripts/json5_generator.py b/third_party/WebKit/Source/build/scripts/json5_generator.py index dbfabe5..39c88a1 100644 --- a/third_party/WebKit/Source/build/scripts/json5_generator.py +++ b/third_party/WebKit/Source/build/scripts/json5_generator.py
@@ -207,11 +207,17 @@ self._input_files = copy.copy(json5_files) self._outputs = {} # file_name -> generator self.gperf_path = None + self.snake_case_input_files = False if json5_files: self.json5_file = Json5File.load_from_files(json5_files, self.default_metadata, self.default_parameters) + # TODO(tkent): This is an ugly hack. Remove the function after the great mv. + # crbug.com/760462 + def set_snake_case_input_files(self, flag): + self.snake_case_input_files = flag + def _write_file_if_changed(self, output_dir, contents, file_name): path = os.path.join(output_dir, file_name) @@ -249,11 +255,15 @@ parser.add_argument("--gperf", default="gperf") parser.add_argument("--developer_dir", help="Path to Xcode.") parser.add_argument("--output_dir", default=os.getcwd()) + # TODO(tkent): Remove the option after the great mv. crbug.com/760462 + parser.add_argument("--snake-case-input-files", + action="store_true", default=False) args = parser.parse_args() if args.developer_dir: os.environ["DEVELOPER_DIR"] = args.developer_dir writer = self._writer_class(args.files) + writer.set_snake_case_input_files(args.snake_case_input_files) writer.set_gperf_path(args.gperf) writer.write_files(args.output_dir)
diff --git a/third_party/WebKit/Source/build/scripts/make_event_factory.py b/third_party/WebKit/Source/build/scripts/make_event_factory.py index e579c4c6..f9da6e337 100755 --- a/third_party/WebKit/Source/build/scripts/make_event_factory.py +++ b/third_party/WebKit/Source/build/scripts/make_event_factory.py
@@ -130,14 +130,23 @@ print 'FATAL ERROR: ' + message exit(1) + def _get_basename(self, name, prefix=None): + if self.snake_case_input_files: + if prefix: + return '%s_%s' % (prefix.lower(), name_utilities.snake_case(name)) + return name_utilities.snake_case(name) + if prefix: + return '%s%s' % (prefix, name) + return name + def _headers_header_include_path(self, entry): + path = os.path.dirname(entry['name']) + if len(path): + path += '/' if entry['ImplementedAs']: - path = os.path.dirname(entry['name']) - if len(path): - path += '/' - path += entry['ImplementedAs'] + path += self._get_basename(entry['ImplementedAs']) else: - path = entry['name'] + path += self._get_basename(os.path.basename(entry['name'])) return path + '.h' def _headers_header_includes(self, entries): @@ -151,9 +160,10 @@ subdir_name = 'modules' else: subdir_name = 'core' - includes[cpp_name] = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v8/V8%(script_name)s.h"' % { + binding_name = self._get_basename(name_utilities.script_name(entry), prefix='V8') + includes[cpp_name] = '#include "%(path)s"\n#include "bindings/%(subdir_name)s/v8/%(binding_name)s.h"' % { + 'binding_name': binding_name, 'path': self._headers_header_include_path(entry), - 'script_name': name_utilities.script_name(entry), 'subdir_name': subdir_name, } return includes.values()
diff --git a/third_party/WebKit/Source/build/scripts/scripts.gni b/third_party/WebKit/Source/build/scripts/scripts.gni index a1755ffa..8932844 100644 --- a/third_party/WebKit/Source/build/scripts/scripts.gni +++ b/third_party/WebKit/Source/build/scripts/scripts.gni
@@ -122,6 +122,9 @@ if (defined(invoker.other_args)) { args += invoker.other_args } + if (snake_case_source_files) { + args += [ "--snake-case-input-files" ] + } if (defined(invoker.deps)) { deps = invoker.deps
diff --git a/third_party/WebKit/Source/config.gni b/third_party/WebKit/Source/config.gni index 81b1e49b..90f6ec2c 100644 --- a/third_party/WebKit/Source/config.gni +++ b/third_party/WebKit/Source/config.gni
@@ -32,6 +32,9 @@ use_webaudio_ffmpeg = !is_mac && !is_android +# TODO(tkent): Remove this flag after the great mv. crbug.com/760462 +snake_case_source_files = false + # feature_defines_list --------------------------------------------------------- feature_defines_list = []
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn index 784cc84..325b2cf 100644 --- a/third_party/WebKit/Source/core/BUILD.gn +++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -865,13 +865,17 @@ # make_names ------------------------------------------------------------------- -process_json5_files("make_core_generated_media_feature_names") { - script = "../build/scripts/make_media_feature_names.py" - in_files = [ "css/MediaFeatureNames.json5" ] +code_generator("make_core_generated_media_feature_names") { + script = "../build/scripts/core/css/make_media_feature_names.py" + json_inputs = [ "css/MediaFeatureNames.json5" ] + templates = [ + "../build/scripts/templates/MakeNames.cpp.tmpl", + "../build/scripts/templates/MakeNames.h.tmpl", + ] other_inputs = make_names_files outputs = [ - "$blink_core_output_dir/MediaFeatureNames.cpp", - "$blink_core_output_dir/MediaFeatureNames.h", + "$blink_core_output_dir/css/MediaFeatureNames.cpp", + "$blink_core_output_dir/css/MediaFeatureNames.h", ] }
diff --git a/third_party/WebKit/Source/core/CoreInitializer.cpp b/third_party/WebKit/Source/core/CoreInitializer.cpp index d662c8e2..76599ac 100644 --- a/third_party/WebKit/Source/core/CoreInitializer.cpp +++ b/third_party/WebKit/Source/core/CoreInitializer.cpp
@@ -39,12 +39,12 @@ #include "core/InputModeNames.h" #include "core/InputTypeNames.h" #include "core/MathMLNames.h" -#include "core/MediaFeatureNames.h" #include "core/MediaTypeNames.h" #include "core/SVGNames.h" #include "core/XLinkNames.h" #include "core/XMLNSNames.h" #include "core/XMLNames.h" +#include "core/css/MediaFeatureNames.h" #include "core/css/MediaQueryEvaluator.h" #include "core/css/StyleChangeReason.h" #include "core/css/parser/CSSParserTokenRange.h"
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp index 7238df68..9e32e38a 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp +++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -30,12 +30,12 @@ #include "core/css/MediaQueryEvaluator.h" #include "core/CSSValueKeywords.h" -#include "core/MediaFeatureNames.h" #include "core/MediaFeatures.h" #include "core/MediaTypeNames.h" #include "core/css/CSSHelper.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSToLengthConversionData.h" +#include "core/css/MediaFeatureNames.h" #include "core/css/MediaList.h" #include "core/css/MediaQuery.h" #include "core/css/MediaValuesDynamic.h"
diff --git a/third_party/WebKit/Source/core/css/MediaQueryExp.h b/third_party/WebKit/Source/core/css/MediaQueryExp.h index 6f962b3..346b3aec 100644 --- a/third_party/WebKit/Source/core/css/MediaQueryExp.h +++ b/third_party/WebKit/Source/core/css/MediaQueryExp.h
@@ -31,9 +31,9 @@ #include "core/CSSValueKeywords.h" #include "core/CoreExport.h" -#include "core/MediaFeatureNames.h" #include "core/css/CSSPrimitiveValue.h" #include "core/css/CSSValue.h" +#include "core/css/MediaFeatureNames.h" #include "platform/wtf/Allocator.h" #include "platform/wtf/RefPtr.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/third_party/WebKit/Source/core/layout/LayoutTable.cpp index 861c749..2c8d2ab 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -74,7 +74,9 @@ collapsed_outer_border_start_(0), collapsed_outer_border_end_(0), collapsed_outer_border_before_(0), - collapsed_outer_border_after_(0) { + collapsed_outer_border_after_(0), + collapsed_outer_border_start_overflow_(0), + collapsed_outer_border_end_overflow_(0) { DCHECK(!ChildrenInline()); effective_column_positions_.Fill(0, 1); } @@ -884,6 +886,27 @@ } void LayoutTable::AddOverflowFromChildren() { + // Add overflow from borders. + // Technically it's odd that we are incorporating the borders into layout + // overflow, which is only supposed to be about overflow from our + // descendant objects, but since tables don't support overflow:auto, this + // works out fine. + UpdateCollapsedOuterBorders(); + if (ShouldCollapseBorders() && (collapsed_outer_border_start_overflow_ || + collapsed_outer_border_end_overflow_)) { + LogicalToPhysical<LayoutUnit> physical_border_overflow( + StyleRef().GetWritingMode(), StyleRef().Direction(), + LayoutUnit(collapsed_outer_border_start_overflow_), + LayoutUnit(collapsed_outer_border_end_overflow_), LayoutUnit(), + LayoutUnit()); + LayoutRect border_overflow(PixelSnappedBorderBoxRect()); + border_overflow.Expand(LayoutRectOutsets( + physical_border_overflow.Top(), physical_border_overflow.Right(), + physical_border_overflow.Bottom(), physical_border_overflow.Left())); + AddLayoutOverflow(border_overflow); + AddSelfVisualOverflow(border_overflow); + } + // Add overflow from our caption. for (unsigned i = 0; i < captions_.size(); i++) AddOverflowFromChild(*captions_[i]); @@ -892,12 +915,6 @@ for (LayoutTableSection* section = TopSection(); section; section = SectionBelow(section)) AddOverflowFromChild(*section); - - // Technically it's odd that we are incorporating the borders into layout - // overflow, which is only supposed to be about overflow from our - // descendant objects, but since tables don't support overflow:auto, this - // works out fine. - AddLayoutOverflow(VisualOverflowRect()); } void LayoutTable::PaintObject(const PaintInfo& paint_info, @@ -1618,84 +1635,79 @@ return LayoutUnit(LayoutBlock::PaddingRight().ToInt()); } -unsigned LayoutTable::ComputeCollapsedOuterBorderBefore() const { - DCHECK(ShouldCollapseBorders()); - - // The table's before outer border width is the maximum before outer border - // widths of all cells in the first row. See the CSS 2.1 spec, section 17.6.2. - const auto* section = TopNonEmptySection(); - if (!section) - return 0; - - unsigned n_cols = section->NumCols(0); - unsigned result = 0; - for (unsigned col = 0; col < n_cols; ++col) { - if (const auto* cell = section->PrimaryCellAt(0, col)) - result = std::max(result, cell->CollapsedOuterBorderBefore()); - } - return result; -} - -unsigned LayoutTable::ComputeCollapsedOuterBorderAfter() const { - DCHECK(ShouldCollapseBorders()); - - const auto* section = BottomNonEmptySection(); - if (!section) - return 0; - - // The table's after outer border width is the maximum after outer border - // widths of all cells in the last row. See the CSS 2.1 spec, section 17.6.2. - unsigned row = section->NumRows() - 1; - unsigned n_cols = section->NumCols(row); - unsigned result = 0; - for (unsigned col = 0; col < n_cols; ++col) { - if (const auto* cell = section->PrimaryCellAt(row, col)) - result = std::max(result, cell->CollapsedOuterBorderAfter()); - } - return result; -} - -unsigned LayoutTable::ComputeCollapsedOuterBorderStart() const { - DCHECK(ShouldCollapseBorders()); - - // The table's start and end outer border widths are the border outer widths - // of the first and last cells in the first row. See the CSS 2.1 spec, - // section 17.6.2. - if (const auto* section = TopNonEmptySection()) { - if (const auto* row = section->FirstRow()) { - if (const auto* cell = row->FirstCell()) - return cell->CollapsedOuterBorderStart(); - } - } - return 0; -} - -unsigned LayoutTable::ComputeCollapsedOuterBorderEnd() const { - DCHECK(ShouldCollapseBorders()); - - // The table's start and end outer border widths are the border outer widths - // of the first and last cells in the first row. See the CSS 2.1 spec, - // section 17.6.2. - if (const auto* section = TopNonEmptySection()) { - if (const auto* row = section->FirstRow()) { - if (const auto* cell = row->LastCell()) - return cell->CollapsedOuterBorderEnd(); - } - } - return 0; -} - void LayoutTable::UpdateCollapsedOuterBorders() const { if (collapsed_outer_borders_valid_) return; collapsed_outer_borders_valid_ = true; - if (ShouldCollapseBorders()) { - collapsed_outer_border_before_ = ComputeCollapsedOuterBorderBefore(); - collapsed_outer_border_after_ = ComputeCollapsedOuterBorderAfter(); - collapsed_outer_border_start_ = ComputeCollapsedOuterBorderStart(); - collapsed_outer_border_end_ = ComputeCollapsedOuterBorderEnd(); + if (!ShouldCollapseBorders()) + return; + + collapsed_outer_border_start_ = 0; + collapsed_outer_border_end_ = 0; + collapsed_outer_border_before_ = 0; + collapsed_outer_border_after_ = 0; + collapsed_outer_border_start_overflow_ = 0; + collapsed_outer_border_end_overflow_ = 0; + + const auto* top_section = TopNonEmptySection(); + if (!top_section) + return; + + // The table's before outer border width is the maximum before outer border + // widths of all cells in the first row. See the CSS 2.1 spec, section 17.6.2. + unsigned top_cols = top_section->NumCols(0); + for (unsigned col = 0; col < top_cols; ++col) { + if (const auto* cell = top_section->PrimaryCellAt(0, col)) { + collapsed_outer_border_before_ = std::max( + collapsed_outer_border_before_, cell->CollapsedOuterBorderBefore()); + } } + + const auto* bottom_section = BottomNonEmptySection(); + DCHECK(bottom_section); + // The table's after outer border width is the maximum after outer border + // widths of all cells in the last row. See the CSS 2.1 spec, section 17.6.2. + unsigned row = bottom_section->NumRows() - 1; + unsigned bottom_cols = bottom_section->NumCols(row); + for (unsigned col = 0; col < bottom_cols; ++col) { + if (const auto* cell = bottom_section->PrimaryCellAt(row, col)) { + collapsed_outer_border_after_ = std::max( + collapsed_outer_border_after_, cell->CollapsedOuterBorderAfter()); + } + } + + // The table's start and end outer border widths are the border outer widths + // of the first and last cells in the first row. See the CSS 2.1 spec, + // section 17.6.2. + bool first_row = true; + unsigned max_border_start = 0; + unsigned max_border_end = 0; + for (const auto* section = top_section; section; + section = SectionBelow(section, kSkipEmptySections)) { + for (const auto* row = section->FirstRow(); row; row = row->NextRow()) { + if (const auto* cell = row->FirstCell()) { + auto border_start = cell->CollapsedOuterBorderStart(); + if (first_row) + collapsed_outer_border_start_ = border_start; + max_border_start = std::max(max_border_start, border_start); + } + if (const auto* cell = row->LastCell()) { + auto border_end = cell->CollapsedOuterBorderEnd(); + if (first_row) + collapsed_outer_border_end_ = border_end; + max_border_end = std::max(max_border_end, border_end); + } + first_row = false; + } + } + + // Record the overflows caused by wider collapsed borders of the first/last + // cell in rows other than the first. + collapsed_outer_border_start_overflow_ = + max_border_start - collapsed_outer_border_start_; + collapsed_outer_border_end_overflow_ = + max_border_end - collapsed_outer_border_end_; } bool LayoutTable::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const {
diff --git a/third_party/WebKit/Source/core/layout/LayoutTable.h b/third_party/WebKit/Source/core/layout/LayoutTable.h index c8f85f8..8080678 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTable.h +++ b/third_party/WebKit/Source/core/layout/LayoutTable.h
@@ -480,10 +480,6 @@ void RecalcSections() const; void UpdateCollapsedOuterBorders() const; - unsigned ComputeCollapsedOuterBorderBefore() const; - unsigned ComputeCollapsedOuterBorderAfter() const; - unsigned ComputeCollapsedOuterBorderStart() const; - unsigned ComputeCollapsedOuterBorderEnd() const; void LayoutCaption(LayoutTableCaption&, SubtreeLayoutScope&); void LayoutSection(LayoutTableSection&, @@ -587,10 +583,13 @@ short h_spacing_; short v_spacing_; + // See UpdateCollapsedOuterBorders(). mutable unsigned collapsed_outer_border_start_; mutable unsigned collapsed_outer_border_end_; mutable unsigned collapsed_outer_border_before_; mutable unsigned collapsed_outer_border_after_; + mutable unsigned collapsed_outer_border_start_overflow_; + mutable unsigned collapsed_outer_border_end_overflow_; LayoutUnit block_offset_to_first_repeatable_header_; LayoutUnit row_offset_from_repeating_header_;
diff --git a/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp b/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp index 109d8eb6..82fd163 100644 --- a/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp +++ b/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp
@@ -21,33 +21,44 @@ SetBodyInnerHTML( "<style>" " table { border-collapse: collapse }" - " td { border: 0px solid blue; padding: 0 }" - " div { width: 100px; height: 100px }" + " td { border: 0px solid blue; padding: 0; width: 100px; height: 100px }" "</style>" "<table id='table'>" " <tr>" - " <td style='border-bottom-width: 10px;" - " outline: 3px solid blue'><div></div></td>" - " <td style='border-width: 3px 15px'><div></div></td>" + " <td style='border-top-width: 2px; border-left-width: 2px;" + " outline: 6px solid blue'></td>" + " <td style='border-top-width: 4px; border-right-width: 10px'></td>" " </tr>" - " <tr style='outline: 8px solid green'><td><div></div></td></tr>" + " <tr style='outline: 8px solid green'>" + " <td style='border-left-width: 20px'></td>" + " <td style='border-right-width: 20px'></td>" + " </tr>" "</table>"); auto* table = GetTableByElementId("table"); - // The table's self visual overflow covers the collapsed borders. - EXPECT_EQ(LayoutRect(0, 0, 230, 211), table->BorderBoxRect()); - EXPECT_EQ(LayoutRect(0, 0, 230, 211), table->SelfVisualOverflowRect()); + // The table's border box rect covers all collapsed borders of the first + // row, and bottom collapsed borders of the last row. + LayoutRect expected_border_box_rect = table->ContentBoxRect(); + expected_border_box_rect.ExpandEdges(LayoutUnit(2), LayoutUnit(5), + LayoutUnit(0), LayoutUnit(1)); + EXPECT_EQ(expected_border_box_rect, table->BorderBoxRect()); + + // The table's self visual overflow rect covers all collapsed borders, but + // not visual overflows (outlines) from descendants. + LayoutRect expected_self_visual_overflow = table->ContentBoxRect(); + expected_self_visual_overflow.ExpandEdges(LayoutUnit(2), LayoutUnit(10), + LayoutUnit(0), LayoutUnit(10)); + EXPECT_EQ(expected_self_visual_overflow, table->SelfVisualOverflowRect()); + // For this table, its layout overflow equals self visual overflow. + EXPECT_EQ(expected_self_visual_overflow, table->LayoutOverflowRect()); // The table's visual overflow covers self visual overflow and content visual // overflows. LayoutRect expected_visual_overflow = table->ContentBoxRect(); - expected_visual_overflow.ExpandEdges(LayoutUnit(3), LayoutUnit(8), - LayoutUnit(8), LayoutUnit(8)); + expected_visual_overflow.ExpandEdges(LayoutUnit(6), LayoutUnit(10), + LayoutUnit(8), LayoutUnit(10)); EXPECT_EQ(expected_visual_overflow, table->VisualOverflowRect()); - - // Tables layout overflow equals visual overflow. - EXPECT_EQ(expected_visual_overflow, table->LayoutOverflowRect()); } TEST_F(LayoutTableTest, CollapsedBorders) {
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp index cb2264f..d567b4b 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp +++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -1642,6 +1642,10 @@ return true; if (PaintsWithTransform(kGlobalPaintNormalPhase)) return true; + if (!compositing_layer) { + compositing_layer = + EnclosingLayerForPaintInvalidationCrossingFrameBoundaries(); + } if (!compositing_layer) return true; // Composited layers may not be fragmented.
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h index 2c9e395..0ca5c02 100644 --- a/third_party/WebKit/Source/core/paint/PaintLayer.h +++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -1039,8 +1039,9 @@ // to the given |compositing_layer| backing. In SPv1 mode, fragmentation // may not cross compositing boundaries, so this wil return false // if EnclosingPaginationLayer() is above |compositing_layer|. + // If |compositing_layer| is not provided, it will be computed if necessary. bool ShouldFragmentCompositedBounds( - const PaintLayer* compositing_layer) const; + const PaintLayer* compositing_layer = nullptr) const; private: void SetNeedsCompositingInputsUpdateInternal();
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp index 4fb7da28..1129f9d1 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -1357,13 +1357,11 @@ const LayoutObject& object, PaintPropertyTreeBuilderContext& full_context, bool needs_paint_properties) { - object.GetMutableForPainting().EnsureFirstFragment(); - object.GetMutableForPainting().FirstFragment()->ClearNextFragment(); - if (needs_paint_properties) { - object.GetMutableForPainting() - .EnsureFirstFragment() - .EnsurePaintProperties(); - } + FragmentData& first_fragment = + object.GetMutableForPainting().EnsureFirstFragment(); + first_fragment.ClearNextFragment(); + if (needs_paint_properties) + first_fragment.EnsurePaintProperties(); if (full_context.fragments.IsEmpty()) { full_context.fragments.push_back(PaintPropertyTreeBuilderFragmentContext()); } else { @@ -1400,13 +1398,7 @@ PaintLayer* paint_layer = nullptr; if (object.HasLayer()) paint_layer = ToLayoutBoxModelObject(object).Layer(); - - if (!paint_layer || - !paint_layer->ShouldFragmentCompositedBounds( - RuntimeEnabledFeatures::SlimmingPaintV2Enabled() - ? nullptr - : paint_layer - ->EnclosingLayerForPaintInvalidationCrossingFrameBoundaries())) { + if (!paint_layer || !paint_layer->ShouldFragmentCompositedBounds()) { InitSingleFragmentFromParent(object, full_context, needs_paint_properties); } else {
diff --git a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h index 3e57c0d3..edcc8a5 100644 --- a/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h +++ b/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.h
@@ -260,7 +260,7 @@ ObjectPaintProperties*, bool& force_subtree_update); - static void InitSingleFragmentFromParent( + ALWAYS_INLINE static void InitSingleFragmentFromParent( const LayoutObject&, PaintPropertyTreeBuilderContext& full_context, bool needs_paint_properties);
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.cpp b/third_party/WebKit/Source/platform/heap/ThreadState.cpp index 80280f7..26f0ecd 100644 --- a/third_party/WebKit/Source/platform/heap/ThreadState.cpp +++ b/third_party/WebKit/Source/platform/heap/ThreadState.cpp
@@ -956,9 +956,6 @@ // eagerly. DCHECK(IsSweepingInProgress()); - // TODO(yhirano): Turn this CHECK to DCHECK before M63 branch is cut. - CHECK(!SweepForbidden()); - SweepForbiddenScope scope(this); ScriptForbiddenIfMainThreadScope script_forbidden_scope;
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue.cc index ee15399..f2d6a30 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue.cc
@@ -14,7 +14,7 @@ TaskQueue::~TaskQueue() {} -TaskQueue::Task::Task(const tracked_objects::Location& posted_from, +TaskQueue::Task::Task(const base::Location& posted_from, base::OnceClosure task, base::TimeTicks desired_run_time, bool nestable) @@ -28,16 +28,15 @@ return impl_->RunsTasksInCurrentSequence(); } -bool TaskQueue::PostDelayedTask(const tracked_objects::Location& from_here, +bool TaskQueue::PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return impl_->PostDelayedTask(from_here, std::move(task), delay); } -bool TaskQueue::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay) { +bool TaskQueue::PostNonNestableDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) { return impl_->PostNonNestableDelayedTask(from_here, std::move(task), delay); }
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue.h index 6dfcf8c5..3613a9aa 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue.h +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue.h
@@ -118,7 +118,7 @@ // Interface to pass per-task metadata to RendererScheduler. class PLATFORM_EXPORT Task : public base::PendingTask { public: - Task(const tracked_objects::Location& posted_from, + Task(const base::Location& posted_from, base::OnceClosure task, base::TimeTicks desired_run_time, bool nestable); @@ -220,10 +220,10 @@ // base::SingleThreadTaskRunner implementation bool RunsTasksInCurrentSequence() const override; - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override;
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc index f657d1cf..9ad2512 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
@@ -68,7 +68,7 @@ } TaskQueueImpl::Task::Task() - : TaskQueue::Task(tracked_objects::Location(), + : TaskQueue::Task(base::Location(), base::Closure(), base::TimeTicks(), true), @@ -79,7 +79,7 @@ sequence_num = 0; } -TaskQueueImpl::Task::Task(const tracked_objects::Location& posted_from, +TaskQueueImpl::Task::Task(const base::Location& posted_from, base::OnceClosure task, base::TimeTicks desired_run_time, EnqueueOrder sequence_number, @@ -92,7 +92,7 @@ sequence_num = sequence_number; } -TaskQueueImpl::Task::Task(const tracked_objects::Location& posted_from, +TaskQueueImpl::Task::Task(const base::Location& posted_from, base::OnceClosure task, base::TimeTicks desired_run_time, EnqueueOrder sequence_number, @@ -164,7 +164,7 @@ return base::PlatformThread::CurrentId() == thread_id_; } -bool TaskQueueImpl::PostDelayedTask(const tracked_objects::Location& from_here, +bool TaskQueueImpl::PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { if (delay.is_zero()) @@ -174,10 +174,9 @@ TaskType::NORMAL); } -bool TaskQueueImpl::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay) { +bool TaskQueueImpl::PostNonNestableDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) { if (delay.is_zero()) return PostImmediateTaskImpl(from_here, std::move(task), TaskType::NON_NESTABLE); @@ -186,10 +185,9 @@ TaskType::NON_NESTABLE); } -bool TaskQueueImpl::PostImmediateTaskImpl( - const tracked_objects::Location& from_here, - base::OnceClosure task, - TaskType task_type) { +bool TaskQueueImpl::PostImmediateTaskImpl(const base::Location& from_here, + base::OnceClosure task, + TaskType task_type) { // Use CHECK instead of DCHECK to crash earlier. See http://crbug.com/711167 // for details. CHECK(task); @@ -206,11 +204,10 @@ return true; } -bool TaskQueueImpl::PostDelayedTaskImpl( - const tracked_objects::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay, - TaskType task_type) { +bool TaskQueueImpl::PostDelayedTaskImpl(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay, + TaskType task_type) { // Use CHECK instead of DCHECK to crash earlier. See http://crbug.com/711167 // for details. CHECK(task); @@ -304,7 +301,7 @@ } void TaskQueueImpl::PushOntoImmediateIncomingQueueLocked( - const tracked_objects::Location& posted_from, + const base::Location& posted_from, base::OnceClosure task, base::TimeTicks desired_run_time, EnqueueOrder sequence_number,
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h index cdb81fe3..0bf4356 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -86,13 +86,13 @@ class PLATFORM_EXPORT Task : public TaskQueue::Task { public: Task(); - Task(const tracked_objects::Location& posted_from, + Task(const base::Location& posted_from, base::OnceClosure task, base::TimeTicks desired_run_time, EnqueueOrder sequence_number, bool nestable); - Task(const tracked_objects::Location& posted_from, + Task(const base::Location& posted_from, base::OnceClosure task, base::TimeTicks desired_run_time, EnqueueOrder sequence_number, @@ -143,10 +143,10 @@ // TaskQueue implementation. const char* GetName() const; bool RunsTasksInCurrentSequence() const; - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay); - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay); // Require a reference to enclosing task queue for lifetime control. @@ -329,10 +329,10 @@ bool is_enabled_for_test; }; - bool PostImmediateTaskImpl(const tracked_objects::Location& from_here, + bool PostImmediateTaskImpl(const base::Location& from_here, base::OnceClosure task, TaskType task_type); - bool PostDelayedTaskImpl(const tracked_objects::Location& from_here, + bool PostDelayedTaskImpl(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay, TaskType task_type); @@ -353,12 +353,11 @@ // Push the task onto the |immediate_incoming_queue| and for auto pumped // queues it calls MaybePostDoWorkOnMainRunner if the Incoming queue was // empty. - void PushOntoImmediateIncomingQueueLocked( - const tracked_objects::Location& posted_from, - base::OnceClosure task, - base::TimeTicks desired_run_time, - EnqueueOrder sequence_number, - bool nestable); + void PushOntoImmediateIncomingQueueLocked(const base::Location& posted_from, + base::OnceClosure task, + base::TimeTicks desired_run_time, + EnqueueOrder sequence_number, + bool nestable); // We reserve an inline capacity of 8 tasks to try and reduce the load on // PartitionAlloc.
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc index e968433..7e3e6c5 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc
@@ -184,13 +184,13 @@ } void TaskQueueManager::MaybeScheduleImmediateWork( - const tracked_objects::Location& from_here) { + const base::Location& from_here) { MoveableAutoLock lock(any_thread_lock_); MaybeScheduleImmediateWorkLocked(from_here, std::move(lock)); } void TaskQueueManager::MaybeScheduleImmediateWorkLocked( - const tracked_objects::Location& from_here, + const base::Location& from_here, MoveableAutoLock lock) { { MoveableAutoLock auto_lock(std::move(lock)); @@ -210,7 +210,7 @@ } void TaskQueueManager::MaybeScheduleDelayedWork( - const tracked_objects::Location& from_here, + const base::Location& from_here, TimeDomain* requesting_time_domain, base::TimeTicks now, base::TimeTicks run_time) {
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h index d1e856b..d12e024 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
@@ -67,12 +67,12 @@ // These tasks are de-duplicated in two buckets: main-thread and all other // threads. This distinction is done to reduce the overehead from locks, we // assume the main-thread path will be hot. - void MaybeScheduleImmediateWork(const tracked_objects::Location& from_here); + void MaybeScheduleImmediateWork(const base::Location& from_here); // Requests that a delayed task to process work is posted on the main task // runner. These delayed tasks are de-duplicated. Must be called on the thread // this class was created on. - void MaybeScheduleDelayedWork(const tracked_objects::Location& from_here, + void MaybeScheduleDelayedWork(const base::Location& from_here, TimeDomain* requesting_time_domain, base::TimeTicks now, base::TimeTicks run_time); @@ -272,7 +272,7 @@ base::TimeTicks* time_after_task); bool RunsTasksInCurrentSequence() const; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, const base::Closure& task, base::TimeDelta delay); @@ -287,9 +287,8 @@ AsValueWithSelectorResult(bool should_run, internal::WorkQueue* selected_work_queue) const; - void MaybeScheduleImmediateWorkLocked( - const tracked_objects::Location& from_here, - MoveableAutoLock lock); + void MaybeScheduleImmediateWorkLocked(const base::Location& from_here, + MoveableAutoLock lock); // Adds |queue| to |any_thread().has_incoming_immediate_work_| and if // |queue_is_blocked| is false it makes sure a DoWork is posted.
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.cc index 9c79128..d18a48d 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.cc
@@ -29,14 +29,14 @@ TaskQueueManagerDelegateForTest::~TaskQueueManagerDelegateForTest() {} bool TaskQueueManagerDelegateForTest::PostDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return task_runner_->PostDelayedTask(from_here, std::move(task), delay); } bool TaskQueueManagerDelegateForTest::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return task_runner_->PostNonNestableDelayedTask(from_here, std::move(task),
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.h index 4336690b..a6401a8 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.h +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_delegate_for_test.h
@@ -23,10 +23,10 @@ std::unique_ptr<base::TickClock> time_source); // SingleThreadTaskRunner: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override;
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc index a77fe1a..feb3c04 100644 --- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
@@ -168,8 +168,7 @@ return manager_->GetNextSequenceNumber(); } - void MaybeScheduleImmediateWorkLocked( - const tracked_objects::Location& from_here) { + void MaybeScheduleImmediateWorkLocked(const base::Location& from_here) { MoveableAutoLock lock(manager_->any_thread_lock_); manager_->MaybeScheduleImmediateWorkLocked(from_here, std::move(lock)); }
diff --git a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.cc b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.cc index b84271e..d9e66e2a 100644 --- a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.cc +++ b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.cc
@@ -40,14 +40,14 @@ } bool SchedulerTqmDelegateForTest::PostDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return task_runner_->PostDelayedTask(from_here, std::move(task), delay); } bool SchedulerTqmDelegateForTest::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return task_runner_->PostNonNestableDelayedTask(from_here, std::move(task),
diff --git a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.h b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.h index 8323c5b21..afb08c6d 100644 --- a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.h +++ b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_for_test.h
@@ -28,10 +28,10 @@ void SetDefaultTaskRunner( scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; void RestoreDefaultTaskRunner() override; - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override;
diff --git a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.cc b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.cc index 4f491b4..448d24b 100644 --- a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.cc
@@ -40,16 +40,15 @@ message_loop_->SetTaskRunner(message_loop_task_runner_); } -bool SchedulerTqmDelegateImpl::PostDelayedTask( - const tracked_objects::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay) { +bool SchedulerTqmDelegateImpl::PostDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) { return message_loop_task_runner_->PostDelayedTask(from_here, std::move(task), delay); } bool SchedulerTqmDelegateImpl::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { return message_loop_task_runner_->PostNonNestableDelayedTask(
diff --git a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.h b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.h index 35bc285..881b201 100644 --- a/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/child/scheduler_tqm_delegate_impl.h
@@ -28,10 +28,10 @@ void SetDefaultTaskRunner( scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; void RestoreDefaultTaskRunner() override; - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override;
diff --git a/third_party/WebKit/Source/platform/scheduler/child/single_thread_idle_task_runner.cc b/third_party/WebKit/Source/platform/scheduler/child/single_thread_idle_task_runner.cc index 643e10e..9a63a56 100644 --- a/third_party/WebKit/Source/platform/scheduler/child/single_thread_idle_task_runner.cc +++ b/third_party/WebKit/Source/platform/scheduler/child/single_thread_idle_task_runner.cc
@@ -34,9 +34,8 @@ return idle_priority_task_runner_->RunsTasksInCurrentSequence(); } -void SingleThreadIdleTaskRunner::PostIdleTask( - const tracked_objects::Location& from_here, - const IdleTask& idle_task) { +void SingleThreadIdleTaskRunner::PostIdleTask(const base::Location& from_here, + const IdleTask& idle_task) { delegate_->OnIdleTaskPosted(); idle_priority_task_runner_->PostTask( from_here, base::Bind(&SingleThreadIdleTaskRunner::RunTask, @@ -44,7 +43,7 @@ } void SingleThreadIdleTaskRunner::PostDelayedIdleTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, const base::TimeDelta delay, const IdleTask& idle_task) { base::TimeTicks first_run_time = delegate_->NowTicks() + delay; @@ -55,7 +54,7 @@ } void SingleThreadIdleTaskRunner::PostNonNestableIdleTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, const IdleTask& idle_task) { delegate_->OnIdleTaskPosted(); idle_priority_task_runner_->PostNonNestableTask(
diff --git a/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc b/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc index 877bc196..dc80369 100644 --- a/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc +++ b/third_party/WebKit/Source/platform/scheduler/child/webthread_impl_for_worker_scheduler_unittest.cc
@@ -81,7 +81,7 @@ thread_->Init(); } - void RunOnWorkerThread(const tracked_objects::Location& from_here, + void RunOnWorkerThread(const base::Location& from_here, const base::Closure& task) { base::WaitableEvent completion( base::WaitableEvent::ResetPolicy::AUTOMATIC,
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.cc b/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.cc index a808506..cba5c22 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.cc
@@ -19,7 +19,7 @@ DeadlineTaskRunner::~DeadlineTaskRunner() {} -void DeadlineTaskRunner::SetDeadline(const tracked_objects::Location& from_here, +void DeadlineTaskRunner::SetDeadline(const base::Location& from_here, base::TimeDelta delay, base::TimeTicks now) { DCHECK(delay > base::TimeDelta());
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.h b/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.h index 8d61cf2a..6a3d8445 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/deadline_task_runner.h
@@ -31,7 +31,7 @@ // posted to run after |delay|. // // Once the deadline task has run, we reset. - void SetDeadline(const tracked_objects::Location& from_here, + void SetDeadline(const base::Location& from_here, base::TimeDelta delay, base::TimeTicks now);
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc index 6a4ce63f..8051aaf 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -892,7 +892,7 @@ } void RendererSchedulerImpl::EnsureUrgentPolicyUpdatePostedOnMainThread( - const tracked_objects::Location& from_here) { + const base::Location& from_here) { // TODO(scheduler-dev): Check that this method isn't called from the main // thread. any_thread_lock_.AssertAcquired();
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h index 65436d230..1f67b7e60 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
@@ -442,7 +442,7 @@ // sets |policy_may_need_update_|. Note |any_thread_lock_| must be // locked. void EnsureUrgentPolicyUpdatePostedOnMainThread( - const tracked_objects::Location& from_here); + const base::Location& from_here); // Update the policy if a new signal has arrived. Must be called from the main // thread.
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc index dab7680d..680b990 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc +++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.cc
@@ -245,7 +245,7 @@ } void TaskQueueThrottler::MaybeSchedulePumpThrottledTasks( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::TimeTicks now, base::TimeTicks unaligned_runtime) { if (!allow_throttling_)
diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h index 503957ee..9bf450d 100644 --- a/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h +++ b/third_party/WebKit/Source/platform/scheduler/renderer/task_queue_throttler.h
@@ -166,10 +166,9 @@ // Note |unthrottled_runtime| might be in the past. When this happens we // compute the delay to the next runtime based on now rather than // unthrottled_runtime. - void MaybeSchedulePumpThrottledTasks( - const tracked_objects::Location& from_here, - base::TimeTicks now, - base::TimeTicks runtime); + void MaybeSchedulePumpThrottledTasks(const base::Location& from_here, + base::TimeTicks now, + base::TimeTicks runtime); // Return next possible time when queue is allowed to run in accordance // with throttling policy.
diff --git a/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc b/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc index 663af1a..a39e5a0 100644 --- a/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc +++ b/third_party/WebKit/Source/platform/scheduler/test/fake_web_task_runner.cc
@@ -47,14 +47,14 @@ public: explicit BaseTaskRunner(PassRefPtr<Data> data) : data_(std::move(data)) {} - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { data_->PostTask(std::move(task), delay); return true; } - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override { data_->PostTask(std::move(task), delay);
diff --git a/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc b/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc index 45799646bc..cb46f65 100644 --- a/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc +++ b/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.cc
@@ -68,7 +68,7 @@ } bool LazySchedulerMessageLoopDelegateForTests::PostDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { EnsureMessageLoop(); @@ -77,7 +77,7 @@ } bool LazySchedulerMessageLoopDelegateForTests::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { EnsureMessageLoop();
diff --git a/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h b/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h index 455e8b1..3fe6ad5 100644 --- a/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h +++ b/third_party/WebKit/Source/platform/scheduler/test/lazy_scheduler_message_loop_delegate_for_tests.h
@@ -36,10 +36,10 @@ void SetDefaultTaskRunner( scoped_refptr<base::SingleThreadTaskRunner> task_runner) override; void RestoreDefaultTaskRunner() override; - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; bool RunsTasksInCurrentSequence() const override;
diff --git a/third_party/WebKit/public/platform/WebTraceLocation.h b/third_party/WebKit/public/platform/WebTraceLocation.h index 1dae87e..23ec5513 100644 --- a/third_party/WebKit/public/platform/WebTraceLocation.h +++ b/third_party/WebKit/public/platform/WebTraceLocation.h
@@ -9,7 +9,7 @@ namespace blink { -using WebTraceLocation = tracked_objects::Location; +using WebTraceLocation = base::Location; #define BLINK_FROM_HERE FROM_HERE }
diff --git a/third_party/WebKit/public/platform/scheduler/child/single_thread_idle_task_runner.h b/third_party/WebKit/public/platform/scheduler/child/single_thread_idle_task_runner.h index 032e40a..f78c237 100644 --- a/third_party/WebKit/public/platform/scheduler/child/single_thread_idle_task_runner.h +++ b/third_party/WebKit/public/platform/scheduler/child/single_thread_idle_task_runner.h
@@ -66,19 +66,18 @@ scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner, Delegate* delegate); - virtual void PostIdleTask(const tracked_objects::Location& from_here, + virtual void PostIdleTask(const base::Location& from_here, const IdleTask& idle_task); // |idle_task| is eligible to run after the next time an idle period starts // after |delay|. Note this has after wake-up semantics, i.e. unless // something else wakes the CPU up, this won't run. - virtual void PostDelayedIdleTask(const tracked_objects::Location& from_here, + virtual void PostDelayedIdleTask(const base::Location& from_here, const base::TimeDelta delay, const IdleTask& idle_task); - virtual void PostNonNestableIdleTask( - const tracked_objects::Location& from_here, - const IdleTask& idle_task); + virtual void PostNonNestableIdleTask(const base::Location& from_here, + const IdleTask& idle_task); bool RunsTasksInCurrentSequence() const; @@ -95,8 +94,7 @@ void EnqueueReadyDelayedIdleTasks(); - using DelayedIdleTask = - std::pair<const tracked_objects::Location, base::Closure>; + using DelayedIdleTask = std::pair<const base::Location, base::Closure>; scoped_refptr<base::SingleThreadTaskRunner> idle_priority_task_runner_; std::multimap<base::TimeTicks, DelayedIdleTask> delayed_idle_tasks_;
diff --git a/third_party/blink/tools/move_blink_source.py b/third_party/blink/tools/move_blink_source.py index 4fd7cdf2..cd9c889 100755 --- a/third_party/blink/tools/move_blink_source.py +++ b/third_party/blink/tools/move_blink_source.py
@@ -81,13 +81,13 @@ self._append_unless_upper_dir_exists(dirs, self._fs.join(self._repo_root, 'third_party', 'WebKit', 'public')) self._update_cpp_includes_in_directories(dirs) - # TODO(tkent): Update basenames in generated files; *.tmpl, - # bindings/scripts/*.py + # TODO(tkent): Update basenames in generated files; + # bindings/scripts/*.py, build/scripts/*.py. # Content update for individual files - self._update_single_file_content('third_party/WebKit/Source/bindings/scripts/scripts.gni', - [('bindings_generate_snake_case_files = false', - 'bindings_generate_snake_case_files = true')]) + self._update_single_file_content('third_party/WebKit/Source/config.gni', + [('snake_case_source_files = false', + 'snake_case_source_files = true')]) self._move_files(file_pairs) @@ -101,6 +101,10 @@ _, dest_base = self._fs.split(dest) if source_base == dest_base: continue + # ConditionalFeaturesForCore.* in bindings/tests/results/modules/ + # confuses generated/checked-in detection in _replace_include_path(). + if 'bindings/tests' in source.replace('\\', '/'): + continue basename_map[source_base] = dest_base pattern += re.escape(source_base) + '|' # IDL sometimes generates implementation files as well as @@ -214,7 +218,8 @@ for dirname in dirs: _log.info('Processing #include in %s ...', self._shorten_path(dirname)) files = self._fs.files_under( - dirname, file_filter=lambda fs, _, basename: basename.endswith(('.h', '.cc', '.cpp', '.mm'))) + dirname, file_filter=lambda fs, _, basename: basename.endswith( + ('.h', '.cc', '.cpp', '.mm', '.cpp.tmpl', '.h.tmpl'))) for file_path in files: original_content = self._fs.read_text_file(file_path)
diff --git a/tools/gdb/gdb_chrome.py b/tools/gdb/gdb_chrome.py index 67e333f..ef42a2c 100644 --- a/tools/gdb/gdb_chrome.py +++ b/tools/gdb/gdb_chrome.py
@@ -155,7 +155,7 @@ return '%s()@%s:%s' % (self.val['function_name_'].string(), self.val['file_name_'].string(), self.val['line_number_']) -pp_set.add_printer('tracked_objects::Location', '^tracked_objects::Location$', +pp_set.add_printer('base::Location', '^base::Location$', LocationPrinter)
diff --git a/tools/idl_parser/idl_parser.py b/tools/idl_parser/idl_parser.py index a0dfe59..cba40fb68 100755 --- a/tools/idl_parser/idl_parser.py +++ b/tools/idl_parser/idl_parser.py
@@ -722,7 +722,7 @@ p[0].AddChildren(self.BuildTrue('ELLIPSIS')) def p_Iterable(self, p): - """Iterable : ITERABLE '<' Type OptionalType '>' ';'""" + """Iterable : ITERABLE '<' TypeWithExtendedAttributes OptionalType '>' ';'""" childlist = ListFromConcat(p[3], p[4]) p[0] = self.BuildProduction('Iterable', p, 2, childlist)
diff --git a/tools/idl_parser/test_parser/interface_web.idl b/tools/idl_parser/test_parser/interface_web.idl index 698ea50e..b8671ff 100644 --- a/tools/idl_parser/test_parser/interface_web.idl +++ b/tools/idl_parser/test_parser/interface_web.idl
@@ -308,10 +308,29 @@ * PrimitiveType(double) * Type() * StringType(DOMString) + * Iterable() + * Type() + * PrimitiveType(long) + * ExtAttributes() + * ExtAttribute(Clamp) + * Iterable() + * Type() + * StringType(DOMString) + * ExtAttributes() + * ExtAttribute(TreatNullAs) = "EmptyString" + * Iterable() + * Type() + * PrimitiveType(long) + * ExtAttributes() + * ExtAttribute(Clamp) + * ExtAttribute(XAttr) */ interface MyIfaceIterable { iterable<long>; iterable<double, DOMString>; + iterable<[Clamp] long>; + iterable<[TreatNullAs=EmptyString] DOMString>; + iterable<[Clamp, XAttr] long>; }; /** TREE
diff --git a/tools/ipc_fuzzer/message_tools/message_list.cc b/tools/ipc_fuzzer/message_tools/message_list.cc index f6ece6ee..5e701f03 100644 --- a/tools/ipc_fuzzer/message_tools/message_list.cc +++ b/tools/ipc_fuzzer/message_tools/message_list.cc
@@ -83,10 +83,6 @@ exemptions.push_back(OzoneGpuMsgStart); #endif // !defined(USE_OZONE) -#if !defined(OS_WIN) && !defined(OS_MACOSX) - exemptions.push_back(ChromeUtilityExtensionsMsgStart); -#endif - #if !defined(OS_WIN) exemptions.push_back(DWriteFontProxyMsgStart); #endif
diff --git a/tools/lldb/OWNERS b/tools/lldb/OWNERS new file mode 100644 index 0000000..dd32882 --- /dev/null +++ b/tools/lldb/OWNERS
@@ -0,0 +1,4 @@ +jzw@chromium.org +ichikawa@chromium.org + +# COMPONENT: Tools
diff --git a/tools/lldb/lldb_chrome.py b/tools/lldb/lldb_chrome.py new file mode 100644 index 0000000..2c93d34 --- /dev/null +++ b/tools/lldb/lldb_chrome.py
@@ -0,0 +1,36 @@ +# Copyright (c) 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. + +""" + LLDB Support for Chromium types in Xcode + + Add the following to your ~/.lldbinit: + command script import {Path to SRC Root}/tools/lldb/lldb_chrome.py +""" + +import lldb + +def __lldb_init_module(debugger, internal_dict): + debugger.HandleCommand('type summary add -F ' + + 'lldb_chrome.basestring16_SummaryProvider base::string16') + +# This is highly dependent on libc++ being compiled with little endian. +def basestring16_SummaryProvider(valobj, internal_dict): + s = valobj.GetValueForExpressionPath('.__r_.__first_.__s') + l = valobj.GetValueForExpressionPath('.__r_.__first_.__l') + size = s.GetChildMemberWithName('__size_').GetValueAsUnsigned(0) + is_short_string = size & 1 == 0 + if is_short_string: + length = size >> 1 + data = s.GetChildMemberWithName('__data_').GetPointeeData(0, length) + else: + length = l.GetChildMemberWithName('__size_').GetValueAsUnsigned(0) + data = l.GetChildMemberWithName('__data_').GetPointeeData(0, length) + error = lldb.SBError() + bytes_to_read = 2 * length + byte_string = data.ReadRawData(error, 0, bytes_to_read) + if error.fail: + return 'Summary error: %s' % error.description + else: + return '"' + byte_string.decode('utf-16').encode('utf-8') + '"'
diff --git a/ui/accelerated_widget_mac/window_resize_helper_mac.cc b/ui/accelerated_widget_mac/window_resize_helper_mac.cc index 9d6c944..6079d8fc 100644 --- a/ui/accelerated_widget_mac/window_resize_helper_mac.cc +++ b/ui/accelerated_widget_mac/window_resize_helper_mac.cc
@@ -65,7 +65,7 @@ const scoped_refptr<base::SingleThreadTaskRunner>& target_task_runner); // Enqueue WrappedTask and post it to |target_task_runner_|. - bool EnqueueAndPostWrappedTask(const tracked_objects::Location& from_here, + bool EnqueueAndPostWrappedTask(const base::Location& from_here, WrappedTask* task, base::TimeDelta delay); @@ -73,11 +73,11 @@ bool WaitForSingleWrappedTaskToRun(const base::TimeDelta& max_delay); // base::SingleThreadTaskRunner implementation: - bool PostDelayedTask(const tracked_objects::Location& from_here, + bool PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; - bool PostNonNestableDelayedTask(const tracked_objects::Location& from_here, + bool PostNonNestableDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) override; @@ -241,7 +241,7 @@ } bool PumpableTaskRunner::EnqueueAndPostWrappedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, WrappedTask* task, base::TimeDelta delay) { task->AddToTaskRunnerQueue(this); @@ -258,16 +258,15 @@ //////////////////////////////////////////////////////////////////////////////// // PumpableTaskRunner, base::SingleThreadTaskRunner implementation: -bool PumpableTaskRunner::PostDelayedTask( - const tracked_objects::Location& from_here, - base::OnceClosure task, - base::TimeDelta delay) { +bool PumpableTaskRunner::PostDelayedTask(const base::Location& from_here, + base::OnceClosure task, + base::TimeDelta delay) { return EnqueueAndPostWrappedTask( from_here, new WrappedTask(std::move(task), delay), delay); } bool PumpableTaskRunner::PostNonNestableDelayedTask( - const tracked_objects::Location& from_here, + const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { // The correctness of non-nestable events hasn't been proven for this
diff --git a/ui/views/touchui/touch_selection_controller_impl_unittest.cc b/ui/views/touchui/touch_selection_controller_impl_unittest.cc index 27be28e..e8463f4 100644 --- a/ui/views/touchui/touch_selection_controller_impl_unittest.cc +++ b/ui/views/touchui/touch_selection_controller_impl_unittest.cc
@@ -238,7 +238,7 @@ // handle 1's position is matched against the start of selection or the end. void VerifyHandlePositions(bool cursor_at_selection_handle_1, bool check_direction, - const tracked_objects::Location& from_here) { + const base::Location& from_here) { gfx::SelectionBound anchor, focus; textfield_->GetSelectionEndPoints(&anchor, &focus); std::string from_str = from_here.ToString();