| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 // UtilityProcessHost::Client | 69 // UtilityProcessHost::Client |
| 70 virtual bool OnMessageReceived(const IPC::Message& message) { | 70 virtual bool OnMessageReceived(const IPC::Message& message) { |
| 71 bool handled = true; | 71 bool handled = true; |
| 72 IPC_BEGIN_MESSAGE_MAP(WebResourceService::UnpackerClient, message) | 72 IPC_BEGIN_MESSAGE_MAP(WebResourceService::UnpackerClient, message) |
| 73 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_UnpackWebResource_Succeeded, | 73 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_UnpackWebResource_Succeeded, |
| 74 OnUnpackWebResourceSucceeded) | 74 OnUnpackWebResourceSucceeded) |
| 75 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_UnpackWebResource_Failed, | 75 IPC_MESSAGE_HANDLER(ChromeUtilityHostMsg_UnpackWebResource_Failed, |
| 76 OnUnpackWebResourceFailed) | 76 OnUnpackWebResourceFailed) |
| 77 IPC_MESSAGE_UNHANDLED(handled = false) | 77 IPC_MESSAGE_UNHANDLED(handled = false) |
| 78 IPC_END_MESSAGE_MAP_EX() | 78 IPC_END_MESSAGE_MAP() |
| 79 return handled; | 79 return handled; |
| 80 } | 80 } |
| 81 | 81 |
| 82 virtual void OnProcessCrashed(int exit_code) { | 82 virtual void OnProcessCrashed(int exit_code) { |
| 83 if (got_response_) | 83 if (got_response_) |
| 84 return; | 84 return; |
| 85 | 85 |
| 86 OnUnpackWebResourceFailed( | 86 OnUnpackWebResourceFailed( |
| 87 "Utility process crashed while trying to retrieve web resources."); | 87 "Utility process crashed while trying to retrieve web resources."); |
| 88 } | 88 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 std::string data; | 230 std::string data; |
| 231 source->GetResponseAsString(&data); | 231 source->GetResponseAsString(&data); |
| 232 | 232 |
| 233 // UnpackerClient releases itself. | 233 // UnpackerClient releases itself. |
| 234 UnpackerClient* client = new UnpackerClient(this); | 234 UnpackerClient* client = new UnpackerClient(this); |
| 235 client->Start(data); | 235 client->Start(data); |
| 236 | 236 |
| 237 Release(); | 237 Release(); |
| 238 } | 238 } |
| OLD | NEW |