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

Side by Side Diff: chrome/browser/extensions/activity_log/activity_log.h

Issue 16510002: Better ActivityLog error handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstating the command line Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_
6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ 6 #define CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 // For unit tests only. 118 // For unit tests only.
119 void SetArgumentLoggingForTesting(bool log_arguments); 119 void SetArgumentLoggingForTesting(bool log_arguments);
120 120
121 private: 121 private:
122 friend class ActivityLogFactory; 122 friend class ActivityLogFactory;
123 123
124 explicit ActivityLog(Profile* profile); 124 explicit ActivityLog(Profile* profile);
125 virtual ~ActivityLog(); 125 virtual ~ActivityLog();
126 126
127 // Reset the database in case of persistent catastrophic errors.
128 void DatabaseErrorCallback(int error, sql::Statement* stmt);
129
130 // We log callbacks and API calls very similarly, so we handle them the same 127 // We log callbacks and API calls very similarly, so we handle them the same
131 // way internally. 128 // way internally.
132 void LogAPIActionInternal( 129 void LogAPIActionInternal(
133 const std::string& extension_id, 130 const std::string& extension_id,
134 const std::string& api_call, 131 const std::string& api_call,
135 ListValue* args, 132 ListValue* args,
136 const std::string& extra, 133 const std::string& extra,
137 const APIAction::Type type); 134 const APIAction::Type type);
138 135
139 // TabHelper::ScriptExecutionObserver implementation. 136 // TabHelper::ScriptExecutionObserver implementation.
140 // Fires when a ContentScript is executed. 137 // Fires when a ContentScript is executed.
141 virtual void OnScriptsExecuted( 138 virtual void OnScriptsExecuted(
142 const content::WebContents* web_contents, 139 const content::WebContents* web_contents,
143 const ExecutingScriptsMap& extension_ids, 140 const ExecutingScriptsMap& extension_ids,
144 int32 page_id, 141 int32 page_id,
145 const GURL& on_url) OVERRIDE; 142 const GURL& on_url) OVERRIDE;
146 143
147 // The callback when initializing the database.
148 void OnDBInitComplete();
149
150 // The Schedule methods dispatch the calls to the database on a 144 // The Schedule methods dispatch the calls to the database on a
151 // separate thread. We dispatch to the UI thread if the DB thread doesn't 145 // separate thread. We dispatch to the UI thread if the DB thread doesn't
152 // exist, which should only happen in tests where there is no DB thread. 146 // exist, which should only happen in tests where there is no DB thread.
153 template<typename DatabaseFunc> 147 template<typename DatabaseFunc>
154 void ScheduleAndForget(DatabaseFunc func) { 148 void ScheduleAndForget(DatabaseFunc func) {
155 BrowserThread::PostTask(dispatch_thread_, 149 BrowserThread::PostTask(dispatch_thread_,
156 FROM_HERE, 150 FROM_HERE,
157 base::Bind(func, base::Unretained(db_))); 151 base::Bind(func, base::Unretained(db_)));
158 } 152 }
159 153
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 virtual content::BrowserContext* GetBrowserContextToUse( 217 virtual content::BrowserContext* GetBrowserContextToUse(
224 content::BrowserContext* context) const OVERRIDE; 218 content::BrowserContext* context) const OVERRIDE;
225 219
226 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory); 220 DISALLOW_COPY_AND_ASSIGN(ActivityLogFactory);
227 }; 221 };
228 222
229 223
230 } // namespace extensions 224 } // namespace extensions
231 225
232 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_ 226 #endif // CHROME_BROWSER_EXTENSIONS_ACTIVITY_LOG_ACTIVITY_LOG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698