OLD | NEW |
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 "chrome/browser/web_resource/web_resource_service.h" | 5 #include "chrome/browser/web_resource/web_resource_service.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 void Cleanup() { | 187 void Cleanup() { |
188 if (got_response_) | 188 if (got_response_) |
189 return; | 189 return; |
190 | 190 |
191 got_response_ = true; | 191 got_response_ = true; |
192 Release(); | 192 Release(); |
193 } | 193 } |
194 | 194 |
195 void StartProcessOnIOThread(BrowserThread::ID thread_id) { | 195 void StartProcessOnIOThread(BrowserThread::ID thread_id) { |
196 UtilityProcessHost* host = new UtilityProcessHost(this, thread_id); | 196 UtilityProcessHost* host = new UtilityProcessHost(this, thread_id); |
| 197 #if defined(OS_LINUX) |
| 198 host->set_should_use_zygote(true); |
| 199 #endif |
197 // TODO(mrc): get proper file path when we start using web resources | 200 // TODO(mrc): get proper file path when we start using web resources |
198 // that need to be unpacked. | 201 // that need to be unpacked. |
199 host->Send(new ChromeUtilityMsg_UnpackWebResource(json_data_)); | 202 host->Send(new ChromeUtilityMsg_UnpackWebResource(json_data_)); |
200 } | 203 } |
201 | 204 |
202 scoped_refptr<WebResourceService> web_resource_service_; | 205 scoped_refptr<WebResourceService> web_resource_service_; |
203 | 206 |
204 // Holds raw JSON string. | 207 // Holds raw JSON string. |
205 std::string json_data_; | 208 std::string json_data_; |
206 | 209 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 } | 297 } |
295 | 298 |
296 void WebResourceService::UpdateResourceCache(const std::string& json_data) { | 299 void WebResourceService::UpdateResourceCache(const std::string& json_data) { |
297 UnpackerClient* client = new UnpackerClient(this, json_data); | 300 UnpackerClient* client = new UnpackerClient(this, json_data); |
298 client->Start(); | 301 client->Start(); |
299 | 302 |
300 // Set cache update time in preferences. | 303 // Set cache update time in preferences. |
301 prefs_->SetString(last_update_time_pref_name_, | 304 prefs_->SetString(last_update_time_pref_name_, |
302 base::DoubleToString(base::Time::Now().ToDoubleT())); | 305 base::DoubleToString(base::Time::Now().ToDoubleT())); |
303 } | 306 } |
OLD | NEW |