| 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/extensions/extension_function.h" | 5 #include "chrome/browser/extensions/extension_function.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 9 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 void ExtensionFunction::HandleBadMessage(base::ProcessHandle process) { | 106 void ExtensionFunction::HandleBadMessage(base::ProcessHandle process) { |
| 107 LOG(ERROR) << "bad extension message " << name_ << " : terminating renderer."; | 107 LOG(ERROR) << "bad extension message " << name_ << " : terminating renderer."; |
| 108 if (RenderProcessHost::run_renderer_in_process()) { | 108 if (RenderProcessHost::run_renderer_in_process()) { |
| 109 // In single process mode it is better if we don't suicide but just crash. | 109 // In single process mode it is better if we don't suicide but just crash. |
| 110 CHECK(false); | 110 CHECK(false); |
| 111 } else { | 111 } else { |
| 112 NOTREACHED(); | 112 NOTREACHED(); |
| 113 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD")); | 113 UserMetrics::RecordAction(UserMetricsAction("BadMessageTerminate_EFD")); |
| 114 if (process) | 114 if (process) |
| 115 base::KillProcess(process, ResultCodes::KILLED_BAD_MESSAGE, false); | 115 base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE, |
| 116 false); |
| 116 } | 117 } |
| 117 } | 118 } |
| 118 UIThreadExtensionFunction::UIThreadExtensionFunction() | 119 UIThreadExtensionFunction::UIThreadExtensionFunction() |
| 119 : render_view_host_(NULL), profile_(NULL) { | 120 : render_view_host_(NULL), profile_(NULL) { |
| 120 } | 121 } |
| 121 | 122 |
| 122 UIThreadExtensionFunction::~UIThreadExtensionFunction() { | 123 UIThreadExtensionFunction::~UIThreadExtensionFunction() { |
| 123 } | 124 } |
| 124 | 125 |
| 125 UIThreadExtensionFunction* | 126 UIThreadExtensionFunction* |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 | 194 |
| 194 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { | 195 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { |
| 195 } | 196 } |
| 196 | 197 |
| 197 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { | 198 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { |
| 198 } | 199 } |
| 199 | 200 |
| 200 void SyncIOThreadExtensionFunction::Run() { | 201 void SyncIOThreadExtensionFunction::Run() { |
| 201 SendResponse(RunImpl()); | 202 SendResponse(RunImpl()); |
| 202 } | 203 } |
| OLD | NEW |