| 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 host->set_use_linux_zygote(true); |
| 197 // TODO(mrc): get proper file path when we start using web resources | 198 // TODO(mrc): get proper file path when we start using web resources |
| 198 // that need to be unpacked. | 199 // that need to be unpacked. |
| 199 host->Send(new ChromeUtilityMsg_UnpackWebResource(json_data_)); | 200 host->Send(new ChromeUtilityMsg_UnpackWebResource(json_data_)); |
| 200 } | 201 } |
| 201 | 202 |
| 202 scoped_refptr<WebResourceService> web_resource_service_; | 203 scoped_refptr<WebResourceService> web_resource_service_; |
| 203 | 204 |
| 204 // Holds raw JSON string. | 205 // Holds raw JSON string. |
| 205 std::string json_data_; | 206 std::string json_data_; |
| 206 | 207 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 295 } |
| 295 | 296 |
| 296 void WebResourceService::UpdateResourceCache(const std::string& json_data) { | 297 void WebResourceService::UpdateResourceCache(const std::string& json_data) { |
| 297 UnpackerClient* client = new UnpackerClient(this, json_data); | 298 UnpackerClient* client = new UnpackerClient(this, json_data); |
| 298 client->Start(); | 299 client->Start(); |
| 299 | 300 |
| 300 // Set cache update time in preferences. | 301 // Set cache update time in preferences. |
| 301 prefs_->SetString(last_update_time_pref_name_, | 302 prefs_->SetString(last_update_time_pref_name_, |
| 302 base::DoubleToString(base::Time::Now().ToDoubleT())); | 303 base::DoubleToString(base::Time::Now().ToDoubleT())); |
| 303 } | 304 } |
| OLD | NEW |