| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 if (process) | 145 if (process) |
| 146 base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE, | 146 base::KillProcess(process, content::RESULT_CODE_KILLED_BAD_MESSAGE, |
| 147 false); | 147 false); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 UIThreadExtensionFunction::UIThreadExtensionFunction() | 150 UIThreadExtensionFunction::UIThreadExtensionFunction() |
| 151 : render_view_host_(NULL), profile_(NULL), delegate_(NULL) { | 151 : render_view_host_(NULL), profile_(NULL), delegate_(NULL) { |
| 152 } | 152 } |
| 153 | 153 |
| 154 UIThreadExtensionFunction::~UIThreadExtensionFunction() { | 154 UIThreadExtensionFunction::~UIThreadExtensionFunction() { |
| 155 if (dispatcher()) | 155 if (dispatcher() && render_view_host()) |
| 156 dispatcher()->OnExtensionFunctionCompleted(GetExtension()); | 156 dispatcher()->OnExtensionFunctionCompleted(GetExtension()); |
| 157 } | 157 } |
| 158 | 158 |
| 159 UIThreadExtensionFunction* | 159 UIThreadExtensionFunction* |
| 160 UIThreadExtensionFunction::AsUIThreadExtensionFunction() { | 160 UIThreadExtensionFunction::AsUIThreadExtensionFunction() { |
| 161 return this; | 161 return this; |
| 162 } | 162 } |
| 163 | 163 |
| 164 bool UIThreadExtensionFunction::OnMessageReceivedFromRenderView( | 164 bool UIThreadExtensionFunction::OnMessageReceivedFromRenderView( |
| 165 const IPC::Message& message) { | 165 const IPC::Message& message) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { | 238 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { |
| 239 } | 239 } |
| 240 | 240 |
| 241 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { | 241 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { |
| 242 } | 242 } |
| 243 | 243 |
| 244 void SyncIOThreadExtensionFunction::Run() { | 244 void SyncIOThreadExtensionFunction::Run() { |
| 245 SendResponse(RunImpl()); | 245 SendResponse(RunImpl()); |
| 246 } | 246 } |
| OLD | NEW |