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

Side by Side Diff: chrome/browser/extensions/extension_webnavigation_api.cc

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: thakis comment, renamed LAZY_INSTANCE_INITIALIZER Created 9 years, 1 month 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 // Implements the Chrome Extensions WebNavigation API. 5 // Implements the Chrome Extensions WebNavigation API.
6 6
7 #include "chrome/browser/extensions/extension_webnavigation_api.h" 7 #include "chrome/browser/extensions/extension_webnavigation_api.h"
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 11 matching lines...) Expand all
22 #include "content/public/browser/notification_service.h" 22 #include "content/public/browser/notification_service.h"
23 #include "content/public/browser/notification_types.h" 23 #include "content/public/browser/notification_types.h"
24 #include "net/base/net_errors.h" 24 #include "net/base/net_errors.h"
25 25
26 namespace keys = extension_webnavigation_api_constants; 26 namespace keys = extension_webnavigation_api_constants;
27 27
28 namespace { 28 namespace {
29 29
30 typedef std::map<TabContents*, ExtensionWebNavigationTabObserver*> 30 typedef std::map<TabContents*, ExtensionWebNavigationTabObserver*>
31 TabObserverMap; 31 TabObserverMap;
32 static base::LazyInstance<TabObserverMap> g_tab_observer( 32 static base::LazyInstance<TabObserverMap> g_tab_observer =
33 base::LINKER_INITIALIZED); 33 LAZY_INSTANCE_INITIALIZER;
34 34
35 // URL schemes for which we'll send events. 35 // URL schemes for which we'll send events.
36 const char* kValidSchemes[] = { 36 const char* kValidSchemes[] = {
37 chrome::kHttpScheme, 37 chrome::kHttpScheme,
38 chrome::kHttpsScheme, 38 chrome::kHttpsScheme,
39 chrome::kFileScheme, 39 chrome::kFileScheme,
40 chrome::kFtpScheme, 40 chrome::kFtpScheme,
41 chrome::kJavaScriptScheme, 41 chrome::kJavaScriptScheme,
42 chrome::kDataScheme, 42 chrome::kDataScheme,
43 }; 43 };
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 keys::kFrameIdKey, 723 keys::kFrameIdKey,
724 GetFrameId(navigation_state.IsMainFrame(*frame), *frame)); 724 GetFrameId(navigation_state.IsMainFrame(*frame), *frame));
725 frameDict->SetBoolean( 725 frameDict->SetBoolean(
726 keys::kErrorOccurredKey, 726 keys::kErrorOccurredKey,
727 navigation_state.GetErrorOccurredInFrame(*frame)); 727 navigation_state.GetErrorOccurredInFrame(*frame));
728 resultList->Append(frameDict); 728 resultList->Append(frameDict);
729 } 729 }
730 result_.reset(resultList); 730 result_.reset(resultList);
731 return true; 731 return true;
732 } 732 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698