diff --git a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java index 9ce6fe0..1263d5e 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/media/ui/MediaNotificationManager.java
@@ -80,13 +80,13 @@ private static final int COMPACT_VIEW_ACTIONS_COUNT = 3; // The maximum number of actions in BigView media notification. - private static final int BIG_VIEW_ACTIONS_COUNT = isRunningN() ? 5 : 3; + private static final int BIG_VIEW_ACTIONS_COUNT = 5; // Maps the notification ids to their corresponding notification managers. private static SparseArray<MediaNotificationManager> sManagers; // Overrides N detection. The production code will use |null|, which uses the Android version - // code. Otherwise, |isRunningN()| will return whatever value is set. + // code. Otherwise, |isRunningAtLeastN()| will return whatever value is set. @VisibleForTesting static Boolean sOverrideIsRunningNForTesting; @@ -708,7 +708,7 @@ sManagers.put(notificationId, manager); } - private static boolean isRunningN() { + private static boolean isRunningAtLeastN() { return (sOverrideIsRunningNForTesting != null) ? sOverrideIsRunningNForTesting : Build.VERSION.SDK_INT >= Build.VERSION_CODES.N; @@ -1067,7 +1067,7 @@ builder.setLargeIcon(null); } else if (mMediaNotificationInfo.notificationLargeIcon != null) { builder.setLargeIcon(mMediaNotificationInfo.notificationLargeIcon); - } else if (!isRunningN()) { + } else if (!isRunningAtLeastN()) { if (mDefaultNotificationLargeIcon == null) { int resourceId = (mMediaNotificationInfo.defaultNotificationLargeIcon != 0) ? mMediaNotificationInfo.defaultNotificationLargeIcon @@ -1127,7 +1127,7 @@ private void setMediaStyleNotificationText(ChromeNotificationBuilder builder) { builder.setContentTitle(mMediaNotificationInfo.metadata.getTitle()); String artistAndAlbumText = getArtistAndAlbumText(mMediaNotificationInfo.metadata); - if (isRunningN() || !artistAndAlbumText.isEmpty()) { + if (isRunningAtLeastN() || !artistAndAlbumText.isEmpty()) { builder.setContentText(artistAndAlbumText); builder.setSubText(mMediaNotificationInfo.origin); } else { @@ -1150,9 +1150,6 @@ * * The method assumes STOP cannot coexist with switch track actions and seeking actions. It also * assumes PLAY and PAUSE cannot coexist. - * - * TODO(zqzhang): get UX feedback to decide which actions to select when the number of actions - * is greater than that can be displayed. See https://crbug.com/667500 */ private List<Integer> computeBigViewActions(Set<Integer> actions) { // STOP cannot coexist with switch track actions and seeking actions. @@ -1164,6 +1161,8 @@ // PLAY and PAUSE cannot coexist. assert !actions.contains(MediaSessionAction.PLAY) || !actions.contains(MediaSessionAction.PAUSE); + // There can't be move actions than BIG_VIEW_ACTIONS_COUNT. + assert actions.size() <= BIG_VIEW_ACTIONS_COUNT; int[] actionByOrder = { MediaSessionAction.PREVIOUS_TRACK, @@ -1175,35 +1174,10 @@ CUSTOM_MEDIA_SESSION_ACTION_STOP, }; - // First, select at most |BIG_VIEW_ACTIONS_COUNT| actions by priority. - Set<Integer> selectedActions; - if (actions.size() <= BIG_VIEW_ACTIONS_COUNT) { - selectedActions = actions; - } else { - selectedActions = new HashSet<>(); - if (actions.contains(CUSTOM_MEDIA_SESSION_ACTION_STOP)) { - selectedActions.add(CUSTOM_MEDIA_SESSION_ACTION_STOP); - } else { - if (actions.contains(MediaSessionAction.PLAY)) { - selectedActions.add(MediaSessionAction.PLAY); - } else { - selectedActions.add(MediaSessionAction.PAUSE); - } - if (actions.contains(MediaSessionAction.PREVIOUS_TRACK) - && actions.contains(MediaSessionAction.NEXT_TRACK)) { - selectedActions.add(MediaSessionAction.PREVIOUS_TRACK); - selectedActions.add(MediaSessionAction.NEXT_TRACK); - } else { - selectedActions.add(MediaSessionAction.SEEK_BACKWARD); - selectedActions.add(MediaSessionAction.SEEK_FORWARD); - } - } - } - - // Second, sort the selected actions. + // Sort the actions based on the expected ordering in the UI. List<Integer> sortedActions = new ArrayList<>(); for (int action : actionByOrder) { - if (selectedActions.contains(action)) sortedActions.add(action); + if (actions.contains(action)) sortedActions.add(action); } return sortedActions;
diff --git a/device/u2f/u2f_hid_device.cc b/device/u2f/u2f_hid_device.cc index cc0200e..05944dc 100644 --- a/device/u2f/u2f_hid_device.cc +++ b/device/u2f/u2f_hid_device.cc
@@ -21,6 +21,11 @@ static constexpr char kEnableU2fHidTest[] = "enable-u2f-hid-tests"; } // namespace switches +namespace { +// U2F devices only provide a single report so specify a report ID of 0 here. +static constexpr uint8_t kReportId = 0x00; +} // namespace + U2fHidDevice::U2fHidDevice(device::mojom::HidDeviceInfoPtr device_info, device::mojom::HidManager* hid_manager) : U2fDevice(), @@ -173,11 +178,11 @@ } scoped_refptr<net::IOBufferWithSize> io_buffer = message->PopNextPacket(); - std::vector<uint8_t> buffer(io_buffer->data() + 1, + std::vector<uint8_t> buffer(io_buffer->data(), io_buffer->data() + io_buffer->size()); connection_->Write( - 0 /* report_id */, buffer, + kReportId, buffer, base::BindOnce(&U2fHidDevice::PacketWritten, weak_factory_.GetWeakPtr(), std::move(message), true, std::move(callback))); }
diff --git a/device/u2f/u2f_message_unittest.cc b/device/u2f/u2f_message_unittest.cc index 5246a53c..7ebb5c3 100644 --- a/device/u2f/u2f_message_unittest.cc +++ b/device/u2f/u2f_message_unittest.cc
@@ -19,11 +19,11 @@ auto init_packet = std::make_unique<U2fInitPacket>(channel_id, 0, data, data.size()); - EXPECT_EQ(65, init_packet->GetSerializedData()->size()); + EXPECT_EQ(64, init_packet->GetSerializedData()->size()); auto continuation_packet = std::make_unique<U2fContinuationPacket>(channel_id, 0, data); - EXPECT_EQ(65, continuation_packet->GetSerializedData()->size()); + EXPECT_EQ(64, continuation_packet->GetSerializedData()->size()); } /* @@ -46,7 +46,6 @@ scoped_refptr<net::IOBufferWithSize> serialized = init_packet->GetSerializedData(); - EXPECT_EQ(0, serialized->data()[index++]); EXPECT_EQ((channel_id >> 24) & 0xff, static_cast<uint8_t>(serialized->data()[index++])); EXPECT_EQ((channel_id >> 16) & 0xff,
diff --git a/device/u2f/u2f_packet.cc b/device/u2f/u2f_packet.cc index 529b0aa..ee6cc3d 100644 --- a/device/u2f/u2f_packet.cc +++ b/device/u2f/u2f_packet.cc
@@ -41,8 +41,6 @@ auto serialized = base::WrapRefCounted(new net::IOBufferWithSize(kPacketSize)); size_t index = 0; - // Byte at offset 0 is the report ID, which is always 0 - serialized->data()[index++] = 0; serialized->data()[index++] = (channel_id_ >> 24) & 0xff; serialized->data()[index++] = (channel_id_ >> 16) & 0xff; serialized->data()[index++] = (channel_id_ >> 8) & 0xff; @@ -70,16 +68,15 @@ U2fInitPacket::U2fInitPacket(const std::vector<uint8_t>& serialized, size_t* remaining_size) { - // Report ID is at index 0, so start at index 1 for channel ID - size_t index = 1; - uint16_t payload_size = 0; - + // The serialized buffer starts with channel ID. + size_t index = 0; channel_id_ = (serialized[index++] & 0xff) << 24; channel_id_ |= (serialized[index++] & 0xff) << 16; channel_id_ |= (serialized[index++] & 0xff) << 8; channel_id_ |= serialized[index++] & 0xff; command_ = serialized[index++]; - payload_size = serialized[index++] << 8; + + uint16_t payload_size = serialized[index++] << 8; payload_size |= serialized[index++]; payload_length_ = payload_size; @@ -110,8 +107,6 @@ auto serialized = base::WrapRefCounted(new net::IOBufferWithSize(kPacketSize)); size_t index = 0; - // Byte at offset 0 is the report ID, which is always 0 - serialized->data()[index++] = 0; serialized->data()[index++] = (channel_id_ >> 24) & 0xff; serialized->data()[index++] = (channel_id_ >> 16) & 0xff; serialized->data()[index++] = (channel_id_ >> 8) & 0xff; @@ -139,10 +134,8 @@ U2fContinuationPacket::U2fContinuationPacket( const std::vector<uint8_t>& serialized, size_t* remaining_size) { - // Report ID is at index 0, so start at index 1 for channel ID - size_t index = 1; - size_t data_size; - + // The serialized buffer starts with channel ID. + size_t index = 0; channel_id_ = (serialized[index++] & 0xff) << 24; channel_id_ |= (serialized[index++] & 0xff) << 16; channel_id_ |= (serialized[index++] & 0xff) << 8; @@ -150,7 +143,7 @@ sequence_ = serialized[index++]; // Check to see if packet payload is less than maximum size and padded with 0s - data_size = std::min(*remaining_size, kPacketSize - index); + size_t data_size = std::min(*remaining_size, kPacketSize - index); *remaining_size -= data_size; data_.insert(data_.end(), serialized.begin() + index, serialized.begin() + index + data_size);
diff --git a/device/u2f/u2f_packet.h b/device/u2f/u2f_packet.h index ee023b6..ea517c07 100644 --- a/device/u2f/u2f_packet.h +++ b/device/u2f/u2f_packet.h
@@ -35,8 +35,8 @@ protected: U2fPacket(); - // Packet size of 64 bytes + 1 byte report ID - static constexpr size_t kPacketSize = 65; + // Packet size of 64 bytes. + static constexpr size_t kPacketSize = 64; std::vector<uint8_t> data_; uint32_t channel_id_;
diff --git a/media/gpu/vaapi_video_decode_accelerator.cc b/media/gpu/vaapi_video_decode_accelerator.cc index 608959e..d98d5a29 100644 --- a/media/gpu/vaapi_video_decode_accelerator.cc +++ b/media/gpu/vaapi_video_decode_accelerator.cc
@@ -95,8 +95,8 @@ friend class base::RefCountedThreadSafe<VaapiDecodeSurface>; ~VaapiDecodeSurface(); - int32_t bitstream_id_; - scoped_refptr<VASurface> va_surface_; + const int32_t bitstream_id_; + const scoped_refptr<VASurface> va_surface_; gfx::Rect visible_rect_; }; @@ -109,9 +109,9 @@ class VaapiH264Picture : public H264Picture { public: - VaapiH264Picture( - const scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>& - dec_surface); + explicit VaapiH264Picture( + scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> surface) + : dec_surface_(surface) {} VaapiH264Picture* AsVaapiH264Picture() override { return this; } scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> dec_surface() { @@ -119,20 +119,13 @@ } private: - ~VaapiH264Picture() override; + ~VaapiH264Picture() override {} scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> dec_surface_; DISALLOW_COPY_AND_ASSIGN(VaapiH264Picture); }; -VaapiH264Picture::VaapiH264Picture( - const scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>& - dec_surface) - : dec_surface_(dec_surface) {} - -VaapiH264Picture::~VaapiH264Picture() {} - class VaapiVideoDecodeAccelerator::VaapiH264Accelerator : public H264Decoder::H264Accelerator { public: @@ -181,9 +174,9 @@ class VaapiVP8Picture : public VP8Picture { public: - VaapiVP8Picture( - const scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>& - dec_surface); + explicit VaapiVP8Picture( + scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> surface) + : dec_surface_(surface) {} VaapiVP8Picture* AsVaapiVP8Picture() override { return this; } scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> dec_surface() { @@ -191,20 +184,13 @@ } private: - ~VaapiVP8Picture() override; + ~VaapiVP8Picture() override {} scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> dec_surface_; DISALLOW_COPY_AND_ASSIGN(VaapiVP8Picture); }; -VaapiVP8Picture::VaapiVP8Picture( - const scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>& - dec_surface) - : dec_surface_(dec_surface) {} - -VaapiVP8Picture::~VaapiVP8Picture() {} - class VaapiVideoDecodeAccelerator::VaapiVP8Accelerator : public VP8Decoder::VP8Accelerator { public: @@ -235,9 +221,9 @@ class VaapiVP9Picture : public VP9Picture { public: - VaapiVP9Picture( - const scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>& - dec_surface); + explicit VaapiVP9Picture( + scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> surface) + : dec_surface_(surface) {} VaapiVP9Picture* AsVaapiVP9Picture() override { return this; } scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> dec_surface() { @@ -245,20 +231,13 @@ } private: - ~VaapiVP9Picture() override; + ~VaapiVP9Picture() override {} scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface> dec_surface_; DISALLOW_COPY_AND_ASSIGN(VaapiVP9Picture); }; -VaapiVP9Picture::VaapiVP9Picture( - const scoped_refptr<VaapiVideoDecodeAccelerator::VaapiDecodeSurface>& - dec_surface) - : dec_surface_(dec_surface) {} - -VaapiVP9Picture::~VaapiVP9Picture() {} - class VaapiVideoDecodeAccelerator::VaapiVP9Accelerator : public VP9Decoder::VP9Accelerator { public: @@ -293,6 +272,7 @@ }; VaapiVideoDecodeAccelerator::InputBuffer::InputBuffer() = default; + VaapiVideoDecodeAccelerator::InputBuffer::~InputBuffer() = default; void VaapiVideoDecodeAccelerator::NotifyError(Error error) { @@ -1194,7 +1174,7 @@ if (!va_surface) return nullptr; - return new VaapiH264Picture(va_surface); + return new VaapiH264Picture(std::move(va_surface)); } // Fill |va_pic| with default/neutral values. @@ -1527,7 +1507,7 @@ if (!va_surface) return nullptr; - return new VaapiVP8Picture(va_surface); + return new VaapiVP8Picture(std::move(va_surface)); } #define ARRAY_MEMCPY_CHECKED(to, from) \ @@ -1756,7 +1736,7 @@ if (!va_surface) return nullptr; - return new VaapiVP9Picture(va_surface); + return new VaapiVP9Picture(std::move(va_surface)); } bool VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::SubmitDecode(
diff --git a/net/quic/core/quic_client_promised_info.cc b/net/quic/core/quic_client_promised_info.cc index fb829f0..f6f5ef3 100644 --- a/net/quic/core/quic_client_promised_info.cc +++ b/net/quic/core/quic_client_promised_info.cc
@@ -43,7 +43,11 @@ // RFC7540, Section 8.2, requests MUST be safe [RFC7231], Section // 4.2.1. GET and HEAD are the methods that are safe and required. SpdyHeaderBlock::const_iterator it = headers.find(kHttp2MethodHeader); - DCHECK(it != headers.end()); + if (it == headers.end()) { + QUIC_DVLOG(1) << "Promise for stream " << id_ << " has no method"; + Reset(QUIC_INVALID_PROMISE_METHOD); + return; + } if (!(it->second == "GET" || it->second == "HEAD")) { QUIC_DVLOG(1) << "Promise for stream " << id_ << " has invalid method " << it->second;
diff --git a/net/quic/core/quic_client_promised_info_test.cc b/net/quic/core/quic_client_promised_info_test.cc index 70d0ac6..9d5d758 100644 --- a/net/quic/core/quic_client_promised_info_test.cc +++ b/net/quic/core/quic_client_promised_info_test.cc
@@ -154,6 +154,19 @@ EXPECT_EQ(session_.GetPromisedByUrl(promise_url_), nullptr); } +TEST_F(QuicClientPromisedInfoTest, PushPromiseMissingMethod) { + // Promise with a missing method + push_promise_.erase(":method"); + + EXPECT_CALL(*connection_, + SendRstStream(promise_id_, QUIC_INVALID_PROMISE_METHOD, 0)); + ReceivePromise(promise_id_); + + // Verify that the promise headers were ignored + EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); + EXPECT_EQ(session_.GetPromisedByUrl(promise_url_), nullptr); +} + TEST_F(QuicClientPromisedInfoTest, PushPromiseInvalidUrl) { // Remove required header field to make URL invalid push_promise_.erase(":authority");
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h index 7f88f59..7db3daa 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolver.h
@@ -37,7 +37,7 @@ public: static ScriptPromiseResolver* Create(ScriptState* script_state) { ScriptPromiseResolver* resolver = new ScriptPromiseResolver(script_state); - resolver->SuspendIfNeeded(); + resolver->PauseIfNeeded(); return resolver; }
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp index e8fa7bd6..2045438 100644 --- a/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp +++ b/third_party/WebKit/Source/bindings/core/v8/ScriptPromiseResolverTest.cpp
@@ -201,7 +201,7 @@ static ScriptPromiseResolverKeepAlive* Create(ScriptState* script_state) { ScriptPromiseResolverKeepAlive* resolver = new ScriptPromiseResolverKeepAlive(script_state); - resolver->SuspendIfNeeded(); + resolver->PauseIfNeeded(); return resolver; }
diff --git a/third_party/WebKit/Source/core/css/FontFaceSetDocument.cpp b/third_party/WebKit/Source/core/css/FontFaceSetDocument.cpp index e0c341b..0c7aa7f 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSetDocument.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceSetDocument.cpp
@@ -45,7 +45,7 @@ FontFaceSetDocument::FontFaceSetDocument(Document& document) : FontFaceSet(document), Supplement<Document>(document) { - SuspendIfNeeded(); + PauseIfNeeded(); } FontFaceSetDocument::~FontFaceSetDocument() {}
diff --git a/third_party/WebKit/Source/core/css/FontFaceSetWorker.cpp b/third_party/WebKit/Source/core/css/FontFaceSetWorker.cpp index ddeaf6b..17c03da 100644 --- a/third_party/WebKit/Source/core/css/FontFaceSetWorker.cpp +++ b/third_party/WebKit/Source/core/css/FontFaceSetWorker.cpp
@@ -23,7 +23,7 @@ FontFaceSetWorker::FontFaceSetWorker(WorkerGlobalScope& worker) : FontFaceSet(worker), Supplement<WorkerGlobalScope>(worker) { - SuspendIfNeeded(); + PauseIfNeeded(); } FontFaceSetWorker::~FontFaceSetWorker() {}
diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp index 9271a31..5210586 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.cpp
@@ -27,7 +27,7 @@ #include "core/dom/ContextLifecycleNotifier.h" -#include "core/dom/SuspendableObject.h" +#include "core/dom/PausableObject.h" #include "platform/wtf/AutoReset.h" namespace blink { @@ -38,13 +38,12 @@ if (observer->ObserverType() != ContextLifecycleObserver::kSuspendableObjectType) continue; - SuspendableObject* suspendable_object = - static_cast<SuspendableObject*>(observer); + PausableObject* pausable_object = static_cast<PausableObject*>(observer); #if DCHECK_IS_ON() - DCHECK_EQ(suspendable_object->GetExecutionContext(), Context()); - DCHECK(suspendable_object->SuspendIfNeededCalled()); + DCHECK_EQ(pausable_object->GetExecutionContext(), Context()); + DCHECK(pausable_object->PauseIfNeededCalled()); #endif - suspendable_object->Resume(); + pausable_object->Unpause(); } } @@ -54,26 +53,25 @@ if (observer->ObserverType() != ContextLifecycleObserver::kSuspendableObjectType) continue; - SuspendableObject* suspendable_object = - static_cast<SuspendableObject*>(observer); + PausableObject* pausable_object = static_cast<PausableObject*>(observer); #if DCHECK_IS_ON() - DCHECK_EQ(suspendable_object->GetExecutionContext(), Context()); - DCHECK(suspendable_object->SuspendIfNeededCalled()); + DCHECK_EQ(pausable_object->GetExecutionContext(), Context()); + DCHECK(pausable_object->PauseIfNeededCalled()); #endif - suspendable_object->Suspend(); + pausable_object->Pause(); } } unsigned ContextLifecycleNotifier::SuspendableObjectCount() const { DCHECK(!IsIteratingOverObservers()); - unsigned suspendable_objects = 0; + unsigned pausable_objects = 0; for (ContextLifecycleObserver* observer : observers_) { if (observer->ObserverType() != ContextLifecycleObserver::kSuspendableObjectType) continue; - suspendable_objects++; + pausable_objects++; } - return suspendable_objects; + return pausable_objects; } #if DCHECK_IS_ON() @@ -83,9 +81,8 @@ if (observer->ObserverType() != ContextLifecycleObserver::kSuspendableObjectType) continue; - SuspendableObject* suspendable_object = - static_cast<SuspendableObject*>(observer); - if (suspendable_object == object) + PausableObject* pausable_object = static_cast<PausableObject*>(observer); + if (pausable_object == object) return true; } return false;
diff --git a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h index 09110532..dfc561f 100644 --- a/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h +++ b/third_party/WebKit/Source/core/dom/ContextLifecycleNotifier.h
@@ -59,7 +59,7 @@ ContextLifecycleNotifier() {} #if DCHECK_IS_ON() - bool Contains(SuspendableObject*) const; + bool Contains(PausableObject*) const; #endif };
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp index 04998a84..41edacf 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.cpp +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.cpp
@@ -29,7 +29,7 @@ #include "bindings/core/v8/SourceLocation.h" #include "bindings/core/v8/V8BindingForCore.h" -#include "core/dom/SuspendableObject.h" +#include "core/dom/PausableObject.h" #include "core/dom/TaskRunnerHelper.h" #include "core/dom/events/EventTarget.h" #include "core/events/ErrorEvent.h" @@ -48,7 +48,7 @@ ExecutionContext::ExecutionContext() : circular_sequential_id_(0), in_dispatch_error_event_(false), - is_context_suspended_(false), + is_context_paused_(false), is_context_destroyed_(false), window_interaction_tokens_(0), referrer_policy_(kReferrerPolicyDefault) {} @@ -74,14 +74,14 @@ } void ExecutionContext::SuspendSuspendableObjects() { - DCHECK(!is_context_suspended_); + DCHECK(!is_context_paused_); NotifySuspendingSuspendableObjects(); - is_context_suspended_ = true; + is_context_paused_ = true; } void ExecutionContext::ResumeSuspendableObjects() { - DCHECK(is_context_suspended_); - is_context_suspended_ = false; + DCHECK(is_context_paused_); + is_context_paused_ = false; NotifyResumingSuspendableObjects(); } @@ -105,9 +105,9 @@ #if DCHECK_IS_ON() DCHECK(Contains(object)); #endif - // Ensure all SuspendableObjects are suspended also newly created ones. - if (is_context_suspended_) - object->Suspend(); + // Ensure all PausableObjects are suspended also newly created ones. + if (is_context_paused_) + object->Pause(); } bool ExecutionContext::ShouldSanitizeScriptError(
diff --git a/third_party/WebKit/Source/core/dom/ExecutionContext.h b/third_party/WebKit/Source/core/dom/ExecutionContext.h index 93dd8cb..df67aaa 100644 --- a/third_party/WebKit/Source/core/dom/ExecutionContext.h +++ b/third_party/WebKit/Source/core/dom/ExecutionContext.h
@@ -152,13 +152,14 @@ virtual void TasksWereSuspended() {} virtual void TasksWereResumed() {} - bool IsContextSuspended() const { return is_context_suspended_; } + // TODO(hajimehoshi): Rename this to IsContextPaused (crbug/780378) + bool IsContextSuspended() const { return is_context_paused_; } bool IsContextDestroyed() const { return is_context_destroyed_; } - // Called after the construction of an SuspendableObject to synchronize + // Called after the construction of an PausableObject to synchronize // suspend // state. - void SuspendSuspendableObjectIfNeeded(SuspendableObject*); + void SuspendSuspendableObjectIfNeeded(PausableObject*); // Gets the next id in a circular sequence from 1 to 2^31-1. int CircularSequentialID(); @@ -211,7 +212,7 @@ bool in_dispatch_error_event_; HeapVector<Member<ErrorEvent>> pending_exceptions_; - bool is_context_suspended_; + bool is_context_paused_; bool is_context_destroyed_; Member<PublicURLManager> public_url_manager_;
diff --git a/third_party/WebKit/Source/core/dom/PausableObject.cpp b/third_party/WebKit/Source/core/dom/PausableObject.cpp index 922a5309..f2556c0 100644 --- a/third_party/WebKit/Source/core/dom/PausableObject.cpp +++ b/third_party/WebKit/Source/core/dom/PausableObject.cpp
@@ -35,7 +35,7 @@ : ContextLifecycleObserver(execution_context, kSuspendableObjectType) #if DCHECK_IS_ON() , - suspend_if_needed_called_(false) + pause_if_needed_called_(false) #endif { DCHECK(!execution_context || execution_context->IsContextThread()); @@ -48,14 +48,14 @@ InstanceCounters::kSuspendableObjectCounter); #if DCHECK_IS_ON() - DCHECK(suspend_if_needed_called_); + DCHECK(pause_if_needed_called_); #endif } -void PausableObject::SuspendIfNeeded() { +void PausableObject::PauseIfNeeded() { #if DCHECK_IS_ON() - DCHECK(!suspend_if_needed_called_); - suspend_if_needed_called_ = true; + DCHECK(!pause_if_needed_called_); + pause_if_needed_called_ = true; #endif if (ExecutionContext* context = GetExecutionContext()) context->SuspendSuspendableObjectIfNeeded(this);
diff --git a/third_party/WebKit/Source/core/dom/PausableObject.h b/third_party/WebKit/Source/core/dom/PausableObject.h index ad42ed35..0a2089d 100644 --- a/third_party/WebKit/Source/core/dom/PausableObject.h +++ b/third_party/WebKit/Source/core/dom/PausableObject.h
@@ -37,27 +37,31 @@ public: explicit PausableObject(ExecutionContext*); - // suspendIfNeeded() should be called exactly once after object construction + // PauseIfNeeded() should be called exactly once after object construction // to synchronize the suspend state with that in ExecutionContext. - void SuspendIfNeeded(); + void PauseIfNeeded(); #if DCHECK_IS_ON() - bool SuspendIfNeededCalled() const { return suspend_if_needed_called_; } + bool PauseIfNeededCalled() const { return pause_if_needed_called_; } #endif // These methods have an empty default implementation so that subclasses // which don't need special treatment can skip implementation. - // TODO(hajimehoshi): Rename Suspend to Pause (crbug/780378) - virtual void Suspend(); - virtual void Resume(); + void Pause() { Suspend(); } + void Unpause() { Resume(); } void DidMoveToNewExecutionContext(ExecutionContext*); protected: virtual ~PausableObject(); + // TODO(hajimehoshi): Suspend/Resume are for backward compatibility. Replace + // them with Pause/Unpause. See crbug/780378 + virtual void Suspend(); + virtual void Resume(); + private: #if DCHECK_IS_ON() - bool suspend_if_needed_called_; + bool pause_if_needed_called_; #endif };
diff --git a/third_party/WebKit/Source/core/dom/PausableObjectTest.cpp b/third_party/WebKit/Source/core/dom/PausableObjectTest.cpp index ef51ac9..50154bf 100644 --- a/third_party/WebKit/Source/core/dom/PausableObjectTest.cpp +++ b/third_party/WebKit/Source/core/dom/PausableObjectTest.cpp
@@ -75,7 +75,7 @@ dest_page_holder_(DummyPageHolder::Create(IntSize(800, 600))), pausable_object_( new MockPausableObject(&src_page_holder_->GetDocument())) { - pausable_object_->SuspendIfNeeded(); + pausable_object_->PauseIfNeeded(); } TEST_F(PausableObjectTest, NewContextObserved) {
diff --git a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp index d84cf715..de95d45 100644 --- a/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp +++ b/third_party/WebKit/Source/core/dom/ScriptedIdleTaskController.cpp
@@ -105,7 +105,7 @@ scheduler_(Platform::Current()->CurrentThread()->Scheduler()), next_callback_id_(0), suspended_(false) { - SuspendIfNeeded(); + PauseIfNeeded(); } ScriptedIdleTaskController::~ScriptedIdleTaskController() {}
diff --git a/third_party/WebKit/Source/core/dom/events/DOMWindowEventQueue.cpp b/third_party/WebKit/Source/core/dom/events/DOMWindowEventQueue.cpp index d5ed222..f9062ba8 100644 --- a/third_party/WebKit/Source/core/dom/events/DOMWindowEventQueue.cpp +++ b/third_party/WebKit/Source/core/dom/events/DOMWindowEventQueue.cpp
@@ -70,7 +70,7 @@ DOMWindowEventQueue::DOMWindowEventQueue(ExecutionContext* context) : pending_event_timer_(new DOMWindowEventQueueTimer(this, context)), is_closed_(false) { - pending_event_timer_->SuspendIfNeeded(); + pending_event_timer_->PauseIfNeeded(); } DOMWindowEventQueue::~DOMWindowEventQueue() {}
diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp index 0008471..e4841e2 100644 --- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp +++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
@@ -105,7 +105,7 @@ else StartRepeating(interval_milliseconds, BLINK_FROM_HERE); - SuspendIfNeeded(); + PauseIfNeeded(); TRACE_EVENT_INSTANT1("devtools.timeline", "TimerInstall", TRACE_EVENT_SCOPE_THREAD, "data", InspectorTimerInstallEvent::Data(context, timeout_id,
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp index 64eac2b..e8d8d96 100644 --- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp +++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -618,7 +618,7 @@ new PostMessageTimer(*this, event, std::move(target), std::move(location), UserGestureIndicator::CurrentToken()); timer->StartOneShot(0, BLINK_FROM_HERE); - timer->SuspendIfNeeded(); + timer->PauseIfNeeded(); post_message_timers_.insert(timer); }
diff --git a/third_party/WebKit/Source/core/frame/SuspendableScriptExecutor.cpp b/third_party/WebKit/Source/core/frame/SuspendableScriptExecutor.cpp index f4560ccb..d945ecc 100644 --- a/third_party/WebKit/Source/core/frame/SuspendableScriptExecutor.cpp +++ b/third_party/WebKit/Source/core/frame/SuspendableScriptExecutor.cpp
@@ -192,12 +192,12 @@ ExecutionContext* context = GetExecutionContext(); DCHECK(context); if (!context->IsContextSuspended()) { - SuspendIfNeeded(); + PauseIfNeeded(); ExecuteAndDestroySelf(); return; } StartOneShot(0, BLINK_FROM_HERE); - SuspendIfNeeded(); + PauseIfNeeded(); } void SuspendableScriptExecutor::RunAsync(BlockingOption blocking) { @@ -208,7 +208,7 @@ ToDocument(GetExecutionContext())->IncrementLoadEventDelayCount(); StartOneShot(0, BLINK_FROM_HERE); - SuspendIfNeeded(); + PauseIfNeeded(); } void SuspendableScriptExecutor::ExecuteAndDestroySelf() {
diff --git a/third_party/WebKit/Source/core/html/media/HTMLAudioElement.cpp b/third_party/WebKit/Source/core/html/media/HTMLAudioElement.cpp index 68f4701..3b92d1e1 100644 --- a/third_party/WebKit/Source/core/html/media/HTMLAudioElement.cpp +++ b/third_party/WebKit/Source/core/html/media/HTMLAudioElement.cpp
@@ -38,7 +38,7 @@ HTMLAudioElement* HTMLAudioElement::Create(Document& document) { HTMLAudioElement* audio = new HTMLAudioElement(document); audio->EnsureUserAgentShadowRoot(); - audio->SuspendIfNeeded(); + audio->PauseIfNeeded(); return audio; } @@ -50,7 +50,7 @@ audio->setPreload(AtomicString("auto")); if (!src.IsNull()) audio->SetSrc(src); - audio->SuspendIfNeeded(); + audio->PauseIfNeeded(); return audio; }
diff --git a/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp b/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp index 4493181a..daa581b 100644 --- a/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp +++ b/third_party/WebKit/Source/core/html/media/HTMLVideoElement.cpp
@@ -81,7 +81,7 @@ HTMLVideoElement* HTMLVideoElement::Create(Document& document) { HTMLVideoElement* video = new HTMLVideoElement(document); video->EnsureUserAgentShadowRoot(); - video->SuspendIfNeeded(); + video->PauseIfNeeded(); return video; }
diff --git a/third_party/WebKit/Source/core/intersection_observer/IntersectionObserverController.cpp b/third_party/WebKit/Source/core/intersection_observer/IntersectionObserverController.cpp index 2f07c53..2fd0a71 100644 --- a/third_party/WebKit/Source/core/intersection_observer/IntersectionObserverController.cpp +++ b/third_party/WebKit/Source/core/intersection_observer/IntersectionObserverController.cpp
@@ -15,7 +15,7 @@ Document* document) { IntersectionObserverController* result = new IntersectionObserverController(document); - result->SuspendIfNeeded(); + result->PauseIfNeeded(); return result; }
diff --git a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp index c16b0d8..8088755 100644 --- a/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp +++ b/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp
@@ -274,7 +274,7 @@ ? new XMLHttpRequest(context, isolate, true, world.IsolatedWorldSecurityOrigin()) : new XMLHttpRequest(context, isolate, false, nullptr); - xml_http_request->SuspendIfNeeded(); + xml_http_request->PauseIfNeeded(); return xml_http_request; } @@ -284,7 +284,7 @@ XMLHttpRequest* xml_http_request = new XMLHttpRequest(context, isolate, false, nullptr); - xml_http_request->SuspendIfNeeded(); + xml_http_request->PauseIfNeeded(); return xml_http_request; }
diff --git a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp index c1f1fd4..65523b1 100644 --- a/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp +++ b/third_party/WebKit/Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp
@@ -45,7 +45,7 @@ const String& sink_id) { SetSinkIdResolver* resolver = new SetSinkIdResolver(script_state, element, sink_id); - resolver->SuspendIfNeeded(); + resolver->PauseIfNeeded(); resolver->KeepAliveWhilePending(); return resolver; }
diff --git a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp index 8cdc50e..c5be3a1e 100644 --- a/third_party/WebKit/Source/modules/battery/BatteryManager.cpp +++ b/third_party/WebKit/Source/modules/battery/BatteryManager.cpp
@@ -15,7 +15,7 @@ BatteryManager* BatteryManager::Create(ExecutionContext* context) { BatteryManager* battery_manager = new BatteryManager(context); - battery_manager->SuspendIfNeeded(); + battery_manager->PauseIfNeeded(); return battery_manager; }
diff --git a/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp b/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp index 25b4edd..216ca0a 100644 --- a/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp +++ b/third_party/WebKit/Source/modules/crypto/CryptoResultImpl.cpp
@@ -66,7 +66,7 @@ static Resolver* Create(ScriptState* script_state, CryptoResultImpl* result) { DCHECK(script_state->ContextIsValid()); Resolver* resolver = new Resolver(script_state, result); - resolver->SuspendIfNeeded(); + resolver->PauseIfNeeded(); resolver->KeepAliveWhilePending(); return resolver; }
diff --git a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp index aee56fd..357c2e6 100644 --- a/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp +++ b/third_party/WebKit/Source/modules/encryptedmedia/HTMLMediaElementEncryptedMedia.cpp
@@ -129,7 +129,7 @@ MediaKeys* media_keys) { SetMediaKeysHandler* handler = new SetMediaKeysHandler(script_state, element, media_keys); - handler->SuspendIfNeeded(); + handler->PauseIfNeeded(); handler->KeepAliveWhilePending(); return handler->Promise(); }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp index 5f5bf71f..3b1b88da 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBOpenDBRequest.cpp
@@ -47,7 +47,7 @@ IDBRequest::AsyncTraceState metrics) { IDBOpenDBRequest* request = new IDBOpenDBRequest( script_state, callbacks, transaction_id, version, std::move(metrics)); - request->SuspendIfNeeded(); + request->PauseIfNeeded(); return request; }
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp index acce5ef0..e39f4c9 100644 --- a/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp +++ b/third_party/WebKit/Source/modules/indexeddb/IDBRequest.cpp
@@ -99,7 +99,7 @@ IDBRequest::AsyncTraceState metrics) { IDBRequest* request = new IDBRequest(script_state, source, transaction, std::move(metrics)); - request->SuspendIfNeeded(); + request->PauseIfNeeded(); // Requests associated with IDBFactory (open/deleteDatabase/getDatabaseNames) // do not have an associated transaction. if (transaction)
diff --git a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp index a7ab524..27dcc08 100644 --- a/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp +++ b/third_party/WebKit/Source/modules/mediarecorder/MediaRecorder.cpp
@@ -141,7 +141,7 @@ ExceptionState& exception_state) { MediaRecorder* recorder = new MediaRecorder( context, stream, MediaRecorderOptions(), exception_state); - recorder->SuspendIfNeeded(); + recorder->PauseIfNeeded(); return recorder; } @@ -152,7 +152,7 @@ ExceptionState& exception_state) { MediaRecorder* recorder = new MediaRecorder(context, stream, options, exception_state); - recorder->SuspendIfNeeded(); + recorder->PauseIfNeeded(); return recorder; }
diff --git a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp index d9d68aa..e57567b 100644 --- a/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp +++ b/third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp
@@ -108,7 +108,7 @@ MediaElementEventQueue* async_event_queue) { SourceBuffer* source_buffer = new SourceBuffer(std::move(web_source_buffer), source, async_event_queue); - source_buffer->SuspendIfNeeded(); + source_buffer->PauseIfNeeded(); return source_buffer; }
diff --git a/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp b/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp index 7b541d54..5427c22 100644 --- a/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp +++ b/third_party/WebKit/Source/modules/mediastream/MediaDevices.cpp
@@ -66,7 +66,7 @@ MediaDevices* MediaDevices::Create(ExecutionContext* context) { MediaDevices* media_devices = new MediaDevices(context); - media_devices->SuspendIfNeeded(); + media_devices->PauseIfNeeded(); return media_devices; }
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp index 45fb0a6..19f5d96d 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCDataChannel.cpp
@@ -59,7 +59,7 @@ std::unique_ptr<WebRTCDataChannelHandler> handler) { DCHECK(handler); RTCDataChannel* channel = new RTCDataChannel(context, std::move(handler)); - channel->SuspendIfNeeded(); + channel->PauseIfNeeded(); return channel; } @@ -78,7 +78,7 @@ return nullptr; } RTCDataChannel* channel = new RTCDataChannel(context, std::move(handler)); - channel->SuspendIfNeeded(); + channel->PauseIfNeeded(); return channel; }
diff --git a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp index 41fcb05..67fe177 100644 --- a/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp +++ b/third_party/WebKit/Source/modules/peerconnection/RTCPeerConnection.cpp
@@ -471,7 +471,7 @@ RTCPeerConnection* peer_connection = new RTCPeerConnection( context, configuration, constraints, exception_state); - peer_connection->SuspendIfNeeded(); + peer_connection->PauseIfNeeded(); if (exception_state.HadException()) return nullptr;
diff --git a/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp b/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp index a3f6bd4..a2044b5 100644 --- a/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp +++ b/third_party/WebKit/Source/modules/permissions/PermissionStatus.cpp
@@ -28,7 +28,7 @@ MojoPermissionDescriptor descriptor) { PermissionStatus* permission_status = new PermissionStatus(execution_context, status, std::move(descriptor)); - permission_status->SuspendIfNeeded(); + permission_status->PauseIfNeeded(); permission_status->StartListening(); return permission_status; }
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp index bb6a9d5..0c5ff90b 100644 --- a/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp +++ b/third_party/WebKit/Source/modules/presentation/PresentationAvailability.cpp
@@ -24,7 +24,7 @@ PresentationAvailability* presentation_availability = new PresentationAvailability(resolver->GetExecutionContext(), urls, value); - presentation_availability->SuspendIfNeeded(); + presentation_availability->PauseIfNeeded(); presentation_availability->UpdateListening(); return presentation_availability; }
diff --git a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp index 905d61635..f2dacc49 100644 --- a/third_party/WebKit/Source/modules/vr/VRDisplay.cpp +++ b/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
@@ -98,7 +98,7 @@ display_(std::move(display)), submit_frame_client_binding_(this), display_client_binding_(this, std::move(request)) { - SuspendIfNeeded(); // Initialize SuspendabaleObject. + PauseIfNeeded(); // Initialize SuspendabaleObject. } VRDisplay::~VRDisplay() {}
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp index 6b16348..2b6b4f39 100644 --- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
@@ -61,7 +61,7 @@ } AudioContext* audio_context = new AudioContext(document, latency_hint); - audio_context->SuspendIfNeeded(); + audio_context->PauseIfNeeded(); if (!AudioUtilities::IsValidAudioBufferSampleRate( audio_context->sampleRate())) {
diff --git a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp index e4cebb00..0f68b2e 100644 --- a/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp +++ b/third_party/WebKit/Source/modules/webaudio/OfflineAudioContext.cpp
@@ -92,7 +92,7 @@ OfflineAudioContext* audio_context = new OfflineAudioContext(document, number_of_channels, number_of_frames, sample_rate, exception_state); - audio_context->SuspendIfNeeded(); + audio_context->PauseIfNeeded(); #if DEBUG_AUDIONODE_REFERENCES fprintf(stderr, "[%16p]: OfflineAudioContext::OfflineAudioContext()\n",
diff --git a/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h b/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h index 3bd9284..b179726 100644 --- a/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h +++ b/third_party/WebKit/Source/modules/webmidi/MIDIAccessInitializer.h
@@ -53,7 +53,7 @@ MIDIAccessInitializer* resolver = new MIDIAccessInitializer(script_state, options); resolver->KeepAliveWhilePending(); - resolver->SuspendIfNeeded(); + resolver->PauseIfNeeded(); return resolver->Start(); }
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp index 8e73a053..122aa52 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocket.cpp
@@ -264,7 +264,7 @@ } DOMWebSocket* web_socket = new DOMWebSocket(context); - web_socket->SuspendIfNeeded(); + web_socket->PauseIfNeeded(); if (protocols.IsNull()) { Vector<String> protocols_vector;
diff --git a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp index 0bd906ae..e477a535 100644 --- a/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp +++ b/third_party/WebKit/Source/modules/websockets/DOMWebSocketTest.cpp
@@ -78,7 +78,7 @@ static DOMWebSocketWithMockChannel* Create(ExecutionContext* context) { DOMWebSocketWithMockChannel* websocket = new DOMWebSocketWithMockChannel(context); - websocket->SuspendIfNeeded(); + websocket->PauseIfNeeded(); return websocket; }