Commit cd52a866 authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

service worker: Conform to CamelCase() function naming convention.

No behavior change. According to the Blink C++ style guide, functions
that aren't for web-exposed bindings must be uppercase CamelCase().
Also order some functions to match the idl.

Change-Id: I7def926826a352929db20d96d7b74460d7e074c0
Reviewed-on: https://chromium-review.googlesource.com/c/1325577Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606364}
parent b8bc2026
......@@ -51,17 +51,6 @@ ExtendableMessageEvent* ExtendableMessageEvent::Create(
return event;
}
MessagePortArray ExtendableMessageEvent::ports() const {
// TODO(bashi): Currently we return a copied array because the binding
// layer could modify the content of the array while executing JS callbacks.
// Avoid copying once we can make sure that the binding layer won't
// modify the content.
if (ports_) {
return *ports_;
}
return MessagePortArray();
}
void ExtendableMessageEvent::source(
ClientOrServiceWorkerOrMessagePort& result) const {
if (source_as_client_)
......@@ -76,6 +65,17 @@ void ExtendableMessageEvent::source(
result = ClientOrServiceWorkerOrMessagePort();
}
MessagePortArray ExtendableMessageEvent::ports() const {
// TODO(bashi): Currently we return a copied array because the binding
// layer could modify the content of the array while executing JS callbacks.
// Avoid copying once we can make sure that the binding layer won't
// modify the content.
if (ports_) {
return *ports_;
}
return MessagePortArray();
}
const AtomicString& ExtendableMessageEvent::InterfaceName() const {
return event_interface_names::kExtendableMessageEvent;
}
......
......@@ -47,10 +47,11 @@ class MODULES_EXPORT ExtendableMessageEvent final : public ExtendableEvent {
void SetSerializedData(scoped_refptr<SerializedScriptValue> serialized_data) {
serialized_data_ = std::move(serialized_data);
}
const String& origin() const { return origin_; }
const String& lastEventId() const { return last_event_id_; }
MessagePortArray ports() const;
void source(ClientOrServiceWorkerOrMessagePort& result) const;
MessagePortArray ports() const;
const AtomicString& InterfaceName() const override;
......
......@@ -97,11 +97,11 @@ class Receiver {
watcher_.ArmOrNotify();
}
bool is_running() const { return handle_.is_valid(); }
bool has_received_all_data() const { return remaining_bytes_ == 0; }
bool IsRunning() const { return handle_.is_valid(); }
bool HasReceivedAllData() const { return remaining_bytes_ == 0; }
Vector<BytesChunk> TakeChunks() {
DCHECK(!is_running());
DCHECK(!IsRunning());
return std::move(chunks_);
}
......@@ -109,7 +109,7 @@ class Receiver {
void OnCompleted() {
handle_.reset();
watcher_.Cancel();
if (!has_received_all_data())
if (!HasReceivedAllData())
chunks_.clear();
DCHECK(callback_);
std::move(callback_).Run();
......@@ -207,8 +207,8 @@ class Internal : public mojom::blink::ServiceWorkerInstalledScriptsManager {
DCHECK(iter != running_receivers_.end());
std::unique_ptr<BundledReceivers> receivers = std::move(iter->value);
DCHECK(receivers);
if (!receivers->body()->has_received_all_data() ||
!receivers->meta_data()->has_received_all_data()) {
if (!receivers->body()->HasReceivedAllData() ||
!receivers->meta_data()->HasReceivedAllData()) {
script_container_->AddOnIOThread(script_info->script_url,
nullptr /* data */);
running_receivers_.erase(iter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment