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

Side by Side Diff: webkit/support/platform_support_linux.cc

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/quota/webkit_quota.gypi ('k') | webkit/support/platform_support_mac.mm » ('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 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 string16 GetLocalizedString(int message_id) { 45 string16 GetLocalizedString(int message_id) {
46 return ResourceBundle::GetSharedInstance().GetLocalizedString(message_id); 46 return ResourceBundle::GetSharedInstance().GetLocalizedString(message_id);
47 } 47 }
48 48
49 base::StringPiece GetDataResource(int resource_id) { 49 base::StringPiece GetDataResource(int resource_id) {
50 FilePath resources_path; 50 FilePath resources_path;
51 PathService::Get(base::DIR_EXE, &resources_path); 51 PathService::Get(base::DIR_EXE, &resources_path);
52 resources_path = resources_path.Append("DumpRenderTree_resources"); 52 resources_path = resources_path.Append("DumpRenderTree_resources");
53 switch (resource_id) { 53 switch (resource_id) {
54 case IDR_BROKENIMAGE: { 54 case IDR_BROKENIMAGE: {
55 static std::string broken_image_data; 55 CR_DEFINE_STATIC_LOCAL(std::string, broken_image_data, ());
56 if (broken_image_data.empty()) { 56 if (broken_image_data.empty()) {
57 FilePath path = resources_path.Append("missingImage.gif"); 57 FilePath path = resources_path.Append("missingImage.gif");
58 bool success = file_util::ReadFileToString(path, &broken_image_data); 58 bool success = file_util::ReadFileToString(path, &broken_image_data);
59 if (!success) 59 if (!success)
60 LOG(FATAL) << "Failed reading: " << path.value(); 60 LOG(FATAL) << "Failed reading: " << path.value();
61 } 61 }
62 return broken_image_data; 62 return broken_image_data;
63 } 63 }
64 case IDR_TEXTAREA_RESIZER: { 64 case IDR_TEXTAREA_RESIZER: {
65 static std::string resize_corner_data; 65 CR_DEFINE_STATIC_LOCAL(std::string, resize_corner_data, ());
66 if (resize_corner_data.empty()) { 66 if (resize_corner_data.empty()) {
67 FilePath path = resources_path.Append("textAreaResizeCorner.png"); 67 FilePath path = resources_path.Append("textAreaResizeCorner.png");
68 bool success = file_util::ReadFileToString(path, &resize_corner_data); 68 bool success = file_util::ReadFileToString(path, &resize_corner_data);
69 if (!success) 69 if (!success)
70 LOG(FATAL) << "Failed reading: " << path.value(); 70 LOG(FATAL) << "Failed reading: " << path.value();
71 } 71 }
72 return resize_corner_data; 72 return resize_corner_data;
73 } 73 }
74 } 74 }
75 75
76 return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); 76 return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
77 } 77 }
78 78
79 } // namespace webkit_glue 79 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/quota/webkit_quota.gypi ('k') | webkit/support/platform_support_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698