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

Side by Side Diff: base/path_service.cc

Issue 7087014: Support automatic javascript test registry in gtest when creating WebUI tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added example of helper functions which aren't included as tests. Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "base/path_service.h" 5 #include "base/path_service.h"
6 6
7 #ifdef OS_WIN 7 #ifdef OS_WIN
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <shlobj.h> 10 #include <shlobj.h>
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 p = new Provider; 259 p = new Provider;
260 p->is_static = false; 260 p->is_static = false;
261 p->func = func; 261 p->func = func;
262 p->next = path_data->providers; 262 p->next = path_data->providers;
263 #ifndef NDEBUG 263 #ifndef NDEBUG
264 p->key_start = key_start; 264 p->key_start = key_start;
265 p->key_end = key_end; 265 p->key_end = key_end;
266 #endif 266 #endif
267 path_data->providers = p; 267 path_data->providers = p;
268 } 268 }
269
270 void PathService::UnregisterProvider(ProviderFunc provider) {
271 PathData* path_data = GetPathData();
272 DCHECK(path_data);
273
274 base::AutoLock scoped_lock(path_data->lock);
275
276 for(Provider** p = &path_data->providers; *p; p = &(*p)->next) {
277 if ((*p)->func == provider) {
278 for(int key = (*p)->key_start; key != (*p)->key_end; ++key) {
279 // Removed the computed path from our cache.
280 path_data->cache.erase(key);
281 }
282 *p = (*p)->next;
283 return;
284 }
285 }
286 NOTREACHED();
287 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698