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

Side by Side Diff: webkit/support/platform_support_mac.mm

Issue 8524016: webkit: Remove 1 exit time destructor and turn on -Wexit-time-destructors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/support/platform_support_linux.cc ('k') | webkit/support/webkit_support.gypi » ('j') | 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 "webkit/support/platform_support.h" 5 #include "webkit/support/platform_support.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 #import <Foundation/Foundation.h> 8 #import <Foundation/Foundation.h>
9 #import <objc/objc-runtime.h> 9 #import <objc/objc-runtime.h>
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 PathService::Get(base::DIR_EXE, &path); 192 PathService::Get(base::DIR_EXE, &path);
193 path = path.Append(FilePath::kParentDirectory); 193 path = path.Append(FilePath::kParentDirectory);
194 return path.AppendASCII("Resources"); 194 return path.AppendASCII("Resources");
195 } 195 }
196 196
197 base::StringPiece GetDataResource(int resource_id) { 197 base::StringPiece GetDataResource(int resource_id) {
198 switch (resource_id) { 198 switch (resource_id) {
199 case IDR_BROKENIMAGE: { 199 case IDR_BROKENIMAGE: {
200 // Use webkit's broken image icon (16x16) 200 // Use webkit's broken image icon (16x16)
201 static std::string broken_image_data; 201 CR_DEFINE_STATIC_LOCAL(std::string, broken_image_data, ());
202 if (broken_image_data.empty()) { 202 if (broken_image_data.empty()) {
203 FilePath path = GetResourcesFilePath(); 203 FilePath path = GetResourcesFilePath();
204 // In order to match WebKit's colors for the missing image, we have to 204 // In order to match WebKit's colors for the missing image, we have to
205 // use a PNG. The GIF doesn't have the color range needed to correctly 205 // use a PNG. The GIF doesn't have the color range needed to correctly
206 // match the TIFF they use in Safari. 206 // match the TIFF they use in Safari.
207 path = path.AppendASCII("missingImage.png"); 207 path = path.AppendASCII("missingImage.png");
208 bool success = file_util::ReadFileToString(path, &broken_image_data); 208 bool success = file_util::ReadFileToString(path, &broken_image_data);
209 if (!success) { 209 if (!success) {
210 LOG(FATAL) << "Failed reading: " << path.value(); 210 LOG(FATAL) << "Failed reading: " << path.value();
211 } 211 }
212 } 212 }
213 return broken_image_data; 213 return broken_image_data;
214 } 214 }
215 case IDR_TEXTAREA_RESIZER: { 215 case IDR_TEXTAREA_RESIZER: {
216 // Use webkit's text area resizer image. 216 // Use webkit's text area resizer image.
217 static std::string resize_corner_data; 217 CR_DEFINE_STATIC_LOCAL(std::string, resize_corner_data, ());
218 if (resize_corner_data.empty()) { 218 if (resize_corner_data.empty()) {
219 FilePath path = GetResourcesFilePath(); 219 FilePath path = GetResourcesFilePath();
220 path = path.AppendASCII("textAreaResizeCorner.png"); 220 path = path.AppendASCII("textAreaResizeCorner.png");
221 bool success = file_util::ReadFileToString(path, &resize_corner_data); 221 bool success = file_util::ReadFileToString(path, &resize_corner_data);
222 if (!success) { 222 if (!success) {
223 LOG(FATAL) << "Failed reading: " << path.value(); 223 LOG(FATAL) << "Failed reading: " << path.value();
224 } 224 }
225 } 225 }
226 return resize_corner_data; 226 return resize_corner_data;
227 } 227 }
228 } 228 }
229 base::StringPiece res; 229 base::StringPiece res;
230 if (g_resource_data_pack) 230 if (g_resource_data_pack)
231 g_resource_data_pack->GetStringPiece(resource_id, &res); 231 g_resource_data_pack->GetStringPiece(resource_id, &res);
232 return res; 232 return res;
233 } 233 }
234 234
235 } // namespace webkit_glue 235 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/support/platform_support_linux.cc ('k') | webkit/support/webkit_support.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698