OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/devtools/protocol/service_worker_handler.h" | 5 #include "content/browser/devtools/protocol/service_worker_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/browser/background_sync/background_sync_context.h" | 10 #include "content/browser/background_sync/background_sync_context.h" |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 if (host) | 415 if (host) |
416 version_value->SetTargetId(host->GetId()); | 416 version_value->SetTargetId(host->GetId()); |
417 result->addItem(std::move(version_value)); | 417 result->addItem(std::move(version_value)); |
418 } | 418 } |
419 frontend_->WorkerVersionUpdated(std::move(result)); | 419 frontend_->WorkerVersionUpdated(std::move(result)); |
420 } | 420 } |
421 | 421 |
422 void ServiceWorkerHandler::OnErrorReported( | 422 void ServiceWorkerHandler::OnErrorReported( |
423 int64_t registration_id, | 423 int64_t registration_id, |
424 int64_t version_id, | 424 int64_t version_id, |
425 const ServiceWorkerContextObserver::ErrorInfo& info) { | 425 const ServiceWorkerContextCoreObserver::ErrorInfo& info) { |
426 frontend_->WorkerErrorReported( | 426 frontend_->WorkerErrorReported( |
427 ServiceWorker::ServiceWorkerErrorMessage::Create() | 427 ServiceWorker::ServiceWorkerErrorMessage::Create() |
428 .SetErrorMessage(base::UTF16ToUTF8(info.error_message)) | 428 .SetErrorMessage(base::UTF16ToUTF8(info.error_message)) |
429 .SetRegistrationId(base::Int64ToString(registration_id)) | 429 .SetRegistrationId(base::Int64ToString(registration_id)) |
430 .SetVersionId(base::Int64ToString(version_id)) | 430 .SetVersionId(base::Int64ToString(version_id)) |
431 .SetSourceURL(info.source_url.spec()) | 431 .SetSourceURL(info.source_url.spec()) |
432 .SetLineNumber(info.line_number) | 432 .SetLineNumber(info.line_number) |
433 .SetColumnNumber(info.column_number) | 433 .SetColumnNumber(info.column_number) |
434 .Build()); | 434 .Build()); |
435 } | 435 } |
436 | 436 |
437 void ServiceWorkerHandler::ClearForceUpdate() { | 437 void ServiceWorkerHandler::ClearForceUpdate() { |
438 if (context_) | 438 if (context_) |
439 context_->SetForceUpdateOnPageLoad(false); | 439 context_->SetForceUpdateOnPageLoad(false); |
440 } | 440 } |
441 | 441 |
442 } // namespace protocol | 442 } // namespace protocol |
443 } // namespace content | 443 } // namespace content |
OLD | NEW |