Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / browser / service_worker / service_worker_internals_ui.cc
index e976ad8..1421fe4 100644 (file)
@@ -189,11 +189,11 @@ void UpdateVersionInfo(const ServiceWorkerVersionInfo& version,
     case ServiceWorkerVersion::ACTIVATING:
       info->SetString("status", "ACTIVATING");
       break;
-    case ServiceWorkerVersion::ACTIVE:
-      info->SetString("status", "ACTIVE");
+    case ServiceWorkerVersion::ACTIVATED:
+      info->SetString("status", "ACTIVATED");
       break;
-    case ServiceWorkerVersion::DEACTIVATED:
-      info->SetString("status", "DEACTIVATED");
+    case ServiceWorkerVersion::REDUNDANT:
+      info->SetString("status", "REDUNDANT");
       break;
   }
   info->SetString("version_id", base::Int64ToString(version.version_id));
@@ -500,6 +500,7 @@ void ServiceWorkerInternalsUI::AddContextFromStoragePartition(
     context->AddObserver(new_observer.get());
     observers_.set(reinterpret_cast<uintptr_t>(partition), new_observer.Pass());
   }
+
   BrowserThread::PostTask(
       BrowserThread::IO,
       FROM_HERE,
@@ -510,7 +511,9 @@ void ServiceWorkerInternalsUI::AddContextFromStoragePartition(
                             base::Bind(OnAllRegistrations,
                                        AsWeakPtr(),
                                        partition_id,
-                                       partition->GetPath()))));
+                                       context->is_incognito()
+                                           ? base::FilePath()
+                                           : partition->GetPath()))));
 }
 
 void ServiceWorkerInternalsUI::RemoveObserverFromStoragePartition(
@@ -560,11 +563,11 @@ void ServiceWorkerInternalsUI::CallServiceWorkerVersionMethod(
     const ListValue* args) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   int callback_id;
-  int partition_id;
-  int64 version_id;
-  std::string version_id_string;
   const DictionaryValue* cmd_args = NULL;
+  int partition_id;
   scoped_refptr<ServiceWorkerContextWrapper> context;
+  std::string version_id_string;
+  int64 version_id = 0;
   if (!args->GetInteger(0, &callback_id) ||
       !args->GetDictionary(1, &cmd_args) ||
       !cmd_args->GetInteger("partition_id", &partition_id) ||
@@ -585,7 +588,7 @@ void ServiceWorkerInternalsUI::DispatchPushEvent(
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   int callback_id;
   int partition_id;
-  int64 version_id;
+  int64 version_id = 0;
   std::string version_id_string;
   const DictionaryValue* cmd_args = NULL;
   scoped_refptr<ServiceWorkerContextWrapper> context;
@@ -606,10 +609,9 @@ void ServiceWorkerInternalsUI::DispatchPushEvent(
 void ServiceWorkerInternalsUI::InspectWorker(const ListValue* args) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   int callback_id;
-  int process_id;
-  int devtools_agent_route_id;
   const DictionaryValue* cmd_args = NULL;
-  scoped_refptr<ServiceWorkerContextWrapper> context;
+  int process_id = 0;
+  int devtools_agent_route_id = 0;
   if (!args->GetInteger(0, &callback_id) ||
       !args->GetDictionary(1, &cmd_args) ||
       !cmd_args->GetInteger("process_id", &process_id) ||