Android: Store language .pak files in res/raw rather than assets
[chromium-blink-merge.git] / content / browser / service_worker / service_worker_context_observer.h
blobcf35d46b1b23f0dae196073700d87263e51c81f4
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_
8 #include "base/strings/string16.h"
9 #include "base/time/time.h"
10 #include "content/browser/service_worker/service_worker_version.h"
11 #include "url/gurl.h"
13 namespace content {
15 class ServiceWorkerContextObserver {
16 public:
17 struct ErrorInfo {
18 ErrorInfo(const base::string16& message,
19 int line,
20 int column,
21 const GURL& url)
22 : error_message(message),
23 line_number(line),
24 column_number(column),
25 source_url(url) {}
26 const base::string16 error_message;
27 const int line_number;
28 const int column_number;
29 const GURL source_url;
31 struct ConsoleMessage {
32 ConsoleMessage(int source_identifier,
33 int message_level,
34 const base::string16& message,
35 int line_number,
36 const GURL& source_url)
37 : source_identifier(source_identifier),
38 message_level(message_level),
39 message(message),
40 line_number(line_number),
41 source_url(source_url) {}
42 const int source_identifier;
43 const int message_level;
44 const base::string16 message;
45 const int line_number;
46 const GURL source_url;
48 virtual void OnNewLiveRegistration(int64 registration_id,
49 const GURL& pattern) {}
50 virtual void OnNewLiveVersion(int64 version_id,
51 int64 registration_id,
52 const GURL& script_url) {}
53 virtual void OnRunningStateChanged(
54 int64 version_id,
55 ServiceWorkerVersion::RunningStatus running_status) {}
56 virtual void OnVersionStateChanged(int64 version_id,
57 ServiceWorkerVersion::Status status) {}
58 virtual void OnMainScriptHttpResponseInfoSet(
59 int64 version_id,
60 base::Time script_response_time,
61 base::Time script_last_modified) {}
62 virtual void OnErrorReported(int64 version_id,
63 int process_id,
64 int thread_id,
65 const ErrorInfo& info) {}
66 virtual void OnReportConsoleMessage(int64 version_id,
67 int process_id,
68 int thread_id,
69 const ConsoleMessage& message) {}
70 virtual void OnControlleeAdded(int64 version_id,
71 const std::string& uuid,
72 int process_id,
73 int route_id,
74 ServiceWorkerProviderType type) {}
75 virtual void OnControlleeRemoved(int64 version_id, const std::string& uuid) {}
76 virtual void OnRegistrationStored(int64 registration_id,
77 const GURL& pattern) {}
78 virtual void OnRegistrationDeleted(int64 registration_id,
79 const GURL& pattern) {}
81 // Notified when the storage corruption recovery is completed and all stored
82 // data is wiped out.
83 virtual void OnStorageWiped() {}
85 protected:
86 virtual ~ServiceWorkerContextObserver() {}
89 } // namespace content
91 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_OBSERVER_H_