| 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/renderer/extensions/miscellaneous_bindings.h" | 5 #include "chrome/renderer/extensions/miscellaneous_bindings.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 arguments.size(), &arguments[0], | 213 arguments.size(), &arguments[0], |
| 214 &retval)) { | 214 &retval)) { |
| 215 continue; | 215 continue; |
| 216 } | 216 } |
| 217 | 217 |
| 218 if (try_catch.HasCaught()) { | 218 if (try_catch.HasCaught()) { |
| 219 LOG(ERROR) << "Exception caught when calling Port.dispatchOnConnect."; | 219 LOG(ERROR) << "Exception caught when calling Port.dispatchOnConnect."; |
| 220 continue; | 220 continue; |
| 221 } | 221 } |
| 222 | 222 |
| 223 CHECK(!retval.IsEmpty() && retval->IsBoolean()); | 223 CHECK(!retval.IsEmpty()); |
| 224 CHECK(retval->IsBoolean()); |
| 224 if (retval->BooleanValue()) | 225 if (retval->BooleanValue()) |
| 225 port_created = true; | 226 port_created = true; |
| 226 } | 227 } |
| 227 | 228 |
| 228 // If we didn't create a port, notify the other end of the channel (treat it | 229 // If we didn't create a port, notify the other end of the channel (treat it |
| 229 // as a disconnect). | 230 // as a disconnect). |
| 230 if (!port_created) { | 231 if (!port_created) { |
| 231 content::RenderThread::Get()->Send( | 232 content::RenderThread::Get()->Send( |
| 232 new ExtensionHostMsg_CloseChannel(target_port_id, true)); | 233 new ExtensionHostMsg_CloseChannel(target_port_id, true)); |
| 233 } | 234 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 std::vector<v8::Handle<v8::Value> > arguments; | 296 std::vector<v8::Handle<v8::Value> > arguments; |
| 296 arguments.push_back(v8::Integer::New(port_id)); | 297 arguments.push_back(v8::Integer::New(port_id)); |
| 297 arguments.push_back(v8::Boolean::New(connection_error)); | 298 arguments.push_back(v8::Boolean::New(connection_error)); |
| 298 (*it)->CallChromeHiddenMethod("Port.dispatchOnDisconnect", | 299 (*it)->CallChromeHiddenMethod("Port.dispatchOnDisconnect", |
| 299 arguments.size(), &arguments[0], | 300 arguments.size(), &arguments[0], |
| 300 NULL); | 301 NULL); |
| 301 } | 302 } |
| 302 } | 303 } |
| 303 | 304 |
| 304 } // namespace extensions | 305 } // namespace extensions |
| OLD | NEW |