Commit b3c9dd03 authored by Miyoung Shin's avatar Miyoung Shin Committed by Commit Bot

Refactor: unsigned short/int -> uint16_t in third_party/blink/renderer/core/loader/appcache

- unsigned short/int -> uint16_t.
- No logic changes.
- Reference: https://google.github.io/styleguide/cppguide.html#Integer_Types

Bug: 929986
Change-Id: I072bdca3916a24def0ceda5915b4b45afaf1dfad
Reviewed-on: https://chromium-review.googlesource.com/c/1487760Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Miyoung Shin <myid.shin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635431}
parent 8ca9a2f2
...@@ -44,7 +44,7 @@ static const String& ErrorReasonToString(mojom::AppCacheErrorReason reason) { ...@@ -44,7 +44,7 @@ static const String& ErrorReasonToString(mojom::AppCacheErrorReason reason) {
ApplicationCacheErrorEvent::ApplicationCacheErrorEvent( ApplicationCacheErrorEvent::ApplicationCacheErrorEvent(
mojom::AppCacheErrorReason reason, mojom::AppCacheErrorReason reason,
const String& url, const String& url,
int status, uint16_t status,
const String& message) const String& message)
: Event(event_type_names::kError, Bubbles::kNo, Cancelable::kNo), : Event(event_type_names::kError, Bubbles::kNo, Cancelable::kNo),
reason_(ErrorReasonToString(reason)), reason_(ErrorReasonToString(reason)),
......
...@@ -20,7 +20,7 @@ class ApplicationCacheErrorEvent final : public Event { ...@@ -20,7 +20,7 @@ class ApplicationCacheErrorEvent final : public Event {
public: public:
ApplicationCacheErrorEvent(mojom::AppCacheErrorReason, ApplicationCacheErrorEvent(mojom::AppCacheErrorReason,
const String& url, const String& url,
int status, uint16_t status,
const String& message); const String& message);
ApplicationCacheErrorEvent(const AtomicString& event_type, ApplicationCacheErrorEvent(const AtomicString& event_type,
const ApplicationCacheErrorEventInit* initializer); const ApplicationCacheErrorEventInit* initializer);
...@@ -28,7 +28,7 @@ class ApplicationCacheErrorEvent final : public Event { ...@@ -28,7 +28,7 @@ class ApplicationCacheErrorEvent final : public Event {
static ApplicationCacheErrorEvent* Create(mojom::AppCacheErrorReason reason, static ApplicationCacheErrorEvent* Create(mojom::AppCacheErrorReason reason,
const String& url, const String& url,
int status, uint16_t status,
const String& message) { const String& message) {
return MakeGarbageCollected<ApplicationCacheErrorEvent>(reason, url, status, return MakeGarbageCollected<ApplicationCacheErrorEvent>(reason, url, status,
message); message);
...@@ -43,7 +43,7 @@ class ApplicationCacheErrorEvent final : public Event { ...@@ -43,7 +43,7 @@ class ApplicationCacheErrorEvent final : public Event {
const String& reason() const { return reason_; } const String& reason() const { return reason_; }
const String& url() const { return url_; } const String& url() const { return url_; }
int status() const { return status_; } uint16_t status() const { return status_; }
const String& message() const { return message_; } const String& message() const { return message_; }
const AtomicString& InterfaceName() const override { const AtomicString& InterfaceName() const override {
...@@ -55,7 +55,7 @@ class ApplicationCacheErrorEvent final : public Event { ...@@ -55,7 +55,7 @@ class ApplicationCacheErrorEvent final : public Event {
private: private:
String reason_; String reason_;
String url_; String url_;
int status_; uint16_t status_;
String message_; String message_;
}; };
......
...@@ -56,34 +56,34 @@ ApplicationCacheHost* ApplicationCache::GetApplicationCacheHost() const { ...@@ -56,34 +56,34 @@ ApplicationCacheHost* ApplicationCache::GetApplicationCacheHost() const {
return GetFrame()->Loader().GetDocumentLoader()->GetApplicationCacheHost(); return GetFrame()->Loader().GetDocumentLoader()->GetApplicationCacheHost();
} }
unsigned short ApplicationCache::status() const { uint16_t ApplicationCache::status() const {
// Application Cache status numeric values are specified in the HTML5 spec. // Application Cache status numeric values are specified in the HTML5 spec.
static_assert(static_cast<unsigned short>( static_assert(static_cast<uint16_t>(
mojom::AppCacheStatus::APPCACHE_STATUS_UNCACHED) == 0, mojom::AppCacheStatus::APPCACHE_STATUS_UNCACHED) == 0,
""); "");
static_assert(static_cast<unsigned short>( static_assert(
mojom::AppCacheStatus::APPCACHE_STATUS_IDLE) == 1, static_cast<uint16_t>(mojom::AppCacheStatus::APPCACHE_STATUS_IDLE) == 1,
""); "");
static_assert(static_cast<unsigned short>( static_assert(static_cast<uint16_t>(
mojom::AppCacheStatus::APPCACHE_STATUS_CHECKING) == 2, mojom::AppCacheStatus::APPCACHE_STATUS_CHECKING) == 2,
""); "");
static_assert(static_cast<unsigned short>( static_assert(static_cast<uint16_t>(
mojom::AppCacheStatus::APPCACHE_STATUS_DOWNLOADING) == 3, mojom::AppCacheStatus::APPCACHE_STATUS_DOWNLOADING) == 3,
""); "");
static_assert(static_cast<unsigned short>( static_assert(static_cast<uint16_t>(
mojom::AppCacheStatus::APPCACHE_STATUS_UPDATE_READY) == 4, mojom::AppCacheStatus::APPCACHE_STATUS_UPDATE_READY) == 4,
""); "");
static_assert(static_cast<unsigned short>( static_assert(static_cast<uint16_t>(
mojom::AppCacheStatus::APPCACHE_STATUS_OBSOLETE) == 5, mojom::AppCacheStatus::APPCACHE_STATUS_OBSOLETE) == 5,
""); "");
RecordAPIUseType(); RecordAPIUseType();
ApplicationCacheHost* cache_host = GetApplicationCacheHost(); ApplicationCacheHost* cache_host = GetApplicationCacheHost();
if (!cache_host) { if (!cache_host) {
return static_cast<unsigned short>( return static_cast<uint16_t>(
mojom::AppCacheStatus::APPCACHE_STATUS_UNCACHED); mojom::AppCacheStatus::APPCACHE_STATUS_UNCACHED);
} }
return static_cast<unsigned short>(cache_host->GetStatus()); return static_cast<uint16_t>(cache_host->GetStatus());
} }
void ApplicationCache::update(ExceptionState& exception_state) { void ApplicationCache::update(ExceptionState& exception_state) {
......
...@@ -51,7 +51,7 @@ class ApplicationCache final : public EventTargetWithInlineData, ...@@ -51,7 +51,7 @@ class ApplicationCache final : public EventTargetWithInlineData,
explicit ApplicationCache(LocalFrame*); explicit ApplicationCache(LocalFrame*);
~ApplicationCache() override = default; ~ApplicationCache() override = default;
unsigned short status() const; uint16_t status() const;
void update(ExceptionState&); void update(ExceptionState&);
void swapCache(ExceptionState&); void swapCache(ExceptionState&);
void abort(); void abort();
......
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