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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp

Issue 2845963002: [ServiceWorker] Add type attribute into Client object (Closed)
Patch Set: Address comments from foolip@ Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp
index e54315d65277fed9fa01869b3dd762bb52a1f38c..7064e44dec15b10d480d2c09dc9e0bb44d4f4f0e 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.cpp
@@ -45,10 +45,28 @@ ServiceWorkerClient* ServiceWorkerClient::Create(
ServiceWorkerClient::ServiceWorkerClient(const WebServiceWorkerClientInfo& info)
: uuid_(info.uuid),
url_(info.url.GetString()),
+ type_(info.client_type),
frame_type_(info.frame_type) {}
ServiceWorkerClient::~ServiceWorkerClient() {}
+String ServiceWorkerClient::type() const {
+ switch (type_) {
+ case kWebServiceWorkerClientTypeWindow:
+ return "window";
+ case kWebServiceWorkerClientTypeWorker:
+ return "worker";
+ case kWebServiceWorkerClientTypeSharedWorker:
+ return "sharedworker";
+ case kWebServiceWorkerClientTypeAll:
+ NOTREACHED();
+ return String();
+ }
+
+ NOTREACHED();
+ return String();
+}
+
String ServiceWorkerClient::frameType() const {
switch (frame_type_) {
case WebURLRequest::kFrameTypeAuxiliary:
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698