Commit 68698531 authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Rename enum class file_error::ErrorCode to FileErrorCode

This CL rename the enum class to FileErrorCode and move it out of the
namespace file_error.

Change-Id: I39ee10e35bbdcf0b3b0efdda159e21b255e477b1
Reviewed-on: https://chromium-review.googlesource.com/c/1328628Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Reviewed-by: default avatarAdam Rice <ricea@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609619}
parent 57d5d1dc
......@@ -72,33 +72,33 @@ const char kTypeMismatchErrorMessage[] =
namespace {
DOMExceptionCode ErrorCodeToExceptionCode(ErrorCode code) {
DOMExceptionCode ErrorCodeToExceptionCode(FileErrorCode code) {
switch (code) {
case ErrorCode::kOK:
case FileErrorCode::kOK:
return DOMExceptionCode::kNoError;
case ErrorCode::kNotFoundErr:
case FileErrorCode::kNotFoundErr:
return DOMExceptionCode::kNotFoundError;
case ErrorCode::kSecurityErr:
case FileErrorCode::kSecurityErr:
return DOMExceptionCode::kSecurityError;
case ErrorCode::kAbortErr:
case FileErrorCode::kAbortErr:
return DOMExceptionCode::kAbortError;
case ErrorCode::kNotReadableErr:
case FileErrorCode::kNotReadableErr:
return DOMExceptionCode::kNotReadableError;
case ErrorCode::kEncodingErr:
case FileErrorCode::kEncodingErr:
return DOMExceptionCode::kEncodingError;
case ErrorCode::kNoModificationAllowedErr:
case FileErrorCode::kNoModificationAllowedErr:
return DOMExceptionCode::kNoModificationAllowedError;
case ErrorCode::kInvalidStateErr:
case FileErrorCode::kInvalidStateErr:
return DOMExceptionCode::kInvalidStateError;
case ErrorCode::kSyntaxErr:
case FileErrorCode::kSyntaxErr:
return DOMExceptionCode::kSyntaxError;
case ErrorCode::kInvalidModificationErr:
case FileErrorCode::kInvalidModificationErr:
return DOMExceptionCode::kInvalidModificationError;
case ErrorCode::kQuotaExceededErr:
case FileErrorCode::kQuotaExceededErr:
return DOMExceptionCode::kQuotaExceededError;
case ErrorCode::kTypeMismatchErr:
case FileErrorCode::kTypeMismatchErr:
return DOMExceptionCode::kTypeMismatchError;
case ErrorCode::kPathExistsErr:
case FileErrorCode::kPathExistsErr:
return DOMExceptionCode::kPathExistsError;
default:
NOTREACHED();
......@@ -106,35 +106,35 @@ DOMExceptionCode ErrorCodeToExceptionCode(ErrorCode code) {
}
}
const char* ErrorCodeToMessage(ErrorCode code) {
const char* ErrorCodeToMessage(FileErrorCode code) {
// Note that some of these do not set message. If message is 0 then the
// default message is used.
switch (code) {
case ErrorCode::kOK:
case FileErrorCode::kOK:
return nullptr;
case ErrorCode::kSecurityErr:
case FileErrorCode::kSecurityErr:
return kSecurityErrorMessage;
case ErrorCode::kNotFoundErr:
case FileErrorCode::kNotFoundErr:
return kNotFoundErrorMessage;
case ErrorCode::kAbortErr:
case FileErrorCode::kAbortErr:
return kAbortErrorMessage;
case ErrorCode::kNotReadableErr:
case FileErrorCode::kNotReadableErr:
return kNotReadableErrorMessage;
case ErrorCode::kEncodingErr:
case FileErrorCode::kEncodingErr:
return kEncodingErrorMessage;
case ErrorCode::kNoModificationAllowedErr:
case FileErrorCode::kNoModificationAllowedErr:
return kNoModificationAllowedErrorMessage;
case ErrorCode::kInvalidStateErr:
case FileErrorCode::kInvalidStateErr:
return kInvalidStateErrorMessage;
case ErrorCode::kSyntaxErr:
case FileErrorCode::kSyntaxErr:
return kSyntaxErrorMessage;
case ErrorCode::kInvalidModificationErr:
case FileErrorCode::kInvalidModificationErr:
return nullptr;
case ErrorCode::kQuotaExceededErr:
case FileErrorCode::kQuotaExceededErr:
return kQuotaExceededErrorMessage;
case ErrorCode::kTypeMismatchErr:
case FileErrorCode::kTypeMismatchErr:
return nullptr;
case ErrorCode::kPathExistsErr:
case FileErrorCode::kPathExistsErr:
return kPathExistsErrorMessage;
default:
NOTREACHED();
......@@ -229,14 +229,14 @@ const char* FileErrorToMessage(base::File::Error code) {
} // namespace
void ThrowDOMException(ExceptionState& exception_state,
ErrorCode code,
FileErrorCode code,
String message) {
if (code == ErrorCode::kOK)
if (code == FileErrorCode::kOK)
return;
// SecurityError is special-cased, as we want to route those exceptions
// through ExceptionState::ThrowSecurityError.
if (code == ErrorCode::kSecurityErr) {
if (code == FileErrorCode::kSecurityErr) {
exception_state.ThrowSecurityError(kSecurityErrorMessage);
return;
}
......@@ -268,8 +268,8 @@ void ThrowDOMException(ExceptionState& exception_state,
exception_state.ThrowDOMException(FileErrorToExceptionCode(error), message);
}
DOMException* CreateDOMException(ErrorCode code) {
DCHECK_NE(code, ErrorCode::kOK);
DOMException* CreateDOMException(FileErrorCode code) {
DCHECK_NE(code, FileErrorCode::kOK);
return DOMException::Create(ErrorCodeToExceptionCode(code),
ErrorCodeToMessage(code));
}
......
......@@ -40,9 +40,7 @@ namespace blink {
class DOMException;
class ExceptionState;
namespace file_error {
enum class ErrorCode {
enum class FileErrorCode {
kOK = 0,
kNotFoundErr = 1,
kSecurityErr = 2,
......@@ -58,6 +56,8 @@ enum class ErrorCode {
kPathExistsErr = 12,
};
namespace file_error {
CORE_EXPORT extern const char kAbortErrorMessage[];
CORE_EXPORT extern const char kEncodingErrorMessage[];
CORE_EXPORT extern const char kInvalidStateErrorMessage[];
......@@ -71,12 +71,12 @@ CORE_EXPORT extern const char kSyntaxErrorMessage[];
CORE_EXPORT extern const char kTypeMismatchErrorMessage[];
CORE_EXPORT void ThrowDOMException(ExceptionState&,
ErrorCode,
FileErrorCode,
String message = String());
CORE_EXPORT void ThrowDOMException(ExceptionState& exception_state,
base::File::Error error,
String message = String());
CORE_EXPORT DOMException* CreateDOMException(ErrorCode);
CORE_EXPORT DOMException* CreateDOMException(FileErrorCode);
CORE_EXPORT DOMException* CreateDOMException(base::File::Error);
} // namespace file_error
......
......@@ -338,7 +338,7 @@ void FileReader::abort() {
base::AutoReset<bool> firing_events(&still_firing_events_, true);
// Setting error implicitly makes |result| return null.
error_ = file_error::CreateDOMException(file_error::ErrorCode::kAbortErr);
error_ = file_error::CreateDOMException(FileErrorCode::kAbortErr);
// Unregister the reader.
ThrottlingController::FinishReaderType final_step =
......@@ -432,7 +432,7 @@ void FileReader::DidFinishLoading() {
ThrottlingController::FinishReader(GetExecutionContext(), this, final_step);
}
void FileReader::DidFail(file_error::ErrorCode error_code) {
void FileReader::DidFail(FileErrorCode error_code) {
if (loading_state_ == kLoadingStateAborted)
return;
......
......@@ -43,13 +43,10 @@
namespace blink {
namespace file_error {
enum class ErrorCode;
}
class Blob;
class ExceptionState;
class ExecutionContext;
enum class FileErrorCode;
class StringOrArrayBuffer;
class CORE_EXPORT FileReader final : public EventTargetWithInlineData,
......@@ -93,7 +90,7 @@ class CORE_EXPORT FileReader final : public EventTargetWithInlineData,
void DidStartLoading() override;
void DidReceiveData() override;
void DidFinishLoading() override;
void DidFail(file_error::ErrorCode) override;
void DidFail(FileErrorCode) override;
DEFINE_ATTRIBUTE_EVENT_LISTENER(loadstart, kLoadstart);
DEFINE_ATTRIBUTE_EVENT_LISTENER(progress, kProgress);
......
......@@ -100,8 +100,7 @@ void FileReaderLoader::Start(scoped_refptr<BlobDataHandle> blob_data) {
mojo::ScopedDataPipeProducerHandle producer_handle;
MojoResult rv = CreateDataPipe(&options, &producer_handle, &consumer_handle_);
if (rv != MOJO_RESULT_OK) {
Failed(file_error::ErrorCode::kNotReadableErr,
FailureType::kMojoPipeCreation);
Failed(FileErrorCode::kNotReadableErr, FailureType::kMojoPipeCreation);
return;
}
......@@ -116,7 +115,7 @@ void FileReaderLoader::Start(scoped_refptr<BlobDataHandle> blob_data) {
if (received_on_complete_)
return;
if (!received_all_data_) {
Failed(file_error::ErrorCode::kNotReadableErr,
Failed(FileErrorCode::kNotReadableErr,
FailureType::kSyncDataNotAllLoaded);
return;
}
......@@ -124,14 +123,14 @@ void FileReaderLoader::Start(scoped_refptr<BlobDataHandle> blob_data) {
// Wait for OnComplete
binding_.WaitForIncomingMethodCall();
if (!received_on_complete_) {
Failed(file_error::ErrorCode::kNotReadableErr,
Failed(FileErrorCode::kNotReadableErr,
FailureType::kSyncOnCompleteNotReceived);
}
}
}
void FileReaderLoader::Cancel() {
error_code_ = file_error::ErrorCode::kAbortErr;
error_code_ = FileErrorCode::kAbortErr;
Cleanup();
}
......@@ -141,7 +140,7 @@ DOMArrayBuffer* FileReaderLoader::ArrayBufferResult() {
return array_buffer_result_;
// If the loading is not started or an error occurs, return an empty result.
if (!raw_data_ || error_code_ != file_error::ErrorCode::kOK)
if (!raw_data_ || error_code_ != FileErrorCode::kOK)
return nullptr;
DOMArrayBuffer* result = DOMArrayBuffer::Create(raw_data_->ToArrayBuffer());
......@@ -158,7 +157,7 @@ String FileReaderLoader::StringResult() {
DCHECK_NE(read_type_, kReadAsArrayBuffer);
DCHECK_NE(read_type_, kReadByClient);
if (!raw_data_ || (error_code_ != file_error::ErrorCode::kOK) ||
if (!raw_data_ || (error_code_ != FileErrorCode::kOK) ||
is_raw_data_converted_) {
return string_result_;
}
......@@ -201,7 +200,7 @@ void FileReaderLoader::Cleanup() {
consumer_handle_.reset();
// If we get any error, we do not need to keep a buffer around.
if (error_code_ != file_error::ErrorCode::kOK) {
if (error_code_ != FileErrorCode::kOK) {
raw_data_.reset();
string_result_ = "";
is_raw_data_converted_ = true;
......@@ -211,13 +210,12 @@ void FileReaderLoader::Cleanup() {
}
}
void FileReaderLoader::Failed(file_error::ErrorCode error_code,
FailureType type) {
void FileReaderLoader::Failed(FileErrorCode error_code, FailureType type) {
DEFINE_THREAD_SAFE_STATIC_LOCAL(EnumerationHistogram, failure_histogram,
("Storage.Blob.FileReaderLoader.FailureType",
static_cast<int>(FailureType::kCount)));
// If an error was already reported, don't report this error again.
if (error_code_ != file_error::ErrorCode::kOK)
if (error_code_ != FileErrorCode::kOK)
return;
error_code_ = error_code;
failure_histogram.Count(static_cast<int>(type));
......@@ -236,14 +234,13 @@ void FileReaderLoader::OnStartLoading(uint64_t total_bytes) {
// so to call ArrayBuffer's create function.
// FIXME: Support reading more than the current size limit of ArrayBuffer.
if (total_bytes > std::numeric_limits<unsigned>::max()) {
Failed(file_error::ErrorCode::kNotReadableErr,
FailureType::kTotalBytesTooLarge);
Failed(FileErrorCode::kNotReadableErr, FailureType::kTotalBytesTooLarge);
return;
}
raw_data_ = std::make_unique<ArrayBufferBuilder>(total_bytes);
if (!raw_data_->IsValid()) {
Failed(file_error::ErrorCode::kNotReadableErr,
Failed(FileErrorCode::kNotReadableErr,
FailureType::kArrayBufferBuilderCreation);
return;
}
......@@ -258,7 +255,7 @@ void FileReaderLoader::OnReceivedData(const char* data, unsigned data_length) {
DCHECK(data);
// Bail out if we already encountered an error.
if (error_code_ != file_error::ErrorCode::kOK)
if (error_code_ != FileErrorCode::kOK)
return;
if (read_type_ == kReadByClient) {
......@@ -273,7 +270,7 @@ void FileReaderLoader::OnReceivedData(const char* data, unsigned data_length) {
if (!bytes_appended) {
raw_data_.reset();
bytes_loaded_ = 0;
Failed(file_error::ErrorCode::kNotReadableErr,
Failed(FileErrorCode::kNotReadableErr,
FailureType::kArrayBufferBuilderAppend);
return;
}
......@@ -329,15 +326,13 @@ void FileReaderLoader::OnComplete(int32_t status, uint64_t data_length) {
if (status != net::OK) {
net_error_ = status;
file_reader_loader_read_errors_histogram.Sample(std::max(0, -net_error_));
Failed(status == net::ERR_FILE_NOT_FOUND
? file_error::ErrorCode::kNotFoundErr
: file_error::ErrorCode::kNotReadableErr,
Failed(status == net::ERR_FILE_NOT_FOUND ? FileErrorCode::kNotFoundErr
: FileErrorCode::kNotReadableErr,
FailureType::kBackendReadError);
return;
}
if (data_length != total_bytes_) {
Failed(file_error::ErrorCode::kNotReadableErr,
FailureType::kReadSizesIncorrect);
Failed(FileErrorCode::kNotReadableErr, FailureType::kReadSizesIncorrect);
return;
}
......@@ -349,7 +344,7 @@ void FileReaderLoader::OnComplete(int32_t status, uint64_t data_length) {
void FileReaderLoader::OnDataPipeReadable(MojoResult result) {
if (result != MOJO_RESULT_OK) {
if (!received_all_data_) {
Failed(file_error::ErrorCode::kNotReadableErr,
Failed(FileErrorCode::kNotReadableErr,
FailureType::kDataPipeNotReadableWithBytesLeft);
}
return;
......@@ -371,13 +366,13 @@ void FileReaderLoader::OnDataPipeReadable(MojoResult result) {
if (result == MOJO_RESULT_FAILED_PRECONDITION) {
// Pipe closed.
if (!received_all_data_) {
Failed(file_error::ErrorCode::kNotReadableErr,
Failed(FileErrorCode::kNotReadableErr,
FailureType::kMojoPipeClosedEarly);
}
return;
}
if (result != MOJO_RESULT_OK) {
Failed(file_error::ErrorCode::kNotReadableErr,
Failed(FileErrorCode::kNotReadableErr,
FailureType::kMojoPipeUnexpectedReadError);
return;
}
......
......@@ -97,7 +97,7 @@ class CORE_EXPORT FileReaderLoader : public mojom::blink::BlobReaderClient {
// After OnCalculatedSize() is called: Returns the size of the resource.
base::Optional<uint64_t> TotalBytes() const { return total_bytes_; }
file_error::ErrorCode GetErrorCode() const { return error_code_; }
FileErrorCode GetErrorCode() const { return error_code_; }
int32_t GetNetError() const { return net_error_; }
......@@ -128,7 +128,7 @@ class CORE_EXPORT FileReaderLoader : public mojom::blink::BlobReaderClient {
};
void Cleanup();
void Failed(file_error::ErrorCode, FailureType type);
void Failed(FileErrorCode, FailureType type);
void OnStartLoading(uint64_t total_bytes);
void OnReceivedData(const char* data, unsigned data_length);
......@@ -172,7 +172,7 @@ class CORE_EXPORT FileReaderLoader : public mojom::blink::BlobReaderClient {
int64_t memory_usage_reported_to_v8_ = 0;
int32_t net_error_ = 0; // net::OK
file_error::ErrorCode error_code_ = file_error::ErrorCode::kOK;
FileErrorCode error_code_ = FileErrorCode::kOK;
mojo::ScopedDataPipeConsumerHandle consumer_handle_;
mojo::SimpleWatcher handle_watcher_;
......
......@@ -36,9 +36,7 @@
namespace blink {
namespace file_error {
enum class ErrorCode;
}
enum class FileErrorCode;
class CORE_EXPORT FileReaderLoaderClient {
public:
......@@ -54,7 +52,7 @@ class CORE_EXPORT FileReaderLoaderClient {
NOTREACHED();
}
virtual void DidFinishLoading() = 0;
virtual void DidFail(file_error::ErrorCode) = 0;
virtual void DidFail(FileErrorCode) = 0;
};
} // namespace blink
......
......@@ -116,7 +116,7 @@ void FileReaderSync::StartLoading(FileReaderLoader& loader,
const Blob& blob,
ExceptionState& exception_state) {
loader.Start(blob.GetBlobDataHandle());
if (loader.GetErrorCode() != file_error::ErrorCode::kOK)
if (loader.GetErrorCode() != FileErrorCode::kOK)
file_error::ThrowDOMException(exception_state, loader.GetErrorCode());
}
......
......@@ -291,7 +291,7 @@ void ImageBitmapFactories::ImageBitmapLoader::DidFinishLoading() {
ScheduleAsyncImageBitmapDecoding(array_buffer);
}
void ImageBitmapFactories::ImageBitmapLoader::DidFail(file_error::ErrorCode) {
void ImageBitmapFactories::ImageBitmapLoader::DidFail(FileErrorCode) {
RejectPromise(kUndecodableImageBitmapRejectionReason);
}
......
......@@ -145,7 +145,7 @@ class ImageBitmapFactories final
void DidStartLoading() override {}
void DidReceiveData() override {}
void DidFinishLoading() override;
void DidFail(file_error::ErrorCode) override;
void DidFail(FileErrorCode) override;
std::unique_ptr<FileReaderLoader> loader_;
Member<ImageBitmapFactories> factory_;
......
......@@ -186,7 +186,7 @@ class InspectorFileReaderLoaderClient final : public FileReaderLoaderClient {
void DidFinishLoading() override { Done(raw_data_); }
void DidFail(file_error::ErrorCode) override { Done(nullptr); }
void DidFail(FileErrorCode) override { Done(nullptr); }
private:
void Done(scoped_refptr<SharedBuffer> output) {
......
......@@ -239,9 +239,7 @@ class XMLHttpRequest::BlobLoader final
xhr_->DidReceiveData(data, length);
}
void DidFinishLoading() override { xhr_->DidFinishLoadingFromBlob(); }
void DidFail(file_error::ErrorCode error) override {
xhr_->DidFailLoadingFromBlob();
}
void DidFail(FileErrorCode error) override { xhr_->DidFailLoadingFromBlob(); }
void Cancel() { loader_->Cancel(); }
......
......@@ -395,7 +395,7 @@ class CachedResponseFileReaderLoaderClient final
dispose();
}
void DidFail(file_error::ErrorCode error) override {
void DidFail(FileErrorCode error) override {
callback_->sendFailure(ProtocolResponse::Error(String::Format(
"Unable to read the cached response, error code: %d", error)));
dispose();
......
......@@ -84,11 +84,11 @@ void FileWriter::write(Blob* data, ExceptionState& exception_state) {
DCHECK(data);
DCHECK_EQ(truncate_length_, -1);
if (ready_state_ == kWriting) {
SetError(file_error::ErrorCode::kInvalidStateErr, exception_state);
SetError(FileErrorCode::kInvalidStateErr, exception_state);
return;
}
if (recursion_depth_ > kMaxRecursionDepth) {
SetError(file_error::ErrorCode::kSecurityErr, exception_state);
SetError(FileErrorCode::kSecurityErr, exception_state);
return;
}
......@@ -112,7 +112,7 @@ void FileWriter::seek(long long position, ExceptionState& exception_state) {
if (!GetExecutionContext())
return;
if (ready_state_ == kWriting) {
SetError(file_error::ErrorCode::kInvalidStateErr, exception_state);
SetError(FileErrorCode::kInvalidStateErr, exception_state);
return;
}
......@@ -126,11 +126,11 @@ void FileWriter::truncate(long long position, ExceptionState& exception_state) {
return;
DCHECK_EQ(truncate_length_, -1);
if (ready_state_ == kWriting || position < 0) {
SetError(file_error::ErrorCode::kInvalidStateErr, exception_state);
SetError(FileErrorCode::kInvalidStateErr, exception_state);
return;
}
if (recursion_depth_ > kMaxRecursionDepth) {
SetError(file_error::ErrorCode::kSecurityErr, exception_state);
SetError(FileErrorCode::kSecurityErr, exception_state);
return;
}
......@@ -318,9 +318,9 @@ void FileWriter::FireEvent(const AtomicString& type) {
DCHECK_GE(recursion_depth_, 0);
}
void FileWriter::SetError(file_error::ErrorCode error_code,
void FileWriter::SetError(FileErrorCode error_code,
ExceptionState& exception_state) {
DCHECK_NE(error_code, file_error::ErrorCode::kOK);
DCHECK_NE(error_code, FileErrorCode::kOK);
file_error::ThrowDOMException(exception_state, error_code);
error_ = file_error::CreateDOMException(error_code);
}
......
......@@ -40,14 +40,11 @@
namespace blink {
namespace file_error {
enum class ErrorCode;
}
class Blob;
class DOMException;
class ExceptionState;
class ExecutionContext;
enum class FileErrorCode;
class FileWriter final : public EventTargetWithInlineData,
public FileWriterBase,
......@@ -119,7 +116,7 @@ class FileWriter final : public EventTargetWithInlineData,
void FireEvent(const AtomicString& type);
void SetError(file_error::ErrorCode, ExceptionState&);
void SetError(FileErrorCode, ExceptionState&);
void Dispose();
......
......@@ -106,7 +106,7 @@ void IDBRequestLoader::DidFinishLoading() {
StartNextValue();
}
void IDBRequestLoader::DidFail(file_error::ErrorCode) {
void IDBRequestLoader::DidFail(FileErrorCode) {
#if DCHECK_IS_ON()
DCHECK(started_)
<< "FileReaderLoader called DidFail() before it was Start()ed";
......
......@@ -52,7 +52,7 @@ class IDBRequestLoader : public FileReaderLoaderClient {
void DidStartLoading() override;
void DidReceiveDataForClient(const char* data, unsigned data_length) override;
void DidFinishLoading() override;
void DidFail(file_error::ErrorCode) override;
void DidFail(FileErrorCode) override;
private:
// Starts unwrapping the next wrapped IDBValue.
......
......@@ -137,7 +137,7 @@ class PresentationConnection::BlobLoader final
presentation_connection_->DidFinishLoadingBlob(
loader_->ArrayBufferResult());
}
void DidFail(file_error::ErrorCode error_code) override {
void DidFail(FileErrorCode error_code) override {
presentation_connection_->DidFailLoadingBlob(error_code);
}
......@@ -609,8 +609,7 @@ void PresentationConnection::DidFinishLoadingBlob(DOMArrayBuffer* buffer) {
HandleMessageQueue();
}
void PresentationConnection::DidFailLoadingBlob(
file_error::ErrorCode error_code) {
void PresentationConnection::DidFailLoadingBlob(FileErrorCode error_code) {
DCHECK(!messages_.IsEmpty());
DCHECK_EQ(messages_.front()->type, kMessageTypeBlob);
// FIXME: generate error message?
......
......@@ -22,12 +22,9 @@ class AtomicString;
namespace blink {
namespace file_error {
enum class ErrorCode;
}
class DOMArrayBuffer;
class DOMArrayBufferView;
enum class FileErrorCode;
class PresentationController;
class PresentationReceiver;
class PresentationRequest;
......@@ -134,7 +131,7 @@ class PresentationConnection : public EventTargetWithInlineData,
// Callbacks invoked from BlobLoader.
void DidFinishLoadingBlob(DOMArrayBuffer*);
void DidFailLoadingBlob(file_error::ErrorCode);
void DidFailLoadingBlob(FileErrorCode);
void SendMessageToTargetConnection(
mojom::blink::PresentationConnectionMessagePtr);
......
......@@ -89,7 +89,7 @@ class WebSocketChannelImpl::BlobLoader final
void DidStartLoading() override {}
void DidReceiveData() override {}
void DidFinishLoading() override;
void DidFail(file_error::ErrorCode) override;
void DidFail(FileErrorCode) override;
void Trace(blink::Visitor* visitor) { visitor->Trace(channel_); }
......@@ -140,8 +140,7 @@ void WebSocketChannelImpl::BlobLoader::DidFinishLoading() {
loader_ = nullptr;
}
void WebSocketChannelImpl::BlobLoader::DidFail(
file_error::ErrorCode error_code) {
void WebSocketChannelImpl::BlobLoader::DidFail(FileErrorCode error_code) {
channel_->DidFailLoadingBlob(error_code);
loader_ = nullptr;
}
......@@ -767,10 +766,9 @@ void WebSocketChannelImpl::DidFinishLoadingBlob(DOMArrayBuffer* buffer) {
ProcessSendQueue();
}
void WebSocketChannelImpl::DidFailLoadingBlob(
file_error::ErrorCode error_code) {
void WebSocketChannelImpl::DidFailLoadingBlob(FileErrorCode error_code) {
blob_loader_.Clear();
if (error_code == file_error::ErrorCode::kAbortErr) {
if (error_code == FileErrorCode::kAbortErr) {
// The error is caused by cancel().
return;
}
......
......@@ -54,11 +54,8 @@
namespace blink {
namespace file_error {
enum class ErrorCode;
}
class BaseFetchContext;
enum class FileErrorCode;
class WebSocketChannelClient;
class WebSocketHandshakeThrottle;
......@@ -180,7 +177,7 @@ class MODULES_EXPORT WebSocketChannelImpl final
// Methods for BlobLoader.
void DidFinishLoadingBlob(DOMArrayBuffer*);
void DidFailLoadingBlob(file_error::ErrorCode);
void DidFailLoadingBlob(FileErrorCode);
void TearDownFailedConnection();
bool ShouldDisallowConnection(const KURL&);
......
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