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

Side by Side Diff: webkit/tools/test_shell/test_shell_mac.mm

Issue 8491043: Allow linker initialization of lazy instance (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: willchan comments + rebase 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
« no previous file with comments | « webkit/tools/test_shell/simple_clipboard_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <ApplicationServices/ApplicationServices.h> 5 #include <ApplicationServices/ApplicationServices.h>
6 #import <Cocoa/Cocoa.h> 6 #import <Cocoa/Cocoa.h>
7 #import <objc/objc-runtime.h> 7 #import <objc/objc-runtime.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 9
10 #include "webkit/tools/test_shell/test_shell.h" 10 #include "webkit/tools/test_shell/test_shell.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Hide the window offscreen when in layout test mode. Mac OS X limits 67 // Hide the window offscreen when in layout test mode. Mac OS X limits
68 // window positions to +/- 16000. 68 // window positions to +/- 16000.
69 const int kTestWindowXLocation = -14000; 69 const int kTestWindowXLocation = -14000;
70 const int kTestWindowYLocation = -14000; 70 const int kTestWindowYLocation = -14000;
71 71
72 // Data pack resource. This is a pointer to the mmapped resources file. 72 // Data pack resource. This is a pointer to the mmapped resources file.
73 static ui::DataPack* g_resource_data_pack = NULL; 73 static ui::DataPack* g_resource_data_pack = NULL;
74 74
75 // Define static member variables 75 // Define static member variables
76 base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> > 76 base::LazyInstance <std::map<gfx::NativeWindow, TestShell *> >
77 TestShell::window_map_(base::LINKER_INITIALIZED); 77 TestShell::window_map_ = LAZY_INSTANCE_INITIALIZER;
78 78
79 // Helper method for getting the path to the test shell resources directory. 79 // Helper method for getting the path to the test shell resources directory.
80 FilePath GetResourcesFilePath() { 80 FilePath GetResourcesFilePath() {
81 FilePath path; 81 FilePath path;
82 // We need to know if we're bundled or not to know which path to use. 82 // We need to know if we're bundled or not to know which path to use.
83 if (base::mac::AmIBundled()) { 83 if (base::mac::AmIBundled()) {
84 PathService::Get(base::DIR_EXE, &path); 84 PathService::Get(base::DIR_EXE, &path);
85 path = path.Append(FilePath::kParentDirectory); 85 path = path.Append(FilePath::kParentDirectory);
86 return path.AppendASCII("Resources"); 86 return path.AppendASCII("Resources");
87 } else { 87 } else {
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 return false; 690 return false;
691 } 691 }
692 692
693 void DidLoadPlugin(const std::string& filename) { 693 void DidLoadPlugin(const std::string& filename) {
694 } 694 }
695 695
696 void DidUnloadPlugin(const std::string& filename) { 696 void DidUnloadPlugin(const std::string& filename) {
697 } 697 }
698 698
699 } // namespace webkit_glue 699 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/tools/test_shell/simple_clipboard_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698