| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
| 15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/weak_ptr.h" | 19 #include "base/memory/weak_ptr.h" |
| 20 #include "base/observer_list.h" | 20 #include "base/observer_list.h" |
| 21 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
| 23 #include "content/browser/service_worker/service_worker_metrics.h" | 23 #include "content/browser/service_worker/service_worker_metrics.h" |
| 24 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
| 25 #include "content/common/service_worker/service_worker_status_code.h" | 25 #include "content/common/service_worker/service_worker_status_code.h" |
| 26 #include "content/public/common/console_message_level.h" |
| 26 #include "url/gurl.h" | 27 #include "url/gurl.h" |
| 27 | 28 |
| 28 // Windows headers will redefine SendMessage. | 29 // Windows headers will redefine SendMessage. |
| 29 #ifdef SendMessage | 30 #ifdef SendMessage |
| 30 #undef SendMessage | 31 #undef SendMessage |
| 31 #endif | 32 #endif |
| 32 | 33 |
| 33 struct EmbeddedWorkerMsg_StartWorker_Params; | 34 struct EmbeddedWorkerMsg_StartWorker_Params; |
| 34 | 35 |
| 35 namespace IPC { | 36 namespace IPC { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // Called when the worker is installed. | 174 // Called when the worker is installed. |
| 174 void OnWorkerVersionInstalled(); | 175 void OnWorkerVersionInstalled(); |
| 175 | 176 |
| 176 // Called when the worker is doomed. | 177 // Called when the worker is doomed. |
| 177 void OnWorkerVersionDoomed(); | 178 void OnWorkerVersionDoomed(); |
| 178 | 179 |
| 179 // Called when the net::URLRequestJob to load the service worker script | 180 // Called when the net::URLRequestJob to load the service worker script |
| 180 // created. Not called for import scripts. | 181 // created. Not called for import scripts. |
| 181 void OnURLJobCreatedForMainScript(); | 182 void OnURLJobCreatedForMainScript(); |
| 182 | 183 |
| 184 // Add message to the devtools console. |
| 185 void AddMessageToConsole(ConsoleMessageLevel level, |
| 186 const std::string& message); |
| 187 |
| 183 static std::string StatusToString(Status status); | 188 static std::string StatusToString(Status status); |
| 184 static std::string StartingPhaseToString(StartingPhase phase); | 189 static std::string StartingPhaseToString(StartingPhase phase); |
| 185 | 190 |
| 186 void Detach(); | 191 void Detach(); |
| 187 | 192 |
| 188 base::WeakPtr<EmbeddedWorkerInstance> AsWeakPtr(); | 193 base::WeakPtr<EmbeddedWorkerInstance> AsWeakPtr(); |
| 189 | 194 |
| 190 private: | 195 private: |
| 191 typedef base::ObserverList<Listener> ListenerList; | 196 typedef base::ObserverList<Listener> ListenerList; |
| 192 class DevToolsProxy; | 197 class DevToolsProxy; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 base::TimeTicks step_time_; | 313 base::TimeTicks step_time_; |
| 309 | 314 |
| 310 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; | 315 base::WeakPtrFactory<EmbeddedWorkerInstance> weak_factory_; |
| 311 | 316 |
| 312 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); | 317 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerInstance); |
| 313 }; | 318 }; |
| 314 | 319 |
| 315 } // namespace content | 320 } // namespace content |
| 316 | 321 |
| 317 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ | 322 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_INSTANCE_H_ |
| OLD | NEW |