Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Unified Diff: content/browser/shared_worker/shared_worker_host.cc

Issue 177043003: Implement SharedWorkerServiceImpl::CreateWorker and SharedWorkerInstance and SharedWorkerHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/shared_worker/shared_worker_host.cc
diff --git a/content/browser/service_worker/service_worker_registration.cc b/content/browser/shared_worker/shared_worker_host.cc
similarity index 24%
copy from content/browser/service_worker/service_worker_registration.cc
copy to content/browser/shared_worker/shared_worker_host.cc
index e3a7e9597b40c9bddd14ccff7280eefea8818033..9b61c749f4ba5e2ae8f856eb4238d7dbc4a44929 100644
--- a/content/browser/service_worker/service_worker_registration.cc
+++ b/content/browser/shared_worker/shared_worker_host.cc
@@ -1,44 +1,31 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "content/browser/service_worker/service_worker_registration.h"
+#include "content/browser/shared_worker/shared_worker_host.h"
+#include "content/browser/shared_worker/shared_worker_instance.h"
+#include "content/browser/shared_worker/shared_worker_message_filter.h"
#include "content/public/browser/browser_thread.h"
namespace content {
-ServiceWorkerRegistration::ServiceWorkerRegistration(const GURL& pattern,
- const GURL& script_url,
- int64 registration_id)
- : pattern_(pattern),
- script_url_(script_url),
- registration_id_(registration_id),
- next_version_id_(0L),
- is_shutdown_(false) {
+SharedWorkerHost::SharedWorkerHost(SharedWorkerInstance* instance)
+ : instance_(instance),
+ worker_route_id_(MSG_ROUTING_NONE) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
}
-ServiceWorkerRegistration::~ServiceWorkerRegistration() {
+SharedWorkerHost::~SharedWorkerHost() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- DCHECK(is_shutdown_);
}
-void ServiceWorkerRegistration::Shutdown() {
- DCHECK(!is_shutdown_);
- if (active_version_)
- active_version_->Shutdown();
- active_version_ = NULL;
- if (pending_version_)
- pending_version_->Shutdown();
- pending_version_ = NULL;
- is_shutdown_ = true;
-}
-
-void ServiceWorkerRegistration::ActivatePendingVersion() {
- active_version_->Shutdown();
- active_version_ = pending_version_;
- pending_version_ = NULL;
+bool SharedWorkerHost::Init(SharedWorkerMessageFilter* filter) {
+ DCHECK(worker_route_id_ == MSG_ROUTING_NONE);
+ worker_route_id_ = filter->GetNextRoutingID();
+ // TODO(horo): implement this.
+ NOTIMPLEMENTED();
+ return false;
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698